index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * lodash (Custom Build) <https://lodash.com/>
  3. * Build: `lodash modularize exports="npm" -o ./`
  4. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  5. * Released under MIT license <https://lodash.com/license>
  6. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  7. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8. */
  9. /** Detect free variable `global` from Node.js. */
  10. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11. /** Detect free variable `self`. */
  12. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13. /** Used as a reference to the global object. */
  14. var root = freeGlobal || freeSelf || Function('return this')();
  15. /* Built-in method references for those with the same name as other `lodash` methods. */
  16. var nativeIsFinite = root.isFinite;
  17. /**
  18. * Checks if `value` is a finite primitive number.
  19. *
  20. * **Note:** This method is based on
  21. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  22. *
  23. * @static
  24. * @memberOf _
  25. * @since 0.1.0
  26. * @category Lang
  27. * @param {*} value The value to check.
  28. * @returns {boolean} Returns `true` if `value` is a finite number,
  29. * else `false`.
  30. * @example
  31. *
  32. * _.isFinite(3);
  33. * // => true
  34. *
  35. * _.isFinite(Number.MIN_VALUE);
  36. * // => true
  37. *
  38. * _.isFinite(Infinity);
  39. * // => false
  40. *
  41. * _.isFinite('3');
  42. * // => false
  43. */
  44. function isFinite(value) {
  45. return typeof value == 'number' && nativeIsFinite(value);
  46. }
  47. module.exports = isFinite;