UNPKG

wonder.js

Version:
24 lines (19 loc) 959 B
'use strict'; var ArrayService$WonderCommonlib = require("wonder-commonlib/lib/js/src/ArrayService.js"); var MutableSparseMapService$WonderCommonlib = require("wonder-commonlib/lib/js/src/MutableSparseMapService.js"); function addChildrenToParent(parent, children, param) { return /* tuple */[ ArrayService$WonderCommonlib.reduceOneParam((function (parentMap, child) { return MutableSparseMapService$WonderCommonlib.set(child, parent, parentMap); }), param[0], children), MutableSparseMapService$WonderCommonlib.set(parent, children, param[1]) ]; } function getArrayBuffer(binBuffer, bufferView, bufferViews) { var match = bufferViews[bufferView]; var byteOffset = match[/* byteOffset */1]; return binBuffer.slice(byteOffset, byteOffset + match[/* byteLength */2] | 0); } exports.addChildrenToParent = addChildrenToParent; exports.getArrayBuffer = getArrayBuffer; /* No side effect */