sdk-javascript
sdk-javascript copied to clipboard
fix: handle big integers in incoming events
An event may have data that contains a BigInt. The builtin JSON parser
for JavaScript does not handle the BigInt types. The introduced
json-bigint dependency (34k) does.
Fixes: https://github.com/cloudevents/sdk-javascript/issues/489
Signed-off-by: Lance Ball [email protected]
Closing and reopening to trigger re-run of CI with updated package.json (to hopefully fix errors)
This pull request is stale because it has been open 30 days with no activity.
@cardil I have added an environment variable to enable the json-bigint module. I'm not a huge fan of this approach because the check is made for each call to the parser. The library does not have an obvious place to set flags or other static values. An alternative approach would be to add this as an option to the HTTP.toEvent() method, but that changes the method signature resulting in a lot of small changes all over the codebase.
@lholmquist ptal