Stanisław Czech 272334c69f
fix(napi): update logic for handling signed integers (#2356)
* Fix from functions for BigInt

Allow proper parsing of negative integers in those functions.

Fixes the pannic when calling:
BigInt::from(i128::MIN);

* Fix get_i128 and get_i64 for BigInt

Update the getter logic to take sign into account.

for get_i128 and get_u128 make lossless value consistent with the documentation
(documentation described different behavior then the code logic)

* Extend tests for BigInt types

Add more test cases for negative i64 and i128 to test the created changes

* Simplify the to napiValue logic for 128 bit types

Update the logic to handle negative values properly

Refactor to_napi_value and create_bigint_from_*128 to use the same logic
instead of copping mostly the same code 4 times

* Fix specification for deserialize object test

For unknown reason the binary specification was holding different value than spec file
2024-11-18 23:12:11 +08:00
..