Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serializeError converts a Date object into an empty plain object #34

Closed
jyssh opened this issue Aug 9, 2020 · 0 comments · Fixed by #38
Closed

serializeError converts a Date object into an empty plain object #34

jyssh opened this issue Aug 9, 2020 · 0 comments · Fixed by #38

Comments

@jyssh
Copy link

jyssh commented Aug 9, 2020

Live Demo: https://runkit.com/embed/w5k9fpq8b44e

const {serializeError} = require("serialize-error")

serializeError({
    a: 1,
    b: new Date(),
    c: {cc: 2}
});

// output: Object {a: 1, b: Object {}, c: Object {cc: 2}}

I understand that the very purpose of this package is to produce a plain object, but it might be useful to convert a Date object into its representative string or milliseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant