Sha256: 5b08c099750f14baae7716bcc6bcd4c565a6f891bec0b8f7e8b009abf6f676b0
Contents?: true
Size: 877 Bytes
Versions: 2
Compression:
Stored size: 877 Bytes
Contents
// Stack grow safe implementation 'use strict'; var ensureValue = require('../../object/valid-value') , isArray = Array.isArray, hasOwnProperty = Object.prototype.hasOwnProperty; module.exports = function () { var input = ensureValue(this), index = 0, remaining, remainingIndexes, l, i, result = []; main: //jslint: ignore while (input) { l = input.length; for (i = index; i < l; ++i) { if (!hasOwnProperty.call(input, i)) continue; if (isArray(input[i])) { if (i < (l - 1)) { if (!remaining) { remaining = []; remainingIndexes = []; } remaining.push(input); remainingIndexes.push(i + 1); } input = input[i]; index = 0; continue main; } result.push(input[i]); } if (remaining) { input = remaining.pop(); index = remainingIndexes.pop(); } else { input = null; } } return result; };
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
guard-sass-lint-0.1.2 | node_modules/es5-ext/array/#/flatten.js |
guard-sass-lint-0.1.1 | node_modules/es5-ext/array/#/flatten.js |