You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enumerable properties are made non-enumerable after deserialization.
import{deserializeError,serializeError}from'serialize-error';classMyErrorextendsError{constructor(publicparams: any){super('test');}}consterror=newMyError({name: 'foo'});constserialized=serializeError(error);constdeserialized=deserializeError(serialized)asMyError;// properties of deserialized.params are non-enumerable
When serializing, this metadata is lost, so the module just renders those known properties non-enumerable as defined in that list. I'm not sure why that happens for params though, it might be the default.
Additionally in @twschiller's case, the object is being deserialized as an error when it isn't, because of this loose check:
Enumerable properties are made non-enumerable after deserialization.
Minimal reproduction: https://stackblitz.com/edit/typescript-dkbp39?file=index.ts
The text was updated successfully, but these errors were encountered: