Releases: ehmicky/modern-errors-serialize
Releases · ehmicky/modern-errors-serialize
v6.1.1
v6.1.0
Features
- Add the
includeandexcludeoptions to pick/omit specific properties. For example, this can be used to omit error additional properties or stack trace. - Add the
transformObject(errorObject)option to transform the error plain object during serialization - Add the
transformArgs(constructorArgs)option to transform the error message during parsing - Add the
transformInstance(errorInstance)option to transform the error instance during parsing
v6.0.0
v5.0.0
v4.0.0
Release 3.0.0
Breaking changes
BaseError.toJSON()was renamed toBaseError.serialize()BaseError.fromJSON()was renamed toBaseError.parse()- When serializing/parsing a value that is not an error instance or an error plain object, it is now automatically converted to one
Features
- Added the
shallowoption to serialize/parse shallowly - Added the
looseoption to prevent converting the argument to an error instance or an error plain object if it is not one
Release 2.3.0
Features
- Added
error.fromJSON()anderror.serialize()
Release 2.2.0
Features
error.toJSON()has been renamed toBaseError.toJSON(error)
Release 2.1.0
Features
- Upgrade to the latest version of
modern-errors
Release 2.0.0
Breaking changes
modern-errors@5is now required- If the argument passed to
BaseError.parse(value)is not an error object, it is not converted to one anymore. Also, if it is an unknown error, it is not normalized anymore. - If an error class uses
customoption and aconstructoris defined, that constructor is not called anymore. However, any property previously set by that constructor is still preserved, providing it is serializable and enumerable. - The serialization format has changed: instead of serializing the constructor arguments as
constructorArgs, the plugins options are now serialized aspluginsOpts. Those properties are undocumented and mostly internal.