(str)
| 54 | |
| 55 | |
| 56 | export function isNumeric(str) { |
| 57 | if (typeof str != "string") return false // we only process strings! |
| 58 | return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)... |
| 59 | !isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail |
| 60 | } |
| 61 | |
| 62 | |
| 63 | /** |