MCPcopy Index your code
hub / github.com/Macuyiko/minecraft-python / flatten

Function flatten

ServerEditorWeb/ace/worker-javascript.js:1664–1676  ·  view source on GitHub ↗
(input, shallow, output)

Source from the content-addressed store, hash-verified

1662 return _.filter(array, _.identity);
1663 };
1664 var flatten = function(input, shallow, output) {
1665 if (shallow && _.every(input, _.isArray)) {
1666 return concat.apply(output, input);
1667 }
1668 each(input, function(value) {
1669 if (_.isArray(value) || _.isArguments(value)) {
1670 shallow ? push.apply(output, value) : flatten(value, shallow, output);
1671 } else {
1672 output.push(value);
1673 }
1674 });
1675 return output;
1676 };
1677 _.flatten = function(array, shallow) {
1678 return flatten(array, shallow, []);
1679 };

Callers 3

worker-coffee.jsFile · 0.85
BlockFunction · 0.85

Calls 1

eachFunction · 0.85

Tested by

no test coverage detected