Sha256: 16b817c2d31d8ccbd27f1a28f9cf906b6a59315d197bc24ddea649b8b7656d51
Contents?: true
Size: 451 Bytes
Versions: 68
Compression:
Stored size: 451 Bytes
Contents
var Flattener = function () { }; Flattener.prototype.flatten = function (unflattenedArray, inputFlattenedArray) { var self = this; var flattenedArray = inputFlattenedArray || []; unflattenedArray.forEach(function (element) { if (Array.isArray(element)) { self.flatten(element, flattenedArray); } else if (element !== null) { flattenedArray.push(element); } }); return flattenedArray; }; module.exports = Flattener;
Version data entries
68 entries across 68 versions & 1 rubygems