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

Function flatMapToMutable

test/fixtures/snapshot/typescript.js:716–732  ·  view source on GitHub ↗
(array, mapfn)

Source from the content-addressed store, hash-verified

714 }
715 ts.flatMap = flatMap;
716 function flatMapToMutable(array, mapfn) {
717 var result = [];
718 if (array) {
719 for (var i = 0; i < array.length; i++) {
720 var v = mapfn(array[i], i);
721 if (v) {
722 if (isArray(v)) {
723 addRange(result, v);
724 }
725 else {
726 result.push(v);
727 }
728 }
729 }
730 }
731 return result;
732 }
733 ts.flatMapToMutable = flatMapToMutable;
734 function flatMapIterator(iter, mapfn) {
735 var first = iter.next();

Callers

nothing calls this directly

Calls 3

addRangeFunction · 0.85
isArrayFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…