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