MCPcopy
hub / github.com/microsoft/SandDance / flattenArray

Function flattenArray

docs/app/js/sanddance-app.js:86312–86320  ·  view source on GitHub ↗
(array, filter, result)

Source from the content-addressed store, hash-verified

86310 return flattenArray(array, filter, []);
86311}
86312function flattenArray(array, filter, result) {
86313 var index = -1;
86314 while(++index < array.length){
86315 var value = array[index];
86316 if (Array.isArray(value)) flattenArray(value, filter, result);
86317 else if (filter(value)) result.push(value);
86318 }
86319 return result;
86320}
86321function fillArray(_ref) {
86322 var target = _ref.target, source = _ref.source, _ref$start = _ref.start, start = _ref$start === void 0 ? 0 : _ref$start, _ref$count = _ref.count, count = _ref$count === void 0 ? 1 : _ref$count;
86323 var length = source.length;

Callers 1

flattenFunction · 0.70

Calls 1

filterFunction · 0.70

Tested by

no test coverage detected