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

If string is passed as unknown, the value returned from serializeError is badly typed as ErrorObject #81

Open
PabloSzx opened this issue Jul 14, 2022 · 1 comment

Comments

@PabloSzx
Copy link

const errorToSerialize: unknown = "hello world";
const serialized = serializeError(errorToSerialize);

// serialized <=> ErrorObject
// typeof serialized === "string'
@sindresorhus
Copy link
Owner

Confirmed. The return value should be unknown then.

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

No branches or pull requests

2 participants