Comments (5)
Hi @papb!
Thanks a lot for the kind word :)
This is intentional. The reason is: errorSerializer.serialize()
first converts error
to a plain object before passing it to safe-json-value
(under the hood). However, error static properties are not converted to plain objects. So safe-json-value
cannot figure out that error
(now converted to a plain object) is the same as error.cycle
(not a plain object). But it can detect that error.cycle
is the same as error.cycle.cycle
, which ends up converting error.cycle
to an empty object.
That being said, I agree this is rather surprising when you compare both projects. Replacing circular values with empty objects is probably fine, but undefined
would be better. The good news is: I am planning to make error-serializer
deep by default, which should take care of the above problem. I'll update this issue once this is done.
Thanks for pointing this out!
from error-serializer.
This should be fixed in 3.0.0
. Cycles are now removed instead of being set to an empty object.
from error-serializer.
@ehmicky This project's readme is still the same as in my original post here though, I guess it has to be fixed then?
from error-serializer.
Thanks for pointing this out @papb, I just fixed it.
@all-contributors Please add @papb for bug report and doc.
from error-serializer.
I've put up a pull request to add @papb! 🎉
from error-serializer.
Related Issues (1)
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 error-serializer.