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

Function padArrayChunk

docs/app/js/sanddance-app.js:86485–86504  ·  view source on GitHub ↗
(_ref)

Source from the content-addressed store, hash-verified

86483parcelHelpers.defineInteropFlag(exports);
86484parcelHelpers.export(exports, "padArray", ()=>padArray);
86485function padArrayChunk(_ref) {
86486 var source = _ref.source, target = _ref.target, _ref$start = _ref.start, start = _ref$start === void 0 ? 0 : _ref$start, end = _ref.end, getData = _ref.getData;
86487 end = end || target.length;
86488 var sourceLength = source.length;
86489 var targetLength = end - start;
86490 if (sourceLength > targetLength) {
86491 target.set(source.subarray(0, targetLength), start);
86492 return;
86493 }
86494 target.set(source, start);
86495 if (!getData) return;
86496 var i = sourceLength;
86497 while(i < targetLength){
86498 var datum = getData(i, source);
86499 for(var j = 0; j < datum.length; j++){
86500 target[start + i] = datum[j];
86501 i++;
86502 }
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)) {

Callers 1

padArrayFunction · 0.70

Calls 2

getDataFunction · 0.70
setMethod · 0.45

Tested by

no test coverage detected