Looking at this and the fact we have es2020 as a target set in our tsconfig.json, we expect no problems.
However, including our lib in front end applications throws an error, in which bigint ** bigint falsely throws an Uncaught TypeError: Cannot convert a BigInt value to a number.
Exponentiation like this is clearly supported as can be seen here, so we either have a problem with our project setup or this is a bug.
Further investigation needed. For the time being, we can just replace 2n ** 256n - 1n with the following:
Looking at this and the fact we have
es2020
as atarget
set in ourtsconfig.json
, we expect no problems.However, including our lib in front end applications throws an error, in which
bigint ** bigint
falsely throws anUncaught TypeError: Cannot convert a BigInt value to a number
. Exponentiation like this is clearly supported as can be seen here, so we either have a problem with our project setup or this is a bug.Further investigation needed. For the time being, we can just replace
2n ** 256n - 1n
with the following:Using a temporary variable because
prettier
does not allow to use( )
here to ensure correct operator precedence...