mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Simplify _.now and _.isFinite.
This commit is contained in:
@@ -765,8 +765,6 @@
|
||||
nativeKeys = getNative(Object, 'keys'),
|
||||
nativeMax = Math.max,
|
||||
nativeMin = Math.min,
|
||||
nativeNow = getNative(Date, 'now'),
|
||||
nativeNumIsFinite = getNative(Number, 'isFinite'),
|
||||
nativeParseInt = context.parseInt,
|
||||
nativeRandom = Math.random;
|
||||
|
||||
@@ -7293,9 +7291,9 @@
|
||||
* }, _.now());
|
||||
* // => logs the number of milliseconds it took for the deferred function to be invoked
|
||||
*/
|
||||
var now = nativeNow || function() {
|
||||
function now() {
|
||||
return new Date().getTime();
|
||||
};
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
@@ -8679,9 +8677,9 @@
|
||||
* _.isFinite(Infinity);
|
||||
* // => false
|
||||
*/
|
||||
var isFinite = nativeNumIsFinite || function(value) {
|
||||
function isFinite(value) {
|
||||
return typeof value == 'number' && nativeIsFinite(value);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Function` object.
|
||||
|
||||
Reference in New Issue
Block a user