diff --git a/CHANGELOG.md b/CHANGELOG.md index fc805d4..7f051f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ +# [1.0.0](https://github.com/rafamel/errorish/compare/v0.5.0...v1.0.0) (2020-12-11) + + +### Bug Fixes + +* **deps:** updates dependencies ([9905c58](https://github.com/rafamel/errorish/commit/9905c58a4979df48219823a3b5308bbe2eb7962c)) + + +### Code Refactoring + +* **utils:** removes rejects and throws ([6c9dc85](https://github.com/rafamel/errorish/commit/6c9dc853d85ec2a56314d77fd45a402919643c92)) + + +### Features + +* **utils:** ensure creates an Exception by default ([0559541](https://github.com/rafamel/errorish/commit/0559541cc51bb93aea892b5738e35558613e774b)) +* adds Exception class ([e5ba311](https://github.com/rafamel/errorish/commit/e5ba311984a1e0233711b66e88bea48259780fb6)) +* **utils:** adds capture ([55d5e70](https://github.com/rafamel/errorish/commit/55d5e703b8637f5822cdbc195be6d04cb0807dbd)) + + +### improvement + +* **utils:** ensure doesn't capture new errors by default ([9f78375](https://github.com/rafamel/errorish/commit/9f7837529697a9bbdb04f9da48323a3551f75161)) +* **utils:** ensure no longer takes an EnsureCreateOptions object as a second argument ([295da27](https://github.com/rafamel/errorish/commit/295da279365290d119d4e36b66b30729c1d69eea)) + + +### BREAKING CHANGES + +* **utils:** The ensure function used to capture the stack trace of new errors created within +it, even when not explicitly passed an option to. The latest implementation doesn't capture the +stack trace of newly created errors by default. +* **utils:** When not provided with a `create` function as an argument, `ensure` will create and +return an Exception instead of a plain Error when its first argument is not an error. This Exception +instance will have its data `field` populated with the element passed `ensure` as an *error*. +* **utils:** `ensure` used to take an EnsureCreateOptions object as a second argument allowing +to specify the input types that, when not an error, would be casted into a string for the new Error +to have as message. The new implementation casts all non Error input types into a string to use as a +message. Otherwise, passing an Error creating function as a second argument remains possible. +* **utils:** The utility functions rejects and throws have been removed from the library as they didn't add any significant value over ensure -they acted as minimal wrappers. +* Errorish has been replaced by the Exception class. The change is not merely of name, as the api surface has been vastly reduced. Please review the most current documentation. + + + # [0.5.0](https://github.com/rafamel/errorish/compare/v0.4.0...v0.5.0) (2019-12-23) diff --git a/docs/classes/exception.html b/docs/classes/exception.html index 12f362a..b4cf339 100644 --- a/docs/classes/exception.html +++ b/docs/classes/exception.html @@ -3,7 +3,7 @@ - Exception | errorish 0.5.0 + Exception | errorish 1.0.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.5.0 + errorish 1.0.0
    @@ -150,12 +150,12 @@

    Static Label

    Label: string | null
    -

    An identifying label for exceptions that could indicate scope or origin

    +

    An identifying label for exceptions to indicate their scope or origin

    @@ -172,7 +172,7 @@

    constructor

  • @@ -218,7 +218,7 @@

    data

    @@ -234,13 +234,12 @@

    error

    -

    Either the source or original error that caused the exception or, - when absent, a reference to itself.

    +

    A source error causing the exception or a reference to itself.

    @@ -251,7 +250,7 @@

    label

    @@ -307,7 +306,7 @@

    name

    @@ -333,7 +332,7 @@

    root

  • @@ -355,7 +354,7 @@

    Static from

  • @@ -393,15 +392,15 @@

    Static is

  • -

    Tests whether an item is an instance of the Exception class, +

    Tests whether an item is an instance of the Exception class or any class inheriting from it. - When item is an Exception, it can optionally test for - it having a particular label.

    + When item is an Exception, it will optionally + test for the instance also having a specific label.

    Type parameters

    diff --git a/docs/globals.html b/docs/globals.html index a5aa499..6199ecc 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -3,7 +3,7 @@ - errorish 0.5.0 + errorish 1.0.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.5.0 + errorish 1.0.0
    @@ -52,7 +52,7 @@ Globals -

    errorish 0.5.0

    +

    errorish 1.0.0

    @@ -101,7 +101,7 @@

    NormalError

    NormalError<T>: T & Record<"stack", string>
    @@ -129,7 +129,7 @@

    capture

  • @@ -164,7 +164,7 @@

    ensure

  • @@ -222,7 +222,7 @@

    normalize

  • diff --git a/docs/index.html b/docs/index.html index 21e746d..f8312ed 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,7 +3,7 @@ - errorish 0.5.0 + errorish 1.0.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.5.0 + errorish 1.0.0
    @@ -52,7 +52,7 @@ Globals -

    errorish 0.5.0

    +

    errorish 1.0.0

    @@ -70,6 +70,9 @@

    Errorish

    Vulnerabilities License Types

    +
    +

    When you have an error-ish but what you really want is an Error.

    +

    Install

    diff --git a/docs/interfaces/ensureoptions.html b/docs/interfaces/ensureoptions.html index e5b257e..aa669af 100644 --- a/docs/interfaces/ensureoptions.html +++ b/docs/interfaces/ensureoptions.html @@ -3,7 +3,7 @@ - EnsureOptions | errorish 0.5.0 + EnsureOptions | errorish 1.0.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.5.0 + errorish 1.0.0
    @@ -101,7 +101,7 @@

    Optional Error

    Error: Constructor<E>
    @@ -119,7 +119,7 @@

    Optional capture

    capture: undefined | false | true
    @@ -136,7 +136,7 @@

    Optional normalize

    normalize: boolean | NormalizeOptions
    diff --git a/docs/interfaces/exception.like.html b/docs/interfaces/exception.like.html index 15318cf..b5035da 100644 --- a/docs/interfaces/exception.like.html +++ b/docs/interfaces/exception.like.html @@ -3,7 +3,7 @@ - Like | errorish 0.5.0 + Like | errorish 1.0.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.5.0 + errorish 1.0.0
    @@ -121,7 +121,7 @@

    data

    data: D
    @@ -131,7 +131,7 @@

    Optional error

    error: Error
    @@ -141,7 +141,7 @@

    label

    label: L
    @@ -151,7 +151,7 @@

    message

    message: string
    diff --git a/docs/interfaces/normalizeoptions.html b/docs/interfaces/normalizeoptions.html index 0cc3d45..4ce079c 100644 --- a/docs/interfaces/normalizeoptions.html +++ b/docs/interfaces/normalizeoptions.html @@ -3,7 +3,7 @@ - NormalizeOptions | errorish 0.5.0 + NormalizeOptions | errorish 1.0.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.5.0 + errorish 1.0.0
    @@ -92,7 +92,7 @@

    Optional message

    message: undefined | string
    @@ -108,7 +108,7 @@

    Optional name

    name: undefined | string
    diff --git a/package-lock.json b/package-lock.json index 06c75b7..7631a9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "errorish", - "version": "0.5.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b717391..b9abad3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "errorish", - "version": "0.5.0", + "version": "1.0.0", "author": "Rafa Mel", "description": "When you have an error-ish but what you really want is an Error", "keywords": [