cbor-x
cbor-x copied to clipboard
Ultra-fast CBOR encoder/decoder with extensions for records and structural cloning
the structured clone algoritm supports cloning string objects and having same reference. I expected this to work similar to `globalThis.structuredClone` but it did not... Example code: ```js const {Encoder} =...
NodeJS have a built in [v8.serialize(value)](https://nodejs.org/dist/latest-v18.x/docs/api/v8.html#v8serializevalue) that do also support circular refs and many structure and it's basically also what `globalThis.structuredClone` uses (i guess). good for nodejs nodejs data cloning...
When some one send bad data we can add some simple checks to prevent at least some of the easy crashes.
https://github.com/kriszyp/cbor-x/blob/0b5e8807622619c6a7a062f7e771478ecfd52f83/decode.js#L1015-L1017 After an extension's decode returns an object with it's prototype set or a class instance, that state is discarded due to the Object.assign that occurs just after. So e.g....
Trying to use cbor-x to send values to browser and when trying to decode I get this when using a fetch inside a service worker, and decodeMultiple for the response....
I get randomly this error trying to deserialize a single big tree object using `DecoderStream`. (v1.5.8) ``` TypeError: Cannot create property 'slowReads' on number '0' at createStructureReader (**/node_modules/cbor-x/decode.js:500:21) at recordDefinition...
Currently, this library supports the legacy NodeJS streams API (see https://github.com/kriszyp/cbor-x?tab=readme-ov-file#streams), but not the newer Web/WhatWG streams API (see https://developer.mozilla.org/en-US/docs/Web/API/Streams_API). While it is possible on NodeJS to convert from the...
It seems like the `Tag` class is not being exported in the TypeScript type definitions, while it is being exported from the JavaScript side. Is there any specific reason for...
But in my project I can't see logs, but issue is workaround.