We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
toJSON
serialize-error automatically uses toJSON:
serialize-error
serialize-error/index.js
Lines 61 to 63 in 855fe3d
Unfortunately this introduces two unwanted behaviors:
{toJSON() { /*h4xor*/ }}
serializeError(error, {toJSON: false})
The text was updated successfully, but these errors were encountered:
code can be executed by passing {toJSON() { /h4xor/ }}
This is not a good argument. This applies to built-in APIs too. And also .toString().
.toString()
serialization is decided by the object owner, with which we might disagree (e.g. it might exclude arbitrary properties)
This is a valid argument.
Sorry, something went wrong.
I'm ok with a toJSON option.
useToJSON
Successfully merging a pull request may close this issue.
serialize-error
automatically usestoJSON
:serialize-error/index.js
Lines 61 to 63 in 855fe3d
Unfortunately this introduces two unwanted behaviors:
{toJSON() { /*h4xor*/ }}
Possible solution
The text was updated successfully, but these errors were encountered: