Skip to content

Releases: SMBCheeky/error-object

1.3.0

21 Mar 12:52

Choose a tag to compare

Changelog

1.3.0

Added

  • ResultObject<T> class for wrapping success values or errors in a single type-safe container
    • ResultObject.ok(data) — create a success result
    • ResultObject.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

19 Mar 09:48

Choose a tag to compare

Changelog

1.2.1

Breaking Changes

  • Removed toVerboseString() and verboseLog() — use toDebugString() and debugLog() instead

Added

  • INCLUDE_DOMAIN_IN_STRING static property to control whether toString() includes the domain (default: false)
  • INCLUDE_CODE_IN_STRING static property to control whether toString() includes the code (default: true)

Changed

  • toDebugString() now uses JSON.stringify(this, ...) to include all properties dynamically, prefixed with [DEBUG]
  • toString() updated to respect INCLUDE_DOMAIN_IN_STRING and INCLUDE_CODE_IN_STRING

1.2.0

11 Jan 12:53

Choose a tag to compare

  • 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

28 Dec 08:58

Choose a tag to compare

Just a version bump

1.1.5

28 Dec 08:58

Choose a tag to compare

Remove .fromPayload() functionality

1.1.4

21 Apr 13:09
870a235

Choose a tag to compare

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

04 Mar 14:29
33534ae

Choose a tag to compare

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

Full Changelog: 1.1.2...1.1.3

1.1.2

26 Feb 09:43
87dc63f

Choose a tag to compare

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

25 Feb 10:14
6babfbe

Choose a tag to compare

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

25 Feb 09:58
930487a

Choose a tag to compare

What's Changed

#2

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