MCPcopy
hub / github.com/immutable-js/immutable-js / flatDeep

Function flatDeep

src/Operations.js:732–744  ·  view source on GitHub ↗
(iter, currentDepth)

Source from the content-addressed store, hash-verified

730 let iterations = 0;
731 let stopped = false;
732 function flatDeep(iter, currentDepth) {
733 iter.__iterate((v, k) => {
734 if ((!depth || currentDepth < depth) && isCollection(v)) {
735 flatDeep(v, currentDepth + 1);
736 } else {
737 iterations++;
738 if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) {
739 stopped = true;
740 }
741 }
742 return !stopped;
743 }, reverse);
744 }
745 flatDeep(collection, 0);
746 return iterations;
747 };

Callers 1

flattenFactoryFunction · 0.85

Calls 2

isCollectionFunction · 0.90
__iterateMethod · 0.45

Tested by

no test coverage detected