Urara-Blog/node_modules/.pnpm-store/v3/files/95/f707981a1ea8bb81bff61b9fdf13037ae1b74030ad4f096984a56deffe69a3d007703b6a16fbc440961240fee30945bf7f904f555f6adf75fb64b5d7648407
2022-08-14 01:14:53 +08:00

21 lines
590 B
Text

var baseEach = require('./_baseEach');
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} 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;