4 ms·
That will never be totally reliable as 1) javascript is dynamically typed 2) javascript doesn't support operator overloading. Nonetheless, there are attempts.
by recursive 7y ago
That will never be totally reliable as 1) javascript is dynamically typed 2) javascript doesn't support operator overloading. Nonetheless, there are attempts.
https://www.npmjs.com/package/babel-plugin-transform-bigint https://www.npmjs.com/package/babel-plugin-transform-bigint
> Update: Now it can convert a code using BigInt into a code using JSBI (https://github.com/GoogleChromeLabs/jsbi https://github.com/GoogleChromeLabs/jsbi). It will try to detect when an operator is used for bigints, not numbers. This will not work in many cases, so please use JSBI directly only if you know, that the code works only with bigints.
(emphasis mine)