function copyObjects(metadata, objects, instantiate) {
  const copies = {};
  for (const object of Object.values(objects)) {
    if (object && object.id != null) {
      copies[object.id] = instantiate(object);
      copies[object.id].metadata = metadata;
    } else {
      console.warn("Missing id:", object);
    }
  }
  return copies;
}
// clone each object in the provided mapping of objects
clone each object in the provided mapping of objects
clone each object in the provided mapping of objects
function copyObjects(metadata, objects, instantiate) {
  const copies = {};
  for (const object of Object.values(objects)) {
    if (object && object.id != null) {
      copies[object.id] = instantiate(object);
      copies[object.id].metadata = metadata;
    } else {
      console.warn("Missing id:", object);
    }
  }
  return copies;
}
function copyObjects ( metadata , objects , instantiate ) { const copies = { } ; for ( const object of Object . values ( objects ) ) { if ( object && object . id != null ) { copies [ object . id ] = instantiate ( object ) ; copies [ object . id ] . metadata = metadata ; } else { console . warn ( "Missing id:" , object ) ; } } return copies ; }
clone each object in the provided mapping of objects
clone each object in the provided mapping of objects