Coder Social home page Coder Social logo

Comments (5)

ehmicky avatar ehmicky commented on May 30, 2024 2

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.

ehmicky avatar ehmicky commented on May 30, 2024 1

This should be fixed in 3.0.0. Cycles are now removed instead of being set to an empty object.

from error-serializer.

papb avatar papb commented on May 30, 2024 1

@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.

ehmicky avatar ehmicky commented on May 30, 2024 1

Thanks for pointing this out @papb, I just fixed it.

@all-contributors Please add @papb for bug report and doc.

from error-serializer.

allcontributors avatar allcontributors commented on May 30, 2024

@ehmicky

I've put up a pull request to add @papb! 🎉

from error-serializer.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.