MCPcopy Create free account
hub / github.com/TruthHun/BookStack / flatten

Function flatten

static/word2md/mammoth.browser.js:16097–16106  ·  view source on GitHub ↗
(input, shallow, output)

Source from the content-addressed store, hash-verified

16095
16096 // Internal implementation of a recursive `flatten` function.
16097 var flatten = function(input, shallow, output) {
16098 each(input, function(value) {
16099 if (_.isArray(value)) {
16100 shallow ? push.apply(output, value) : flatten(value, shallow, output);
16101 } else {
16102 output.push(value);
16103 }
16104 });
16105 return output;
16106 };
16107
16108 // Return a completely flattened version of an array.
16109 _.flatten = function(array, shallow) {

Callers 1

mammoth.browser.jsFile · 0.70

Calls 2

isArrayLikeFunction · 0.70
eachFunction · 0.50

Tested by

no test coverage detected