COLLECTED BY
Organization:
Internet Archive
Focused crawls are collections of frequently-updated webcrawl data from narrow (as opposed to broad or wide) web crawls, often focused on a single domain or subdomain.
The Wayback Machine - https://web.archive.org/web/20201220222116/https://github.com/lodash/lodash/blob/master/reject.js
Permalink
Cannot retrieve contributors at this time
30 lines (28 sloc)
924 Bytes
import filter from './filter.js'
import filterObject from './filterObject.js'
import negate from './negate.js'
/**
* The opposite of `filter` this method returns the elements of `collection`
* that `predicate` does **not** return truthy for.
*
* @since 0.1.0
* @category Collection
* @param {Array|Object } collection The collection to iterate over.
* @param {Function } predicate The function invoked per iteration.
* @returns {Array } Returns the new filtered array.
* @see pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, filter
* @example
*
* const users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ]
*
* reject(users, ({ active }) => active)
* // => objects for ['fred']
*/
function reject ( collection , predicate ) {
const func = Array . isArray ( collection ) ? filter : filterObject
return func ( collection , negate ( predicate ) )
}
export default reject
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.