MCPcopy Create free account
hub / github.com/microsoft/SandDance / padArray

Function padArray

docs/app/js/sanddance-app.js:86505–86541  ·  view source on GitHub ↗
(_ref2)

Source from the content-addressed store, hash-verified

86503 }
86504}
86505function padArray(_ref2) {
86506 var source = _ref2.source, target = _ref2.target, size = _ref2.size, getData = _ref2.getData, sourceStartIndices = _ref2.sourceStartIndices, targetStartIndices = _ref2.targetStartIndices;
86507 if (!Array.isArray(targetStartIndices)) {
86508 padArrayChunk({
86509 source: source,
86510 target: target,
86511 getData: getData
86512 });
86513 return target;
86514 }
86515 var sourceIndex = 0;
86516 var targetIndex = 0;
86517 var getChunkData = getData && function(i, chunk) {
86518 return getData(i + targetIndex, chunk);
86519 };
86520 var n = Math.min(sourceStartIndices.length, targetStartIndices.length);
86521 for(var i1 = 1; i1 < n; i1++){
86522 var nextSourceIndex = sourceStartIndices[i1] * size;
86523 var nextTargetIndex = targetStartIndices[i1] * size;
86524 padArrayChunk({
86525 source: source.subarray(sourceIndex, nextSourceIndex),
86526 target: target,
86527 start: targetIndex,
86528 end: nextTargetIndex,
86529 getData: getChunkData
86530 });
86531 sourceIndex = nextSourceIndex;
86532 targetIndex = nextTargetIndex;
86533 }
86534 if (targetIndex < target.length) padArrayChunk({
86535 source: [],
86536 target: target,
86537 start: targetIndex,
86538 getData: getChunkData
86539 });
86540 return target;
86541}
86542
86543},{"@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"gLLlZ":[function(require,module,exports) {
86544var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers

nothing calls this directly

Calls 3

padArrayChunkFunction · 0.70
getDataFunction · 0.70
minMethod · 0.45

Tested by

no test coverage detected