| /** |
| * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> |
| * Build: `lodash modularize exports="node" -o ./compat/` |
| * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> |
| * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> |
| * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors |
| * Available under MIT license <http://lodash.com/license> |
| */ |
| |
| /* Native method shortcuts for methods with the same name as other `lodash` methods */ |
| var nativeIsFinite = global.isFinite, |
| nativeIsNaN = global.isNaN; |
| |
| /** |
| * Checks if `value` is, or can be coerced to, a finite number. |
| * |
| * Note: This is not the same as native `isFinite` which will return true for |
| * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. |
| * |
| * @static |
| * @memberOf _ |
| * @category Objects |
| * @param {*} value The value to check. |
| * @returns {boolean} Returns `true` if the `value` is finite, else `false`. |
| * @example |
| * |
| * _.isFinite(-101); |
| * // => true |
| * |
| * _.isFinite('10'); |
| * // => true |
| * |
| * _.isFinite(true); |
| * // => false |
| * |
| * _.isFinite(''); |
| * // => false |
| * |
| * _.isFinite(Infinity); |
| * // => false |
| */ |
| function isFinite(value) { |
| return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); |
| } |
| |
| module.exports = isFinite; |