MCPcopy Create free account
hub / github.com/Crain99/cc-reverse / decodeArray

Function decodeArray

src/core/cocos3x/rehydrate.js:435–444  ·  view source on GitHub ↗

* IArrayData: [items[], ...dataTypesPerItem]. Items are walked and each is * reassigned through the type dispatcher.

(ctx, data)

Source from the content-addressed store, hash-verified

433 * reassigned through the type dispatcher.
434 */
435function decodeArray(ctx, data) {
436 if (!Array.isArray(data) || data.length === 0) return data;
437 const items = Array.isArray(data[0]) ? data[0].slice() : [];
438 for (let i = 0; i < items.length; i += 1) {
439 const dataType = data[i + 1];
440 if (dataType === DataTypeID.SimpleType || dataType == null) continue;
441 assignByType(ctx, items, i, dataType, items[i]);
442 }
443 return items;
444}
445
446// ---------------------------------------------------------------------------
447// Cross-references (refs table)

Callers 1

assignByTypeFunction · 0.85

Calls 1

assignByTypeFunction · 0.85

Tested by

no test coverage detected