MCPcopy
hub / github.com/CesiumGS/cesium / get

Function get

packages/engine/Source/Scene/MetadataTableProperty.js:411–435  ·  view source on GitHub ↗
(property, index)

Source from the content-addressed store, hash-verified

409}
410
411function get(property, index) {
412 if (requiresUnpackForGet(property)) {
413 unpackProperty(property);
414 }
415
416 const classProperty = property._classProperty;
417 const isArray = classProperty.isArray;
418 const type = classProperty.type;
419 const componentCount = MetadataType.getComponentCount(type);
420
421 if (defined(property._unpackedValues)) {
422 const value = property._unpackedValues[index];
423 if (isArray) {
424 return clone(value, true);
425 }
426 return value;
427 }
428
429 // handle single values
430 if (!isArray && componentCount === 1) {
431 return property._getValue(index);
432 }
433
434 return getArrayValues(property, classProperty, index);
435}
436
437function getArrayValues(property, classProperty, index) {
438 let offset;

Callers 1

Calls 5

requiresUnpackForGetFunction · 0.85
unpackPropertyFunction · 0.85
cloneFunction · 0.85
getArrayValuesFunction · 0.85
definedFunction · 0.50

Tested by

no test coverage detected