-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support toJSON as a fallback on non-object types (BigInt) #28
Support toJSON as a fallback on non-object types (BigInt) #28
Conversation
... just to see approximately when it starts failing
That sounds reasonable, thanks 👍 Merged as 9ec1fcd. |
@darrachequesne, thanks a lot! Mind doing a new release? 🤗 |
@darrachequesne, thanks a lot! I'm using this library via I see your name on that library as well, so just putting in a good word for a new release that bumps that dependency as well 🙏 😅 |
Opened a PR here for that update: socketio/socket.io-redis-emitter#113 |
Hi!
My application uses
BigInt
heavily, which results inCould not encode
with this library. I tried to follow this piece of advice and specified aBigInt.prototype.toJSON
. Unfortunately that doesn't work, because thetypeof
operator returnsbigint
, and this library only supportstoJSON
for values wheretypeof
returnsobject
.I saw #25 but thought it'd be worthwhile to consider a more minimalistic approach.
Drive-by: Don't test with node.js 18, as that seems to break Travis. (Should probably switch to a different CI provider)