mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Use Date.now in modern builds.
Former-commit-id: de4329c5f4eaa92da8447e1232ce28e00a0f885d
This commit is contained in:
7
build.js
7
build.js
@@ -3106,7 +3106,7 @@
|
||||
source = removeSupportProp(source, 'fastBind');
|
||||
source = replaceSupportProp(source, 'argsClass', 'false');
|
||||
|
||||
// remove native `Function#bind` branch in `_.bind`
|
||||
// remove native `Function#bind` branch in `createBound`
|
||||
source = source.replace(matchFunction(source, 'createBound'), function(match) {
|
||||
return match.replace(/(?:\s*\/\/.*)*\n( *)if *\([^{]+?nativeBind[\s\S]+?\n\1else *\{([\s\S]+?)\n\1}/, function(match, indent, snippet) {
|
||||
return snippet
|
||||
@@ -3171,6 +3171,11 @@
|
||||
return match.replace(/(?: *\/\/.*\n)*( *return ai[^:]+:).+/, '$1 1;');
|
||||
});
|
||||
|
||||
// replace `+new Date` with `Date.now` use in `_.debounce
|
||||
source = source.replace(matchFunction(source, 'debounce'), function(match) {
|
||||
return match.replace(/\+new Date\b/g, 'now()');
|
||||
});
|
||||
|
||||
// remove `shimIsPlainObject` from `_.isPlainObject`
|
||||
source = source.replace(matchFunction(source, 'isPlainObject'), function(match) {
|
||||
return match.replace(/!getPrototypeOf[^:]+:\s*/, '');
|
||||
|
||||
Reference in New Issue
Block a user