Comments (2)
I will leave the media type aspect for the discussion question, but what is the error you are getting? You shouldn't need the structuredClone
flag to enable the value sharing tags that are used for structured clone referencing for the decoder, they should always be enabled. Usually the more pertinent thing that needs to be configured is how objects are represented, and whether they use CBOR maps or use record tags. And there is a different default for new Encoder().encode()
(uses record tags for objects) than just encode()
(use maps).
from cbor-x.
After your comment above and some experimenting, I realize my original post was in error. If I encode with new Encoder({ structuredClone: true }).encode()
, both new Ecoder({ structuredClone: true }).decode()
and plain old decode()
work. The error is the other way around.
I have to use new Encoder({ structuredClone: true }).encode()
because I need duplicate object references preserved. I am still confused though about how I should specify the media type but I'll take that up in the discussion.
from cbor-x.
Related Issues (20)
- Encoder options for record extension HOT 5
- Sort record keys HOT 2
- better structured clone support HOT 4
- Global namespace pollution; `stringRefs` ? HOT 3
- No encoding support for 64 bit format integers HOT 5
- [Feature]: Generate blob parts to support embedding blobs (aka files) HOT 27
- sorting HOT 2
- Distribute ESM HOT 3
- Unknown tag with map value decode issue HOT 2
- Edge case with nested records sharing the same keys HOT 4
- SuperJSONatural - New kid in the game worth to take a look at it
- How to use with Axios? HOT 2
- cbor-x doesn't support integer keys HOT 4
- safeKey in cbor-x encode / decode HOT 4
- Add an option to disable the compiled reader HOT 3
- null is not an object (evaluating 'TypedArray.BYTES_PER_ELEMENT HOT 5
- Provide an option to force encoding numbers as double
- globalThis not available on older Safari versions HOT 3
- TypeError: encode is not a function HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cbor-x.