diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core.js | 14 | ||||
-rw-r--r-- | src/deprecated.js | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/core.js b/src/core.js index 5916b03aa..8ffc4e516 100644 --- a/src/core.js +++ b/src/core.js @@ -204,20 +204,6 @@ jQuery.extend( { noop: function() {}, - isNumeric: function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }, - isPlainObject: function( obj ) { var proto, Ctor; diff --git a/src/deprecated.js b/src/deprecated.js index 0982f3a94..f1b7db7c6 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -79,4 +79,18 @@ jQuery.camelCase = camelCase; jQuery.now = Date.now; +jQuery.isNumeric = function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); +}; + } ); |