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

Bigint support #22

Closed tomtheisen closed 5 years ago

tomtheisen commented 5 years ago

Bigint is now supported by chrome and node. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

This library is not compatible with these numbers. isNumber(7n) reports false.

doowb commented 5 years ago

According to the documentation that you linked, it is not recommended to coerce variables between Number and BigInt. It also states that native Math methods do not work with BigInt.

Because of these restrictions, I don't think is-number should return true for BigInt.