a887d5f929
* Added failing test - u.reject should return same instance if no changes. * `u.reject` now returns the same instance if nothing rejected
14 lines
287 B
JavaScript
14 lines
287 B
JavaScript
import _reject from 'lodash/reject';
|
|
import wrap from './wrap';
|
|
|
|
function reject(predicate, collection) {
|
|
const result = _reject(collection, predicate);
|
|
const equal = collection.length === result.length;
|
|
|
|
return equal ?
|
|
collection :
|
|
result;
|
|
}
|
|
|
|
export default wrap(reject);
|