mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Ensure _.find works correctly in the Underscore build.
Former-commit-id: c22b91ffcab34b75415f126582c48c168a7cc759
This commit is contained in:
6
build.js
6
build.js
@@ -1393,11 +1393,15 @@
|
||||
});
|
||||
});
|
||||
|
||||
// modify `_.every` and `_.some` to use the private `indicatorObject`
|
||||
// modify `_.every`, `_.find`, and `_.some` to use the private `indicatorObject`
|
||||
source = source.replace(matchFunction(source, 'every'), function(match) {
|
||||
return match.replace(/\(result *= *(.+?)\);/, '!(result = $1) && indicatorObject;');
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'find'), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'some'), function(match) {
|
||||
return match.replace(/!\(result *= *(.+?)\);/, '(result = $1) && indicatorObject;');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user