updeep-remeda/lib/reject.js

12 lines
273 B
JavaScript
Raw Normal View History

2017-04-19 00:55:46 +00:00
import _reject from 'lodash/reject'
import wrap from './wrap'
function reject(predicate, collection) {
2017-04-19 00:55:46 +00:00
const result = _reject(collection, predicate)
const equal = collection.length === result.length
2017-04-19 00:55:46 +00:00
return equal ? collection : result
}
2017-04-19 00:55:46 +00:00
export default wrap(reject)