MCPcopy Index your code
hub / github.com/nodejs/node / addRange

Function addRange

test/fixtures/snapshot/typescript.js:1195–1208  ·  view source on GitHub ↗
(to, from, start, end)

Source from the content-addressed store, hash-verified

1193 return offset < 0 ? array.length + offset : offset;
1194 }
1195 function addRange(to, from, start, end) {
1196 if (from === undefined || from.length === 0)
1197 return to;
1198 if (to === undefined)
1199 return from.slice(start, end);
1200 start = start === undefined ? 0 : toOffset(from, start);
1201 end = end === undefined ? from.length : toOffset(from, end);
1202 for (var i = start; i < end && i < from.length; i++) {
1203 if (from[i] !== undefined) {
1204 to.push(from[i]);
1205 }
1206 }
1207 return to;
1208 }
1209 ts.addRange = addRange;
1210 /**
1211 * @return Whether the value was added.

Callers 4

flattenFunction · 0.85
flatMapFunction · 0.85
flatMapToMutableFunction · 0.85
sameFlatMapFunction · 0.85

Calls 3

toOffsetFunction · 0.85
sliceMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…