3 Commits

Author SHA1 Message Date
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
magic-akari
734d74bd02
fix(typegen): add missing declare keyword (#2117) 2024-05-19 16:53:23 +08:00
forehal
a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +08:00