error-serializer

Convert errors to/from plain objects.

MIT License

Downloads
7.9K
Stars
15
Committers
3

Bot releases are hidden (Show)

error-serializer - v8.0.0 Latest Release

Published by ehmicky 4 months ago

Breaking changes

serialize(error, {
-  beforeSerialize: (error) => {
-    error.date = error.date.toString()
-  },
-  afterSerialize: (error, errorObject) => {
-    error.date = new Date(error.date)
-  },
+  transformObject: (errorObject, error) => {
+    errorObject.date = errorObject.date.toString()
+  },
})
parse(errorObject, {
-  beforeParse: (errorObject) => {
-    errorObject.date = new Date(errorObject.date)
-  },
-  afterParse: (errorObject, error) => {
-    errorObject.date = errorObject.date.toString()
-  },
+  transformInstance: (error, errorObject) => {
+    error.date = new Date(error.date)
+  },
})

Features

error-serializer - v7.0.0

Published by ehmicky 12 months ago

Breaking changes

  • Minimal supported Node.js version is now 18.18.0
error-serializer - v6.0.1

Published by ehmicky over 1 year ago

Dependencies

  • Upgrade internal dependencies
error-serializer - v6.0.0

Published by ehmicky over 1 year ago

Breaking changes

  • Minimal supported Node.js version is now 16.17.0
error-serializer - Release 5.1.0

Published by ehmicky almost 2 years ago

Features

  • Improve documentation
error-serializer - Release 5.0.0

Published by ehmicky almost 2 years ago

Breaking changes

  • The normalize option was renamed to loose. Its value has been inverted: normalize: false is now loose: true.
  • The default value of the loose option is now false.
    • If the argument to serialize() is not an error instance, it is now normalized to one, unless loose: true is used
    • If the argument to parse() is not an error plain object, it is now normalized to one, unless loose: true is used
error-serializer - Release 4.2.0

Published by ehmicky almost 2 years ago

  • Improve input validation (9b3fc1f)
error-serializer - Release 4.1.0

Published by ehmicky almost 2 years ago

Features

error-serializer - Release 4.0.0

Published by ehmicky almost 2 years ago

Breaking changes

Features

error-serializer - Release 3.7.0

Published by ehmicky almost 2 years ago

Features

  • Improve tree-shaking support
error-serializer - Release 3.6.0

Published by ehmicky almost 2 years ago

Features

  • Add browser support
error-serializer - Release 3.5.1

Published by ehmicky about 2 years ago

Bug fixes

  • Fix package.json
error-serializer - Release 3.5.0

Published by ehmicky about 2 years ago

  • Switch to MIT license
error-serializer - Release 3.4.0

Published by ehmicky about 2 years ago

Features

error-serializer - Release 3.3.0

Published by ehmicky about 2 years ago

Features

error-serializer - Release 3.2.0

Published by ehmicky about 2 years ago

Features

  • Improve support for SpiderMonkey and JavaScriptCore
error-serializer - Release 3.1.0

Published by ehmicky about 2 years ago

Features

error-serializer - Release 3.0.0

Published by ehmicky about 2 years ago

Breaking changes

  • The loose option was renamed to normalize. Its value has been inverted: loose: true is now normalize: false.
  • The default value of the normalize option is now false.
    • If the argument to serialize() is not an error instance, it is not normalized to one anymore, unless normalize: true is used
    • If the argument to parse() is not an error plain object, it is not normalized to one anymore, unless normalize: true is used

Features

error-serializer - Release 2.0.0

Published by ehmicky about 2 years ago

Breaking changes

error-serializer - Release 1.4.0

Published by ehmicky about 2 years ago

Features

  • Improve error handling
Package Rankings
Top 6.42% on Npmjs.org
Badges
Extracted from project README
Node Browsers TypeScript Codecov Minified size Mastodon Medium