serialize-error

Serialize/deserialize an error into a plain object

MIT License

Downloads
30.1M
Stars
517
Committers
22

Bot releases are hidden (Show)

serialize-error - Latest Release

Published by sindresorhus 11 months ago

  • Improve compatibility with Next.js (#94) 6729be5

https://github.com/sindresorhus/serialize-error/compare/v11.0.2...v11.0.3

serialize-error -

Published by sindresorhus about 1 year ago

serialize-error -

Published by sindresorhus about 1 year ago

  • Fix handling of non-extensible objects fdfe034

https://github.com/sindresorhus/serialize-error/compare/v11.0.0...v11.0.1

serialize-error -

Published by sindresorhus over 2 years ago

Breaking

  • Expect a message property at a minimum to be interpreted as an Error (#77) 0720121

Improvements

  • Actually serialize nested errors (#73) 0af9fe8

https://github.com/sindresorhus/serialize-error/compare/v10.0.0...v11.0.0

serialize-error -

Published by sindresorhus over 2 years ago

Breaking

  • Require Node.js 14 22b9bd4
  • Preserve error constructor (#70) 49db63a
    • Previously it did not preserve built-in errors. It does now. So a TypeError might have been deserialized as a Error before, but is now deserialized as a TypeError.

Improvements

  • Deserialize nested errors (#69) bdf7ad4
  • Add useToJSON option (#71) e9e8666
  • Add isErrorLike() method (#68) bb6d9d6
  • Add support for cause property (#65) 7e8be51

https://github.com/sindresorhus/serialize-error/compare/v9.1.1...v10.0.0

serialize-error -

Published by sindresorhus over 2 years ago

serialize-error -

Published by sindresorhus over 2 years ago

  • Handle streams attached to an error by replacing them with '[object Stream]' (#57) b589f8e

https://github.com/sindresorhus/serialize-error/compare/v9.0.0...v9.1.0

serialize-error -

Published by sindresorhus almost 3 years ago

Breaking

  • Require Node.js 12.20 f698ea0
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/serialize-error/compare/v8.1.0...v9.0.0

serialize-error -

Published by sindresorhus over 3 years ago

serialize-error -

Published by sindresorhus over 3 years ago

serialize-error -

Published by sindresorhus almost 4 years ago

Breaking

  • Use Object#toJSON() method to serialize properties if the method is defined (#38) 34655eb
  • Buffer values in Error properties are not serialized and instead replaced with '[object Buffer]'(#39) d58ce16

https://github.com/sindresorhus/serialize-error/compare/v7.0.1...v8.0.0

serialize-error -

Published by sindresorhus over 4 years ago

  • Make serialized error properties enumerable (#32) 3235f50

https://github.com/sindresorhus/serialize-error/compare/v7.0.0...v7.0.1

serialize-error -

Published by sindresorhus over 4 years ago

Breaking

  • Make error properties non-enumerable (#30) cea59fc
    This is really just a bug fix, but since it can cause subtle bugs if you actually iterate over the properties, I wanted to be safe and make it a major release.

https://github.com/sindresorhus/serialize-error/compare/v6.0.0...v7.0.0

serialize-error -

Published by sindresorhus over 4 years ago

Breaking

  • Require Node.js 10 5add55c
  • Make it work better in the browser (#27) 728be12
    Because of this, non-errors might be serialized slightly differently. It now uses JSON.stringify() instead of util.inspect().

https://github.com/sindresorhus/serialize-error/compare/v5.0.0...v6.0.0

serialize-error -

Published by sindresorhus about 5 years ago

Breaking

The default export is now a named export 9da0ddb

- const serializeError = require('serialize-error');
+ const {serializeError} = require('serialize-error');

Enhancements

  • Add deserializeError method (#24) 9da0ddb

Fixes

  • Handle top-level null values 5ed49e4

https://github.com/sindresorhus/serialize-error/compare/v4.1.0...v5.0.0

serialize-error -

Published by sindresorhus over 5 years ago

  • Refactor TypeScript definition to CommonJS compatible export (#15) 9212299

https://github.com/sindresorhus/serialize-error/compare/v4.0.0...v4.1.0

serialize-error -

Published by sindresorhus over 5 years ago

Breaking:

  • Require Node.js 8 (#14) 955c617

Enhancements:

  • Add TypeScript definition (#14) 955c617

https://github.com/sindresorhus/serialize-error/compare/v3.0.0...v4.0.0

serialize-error -

Published by sindresorhus about 6 years ago

Breaking:

  • Require Node.js 6.

Other:

  • Ensure the .code property is always serialized, even when it's higher up the prototype-chain.
Package Rankings
Top 1.13% on Npmjs.org
Top 17.93% on Repo1.maven.org