-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle Buffer serialization (#277)
Buffer has a toJSON implementation which is called before our replacer function when serialising. It's JSON form is an object like `{ type: 'Buffer, data: number[] }`. This means it doesn't get identfied as $bytes, and does not get deserialised in the reviver. I think we'd rather have `Uint8Array` everywhere so this PR fixes it so that it gets revived as that. License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
- Loading branch information
Showing
4 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.