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

Enumerable properties are made non-enumerable #84

Open
MikeJerred opened this issue Mar 15, 2023 · 0 comments
Open

Enumerable properties are made non-enumerable #84

MikeJerred opened this issue Mar 15, 2023 · 0 comments

Comments

@MikeJerred
Copy link

Enumerable properties are made non-enumerable after deserialization.

import { deserializeError, serializeError } from 'serialize-error';

class MyError extends Error {
  constructor(public params: any) {
    super('test');
  }
}

const error = new MyError({ name: 'foo' });
const serialized = serializeError(error);
const deserialized = deserializeError(serialized) as MyError;

// properties of deserialized.params are non-enumerable

Minimal reproduction: https://stackblitz.com/edit/typescript-dkbp39?file=index.ts

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