If string is passed as unknown, the value returned from serializeError is badly typed as ErrorObject
Closed this issue · 1 comments
PabloSzx commented
const errorToSerialize: unknown = "hello world";
const serialized = serializeError(errorToSerialize);
// serialized <=> ErrorObject
// typeof serialized === "string'
sindresorhus commented
Confirmed. The return value should be unknown
then.