diff options
Diffstat (limited to 'deps/npm/node_modules/cli-table2/node_modules/lodash/internal/baseFilter.js')
-rw-r--r-- | deps/npm/node_modules/cli-table2/node_modules/lodash/internal/baseFilter.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/deps/npm/node_modules/cli-table2/node_modules/lodash/internal/baseFilter.js b/deps/npm/node_modules/cli-table2/node_modules/lodash/internal/baseFilter.js new file mode 100644 index 0000000000..27773a47e1 --- /dev/null +++ b/deps/npm/node_modules/cli-table2/node_modules/lodash/internal/baseFilter.js @@ -0,0 +1,22 @@ +var baseEach = require('./baseEach'); + +/** + * The base implementation of `_.filter` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; |