jonschlinkert / is-number

JavaScript/Node.js utility. Returns `true` if the value is a number or string number. Useful for checking regex match results, user input, parsed strings, etc.
https://github.com/jonschlinkert
MIT License
258 stars 48 forks source link

Should strings with a number and whitespaces pass? #13

Closed vladshcherbin closed 6 years ago

vladshcherbin commented 6 years ago

Hey, should a string with whitespaces be a number:

var isNumber = require('is-number')
console.log(isNumber('   3 ')) // -> true

I'd expect it to be false.

vladshcherbin commented 6 years ago

Sorry, my bad 🤦‍♂️

jonschlinkert commented 6 years ago

@VladShcherbin don't feel bad, this was a perfectly valid question. thanks for the issue