Releases: SMBCheeky/error-object
Releases · SMBCheeky/error-object
1.3.0
Changelog
1.3.0
Added
ResultObject<T>class for wrapping success values or errors in a single type-safe containerResultObject.ok(data)— create a success resultResultObject.err(error)— create an error result.isOk(),.isErr()— type-narrowing guards.hasData(),.isData()— aliases for.isOk().isError()— alias for.isErr()
- Unit test suite with Vitest (67 tests, ~99% coverage)
1.2.1
Changelog
1.2.1
Breaking Changes
- Removed
toVerboseString()andverboseLog()— usetoDebugString()anddebugLog()instead
Added
INCLUDE_DOMAIN_IN_STRINGstatic property to control whethertoString()includes the domain (default:false)INCLUDE_CODE_IN_STRINGstatic property to control whethertoString()includes the code (default:true)
Changed
toDebugString()now usesJSON.stringify(this, ...)to include all properties dynamically, prefixed with[DEBUG]toString()updated to respectINCLUDE_DOMAIN_IN_STRINGandINCLUDE_CODE_IN_STRING
1.2.0
- decouple completely from ErrorObjectFromPayload, by removing processingErrors, summary and nextErrors fields
- removed the DEFAULT_DOMAIN field
- add overrides for the default generic error code and message
- add override for log method (default console.log)
- add more type guards:
errorObject instanceof Error,errorObject instanceof ErrorObject, ErrorObject.is() and isErrorObject(). - update playground file with more quick examples
- remove error-object-only.ts file from the playground as now the main package
- update @smbcheeky/error-object-from-payload to work as a derived class from ErrorObject, and overriding some logic when needed
1.1.6
1.1.5
1.1.4
What's Changed
- Add only-error-object.ts file in playground + small cleanup by @SMBCheeky in #9
Full Changelog: 1.1.3...1.1.4
1.1.3
This week, a new version that should clean up the dist folder without minification was released.
Minification does not save much in size; without it, the code remains somewhat readable and still patchable.
What's Changed
- Small updates for README by @SMBCheeky in #5
- Add badges by @SMBCheeky in #6
- Clean dist cache and bump version by @SMBCheeky in #7
- Update playground yarn.lock by @SMBCheeky in #8
Full Changelog: 1.1.2...1.1.3
1.1.2
What's Changed
- Improve the .d.ts file documentation so everything is clear without the need to include the src/ directory by @SMBCheeky in #4
Full Changelog: 1.1.1...1.1.2
1.1.1
What's Changed
- Remove log method variants constraints for logTag - it does not work as intended by @SMBCheeky in #3
Full Changelog: 1.1.0...1.1.1
1.1.0
What's Changed
Breaking changes:
- transformCode, transformNumberCode, transformMessage, transformDetails, transformDomain, are all replaced by one function,
transform
This change allows for more flexibility when dealing with complex objects.
Full Changelog: 1.0.1...1.1.0