From df9b7a65708f73a18c69b2fbc696e9499029e446 Mon Sep 17 00:00:00 2001 From: Rafa Mel Date: Mon, 23 Dec 2019 15:42:50 +0100 Subject: [PATCH] 0.5.0 --- CHANGELOG.md | 37 ++++++ docs/assets/js/search.js | 2 +- docs/classes/errorish.html | 148 +++++++++++++++++------ docs/globals.html | 22 ++-- docs/index.html | 16 ++- docs/interfaces/constructor.html | 8 +- docs/interfaces/ensurecreateoptions.html | 6 +- docs/interfaces/ensureoptions.html | 10 +- docs/interfaces/normalizeoptions.html | 8 +- package-lock.json | 2 +- package.json | 2 +- 11 files changed, 191 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f41730a..fc805d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +# [0.5.0](https://github.com/rafamel/errorish/compare/v0.4.0...v0.5.0) (2019-12-23) + + +### Bug Fixes + +* **Errorish:** fixes static classes for inheriting classes ([ae9ecf2](https://github.com/rafamel/errorish/commit/ae9ecf2adedec9f66240d81f2dd1f0fcbacca399)) + + +### chore + +* cleans up sources; begins complete rewrite ([f745eb9](https://github.com/rafamel/errorish/commit/f745eb957b3b69240075f16545c27d796161c1cb)) + + +### Code Refactoring + +* removes I prefix from type interfaces ([122d668](https://github.com/rafamel/errorish/commit/122d66849bad51b9f7fcc49be2fa8df9501689d9)) + + +### Features + +* **Errorish:** adds Errorish.raise; modifies recast arguments order ([ebb1f60](https://github.com/rafamel/errorish/commit/ebb1f602107ca2aad45e0c8d7148874d41ca2fbc)) +* adds ensure ([6d0a537](https://github.com/rafamel/errorish/commit/6d0a5375d151c17cdec4e32a740cc2abb7606344)) +* adds Errorish class ([e12df09](https://github.com/rafamel/errorish/commit/e12df0963b51ed5d7cedebbbe5a38bd3bd8f19b9)) +* adds normalize ([a4994af](https://github.com/rafamel/errorish/commit/a4994af3c23dac39709baa2a686d275b9ea4e45f)) +* adds rejects ([3b0c833](https://github.com/rafamel/errorish/commit/3b0c8335ccaf9f2a08dc29e10612dea97f13223a)) +* adds throws ([e73d3d3](https://github.com/rafamel/errorish/commit/e73d3d30275088ebb22c95ac8c2f1b9c13096413)) +* adds types ([3e8d28e](https://github.com/rafamel/errorish/commit/3e8d28ec6e1cd2bcfa74deefa5b83892c73043bc)) + + +### BREAKING CHANGES + +* Errorish has been almost entirely rewritten. Please check the updated documentation +-most of its functionality has suffered changes. +* Type interfaces are no longer prefixed by "I" + + + # [0.4.0](https://github.com/rafamel/errorish/compare/v0.3.0...v0.4.0) (2019-05-13) diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 11cdc35..94fe896 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"Constructor","url":"interfaces/constructor.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":1,"kind":512,"name":"constructor","url":"interfaces/constructor.html#constructor-1","classes":"tsd-kind-constructor tsd-parent-kind-interface","parent":"Constructor"},{"id":2,"kind":1024,"name":"prototype","url":"interfaces/constructor.html#prototype","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Constructor"},{"id":3,"kind":4194304,"name":"ErrorLabel","url":"globals.html#errorlabel","classes":"tsd-kind-type-alias"},{"id":4,"kind":4194304,"name":"ErrorData","url":"globals.html#errordata","classes":"tsd-kind-type-alias"},{"id":5,"kind":4194304,"name":"NormalError","url":"globals.html#normalerror","classes":"tsd-kind-type-alias tsd-has-type-parameter"},{"id":6,"kind":256,"name":"NormalizeOptions","url":"interfaces/normalizeoptions.html","classes":"tsd-kind-interface"},{"id":7,"kind":1024,"name":"message","url":"interfaces/normalizeoptions.html#message","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"NormalizeOptions"},{"id":8,"kind":1024,"name":"name","url":"interfaces/normalizeoptions.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"NormalizeOptions"},{"id":9,"kind":256,"name":"EnsureCreateOptions","url":"interfaces/ensurecreateoptions.html","classes":"tsd-kind-interface"},{"id":10,"kind":1024,"name":"allow","url":"interfaces/ensurecreateoptions.html#allow","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureCreateOptions"},{"id":11,"kind":256,"name":"EnsureOptions","url":"interfaces/ensureoptions.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":12,"kind":1024,"name":"normalize","url":"interfaces/ensureoptions.html#normalize","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureOptions"},{"id":13,"kind":1024,"name":"capture","url":"interfaces/ensureoptions.html#capture","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureOptions"},{"id":14,"kind":1024,"name":"Error","url":"interfaces/ensureoptions.html#error","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureOptions"},{"id":15,"kind":4194304,"name":"EnsureCreateFn","url":"globals.html#ensurecreatefn","classes":"tsd-kind-type-alias tsd-has-type-parameter"},{"id":16,"kind":65536,"name":"__type","url":"globals.html#ensurecreatefn.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"EnsureCreateFn"},{"id":17,"kind":64,"name":"normalize","url":"globals.html#normalize","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":18,"kind":64,"name":"ensure","url":"globals.html#ensure","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":19,"kind":64,"name":"rejects","url":"globals.html#rejects","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":20,"kind":64,"name":"throws","url":"globals.html#throws","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":21,"kind":128,"name":"Errorish","url":"classes/errorish.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":22,"kind":2048,"name":"is","url":"classes/errorish.html#is","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":23,"kind":2048,"name":"recast","url":"classes/errorish.html#recast","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":24,"kind":2048,"name":"ensure","url":"classes/errorish.html#ensure","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":25,"kind":2048,"name":"rejects","url":"classes/errorish.html#rejects","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":26,"kind":2048,"name":"throws","url":"classes/errorish.html#throws","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":27,"kind":1024,"name":"label","url":"classes/errorish.html#label","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Errorish"},{"id":28,"kind":1024,"name":"data","url":"classes/errorish.html#data","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Errorish"},{"id":29,"kind":1024,"name":"source","url":"classes/errorish.html#source","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Errorish"},{"id":30,"kind":512,"name":"constructor","url":"classes/errorish.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Errorish"},{"id":31,"kind":262144,"name":"name","url":"classes/errorish.html#name","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-overwrite","parent":"Errorish"},{"id":32,"kind":2048,"name":"root","url":"classes/errorish.html#root","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Errorish"},{"id":33,"kind":2048,"name":"error","url":"classes/errorish.html#error-1","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Errorish"},{"id":34,"kind":2048,"name":"reproduce","url":"classes/errorish.html#reproduce","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"Errorish"},{"id":35,"kind":2048,"name":"capture","url":"classes/errorish.html#capture","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"Errorish"},{"id":36,"kind":1024,"name":"message","url":"classes/errorish.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"Errorish"},{"id":37,"kind":1024,"name":"stack","url":"classes/errorish.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited","parent":"Errorish"},{"id":38,"kind":1024,"name":"Error","url":"classes/errorish.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"Errorish"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"Constructor","url":"interfaces/constructor.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":1,"kind":512,"name":"constructor","url":"interfaces/constructor.html#constructor-1","classes":"tsd-kind-constructor tsd-parent-kind-interface","parent":"Constructor"},{"id":2,"kind":1024,"name":"prototype","url":"interfaces/constructor.html#prototype","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Constructor"},{"id":3,"kind":4194304,"name":"ErrorLabel","url":"globals.html#errorlabel","classes":"tsd-kind-type-alias"},{"id":4,"kind":4194304,"name":"ErrorData","url":"globals.html#errordata","classes":"tsd-kind-type-alias"},{"id":5,"kind":4194304,"name":"NormalError","url":"globals.html#normalerror","classes":"tsd-kind-type-alias tsd-has-type-parameter"},{"id":6,"kind":256,"name":"NormalizeOptions","url":"interfaces/normalizeoptions.html","classes":"tsd-kind-interface"},{"id":7,"kind":1024,"name":"message","url":"interfaces/normalizeoptions.html#message","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"NormalizeOptions"},{"id":8,"kind":1024,"name":"name","url":"interfaces/normalizeoptions.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"NormalizeOptions"},{"id":9,"kind":256,"name":"EnsureCreateOptions","url":"interfaces/ensurecreateoptions.html","classes":"tsd-kind-interface"},{"id":10,"kind":1024,"name":"allow","url":"interfaces/ensurecreateoptions.html#allow","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureCreateOptions"},{"id":11,"kind":256,"name":"EnsureOptions","url":"interfaces/ensureoptions.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":12,"kind":1024,"name":"normalize","url":"interfaces/ensureoptions.html#normalize","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureOptions"},{"id":13,"kind":1024,"name":"capture","url":"interfaces/ensureoptions.html#capture","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureOptions"},{"id":14,"kind":1024,"name":"Error","url":"interfaces/ensureoptions.html#error","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"EnsureOptions"},{"id":15,"kind":4194304,"name":"EnsureCreateFn","url":"globals.html#ensurecreatefn","classes":"tsd-kind-type-alias tsd-has-type-parameter"},{"id":16,"kind":65536,"name":"__type","url":"globals.html#ensurecreatefn.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"EnsureCreateFn"},{"id":17,"kind":64,"name":"normalize","url":"globals.html#normalize","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":18,"kind":64,"name":"ensure","url":"globals.html#ensure","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":19,"kind":64,"name":"rejects","url":"globals.html#rejects","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":20,"kind":64,"name":"throws","url":"globals.html#throws","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":21,"kind":128,"name":"Errorish","url":"classes/errorish.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":22,"kind":2048,"name":"is","url":"classes/errorish.html#is","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":23,"kind":2048,"name":"recast","url":"classes/errorish.html#recast","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":24,"kind":2048,"name":"raise","url":"classes/errorish.html#raise","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":25,"kind":2048,"name":"ensure","url":"classes/errorish.html#ensure","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":26,"kind":2048,"name":"rejects","url":"classes/errorish.html#rejects","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":27,"kind":2048,"name":"throws","url":"classes/errorish.html#throws","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-static","parent":"Errorish"},{"id":28,"kind":1024,"name":"label","url":"classes/errorish.html#label","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Errorish"},{"id":29,"kind":1024,"name":"data","url":"classes/errorish.html#data","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Errorish"},{"id":30,"kind":1024,"name":"source","url":"classes/errorish.html#source","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Errorish"},{"id":31,"kind":512,"name":"constructor","url":"classes/errorish.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Errorish"},{"id":32,"kind":262144,"name":"name","url":"classes/errorish.html#name","classes":"tsd-kind-get-signature tsd-parent-kind-class tsd-is-overwrite","parent":"Errorish"},{"id":33,"kind":2048,"name":"root","url":"classes/errorish.html#root","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Errorish"},{"id":34,"kind":2048,"name":"error","url":"classes/errorish.html#error-1","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Errorish"},{"id":35,"kind":2048,"name":"reproduce","url":"classes/errorish.html#reproduce","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"Errorish"},{"id":36,"kind":2048,"name":"capture","url":"classes/errorish.html#capture","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"Errorish"},{"id":37,"kind":1024,"name":"message","url":"classes/errorish.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited","parent":"Errorish"},{"id":38,"kind":1024,"name":"stack","url":"classes/errorish.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited","parent":"Errorish"},{"id":39,"kind":1024,"name":"Error","url":"classes/errorish.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"Errorish"}]}; \ No newline at end of file diff --git a/docs/classes/errorish.html b/docs/classes/errorish.html index 5bfa51c..787ee30 100644 --- a/docs/classes/errorish.html +++ b/docs/classes/errorish.html @@ -3,7 +3,7 @@ - Errorish | errorish 0.4.0 + Errorish | errorish 0.5.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.4.0 + errorish 0.5.0
    @@ -127,6 +127,7 @@

    Methods

  • root
  • ensure
  • is
  • +
  • raise
  • recast
  • rejects
  • throws
  • @@ -147,7 +148,7 @@

    constructor

  • Parameters

    @@ -178,7 +179,7 @@

    data

    data: D
    @@ -193,7 +194,7 @@

    label

    label: L
    @@ -219,7 +220,7 @@

    source

    source: S
    @@ -264,7 +265,7 @@

    name

    @@ -289,7 +290,7 @@

    capture

  • @@ -323,7 +324,7 @@

    error

  • @@ -345,7 +346,7 @@

    reproduce

  • @@ -388,7 +389,7 @@

    root

  • @@ -410,7 +411,7 @@

    Static ensure

  • @@ -421,7 +422,7 @@

    Static ensure

    Type parameters

    - errorish 0.4.0 + errorish 0.5.0
    @@ -54,7 +54,7 @@ Globals
  • -

    errorish 0.4.0

    +

    errorish 0.5.0

    @@ -178,10 +178,14 @@
    Errorish.is(error: Error, label?: string | null | Array<string | nu Errorish.is(error); // true Errorish.is(error, 'Label'); // false - -
    Errorish.recast(fn: (error: Errorish) => Error, error: Error, label?: string | null | Array<string | null>)
    +
    +
    Errorish.recast(error: Error, create: (error: Errorish) => Error, label?: string | null | Array<string | null>)
    -

    Runs and returns the result of fn when error is an instance of the class and, optionally, has label label.

    +

    Runs and returns the result of fn only when error is an instance of the class and, optionally, has a specific label.

    + +
    Errorish.raise(fn: () => any, create: (error: Errorish) => Error, label?: string | null | Array<string | null>)
    +
    +

    Calls recast and throws its response if fn throws or rejects, otherwise returns or throws the same result or error as fn.

    Errorish.ensure(error: any, create: (error: any) => Error, options: object): Error
    diff --git a/docs/interfaces/constructor.html b/docs/interfaces/constructor.html index d844cab..9c328e3 100644 --- a/docs/interfaces/constructor.html +++ b/docs/interfaces/constructor.html @@ -3,7 +3,7 @@ - Constructor | errorish 0.4.0 + Constructor | errorish 0.5.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.4.0 + errorish 0.5.0
    @@ -118,7 +118,7 @@

    constructor

  • Parameters

    @@ -140,7 +140,7 @@

    prototype

    prototype: T
    diff --git a/docs/interfaces/ensurecreateoptions.html b/docs/interfaces/ensurecreateoptions.html index d9e905b..0986857 100644 --- a/docs/interfaces/ensurecreateoptions.html +++ b/docs/interfaces/ensurecreateoptions.html @@ -3,7 +3,7 @@ - EnsureCreateOptions | errorish 0.4.0 + EnsureCreateOptions | errorish 0.5.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.4.0 + errorish 0.5.0
    @@ -93,7 +93,7 @@

    Optional allow

    allow: string[]
    diff --git a/docs/interfaces/ensureoptions.html b/docs/interfaces/ensureoptions.html index 2ca86a7..2558b61 100644 --- a/docs/interfaces/ensureoptions.html +++ b/docs/interfaces/ensureoptions.html @@ -3,7 +3,7 @@ - EnsureOptions | errorish 0.4.0 + EnsureOptions | errorish 0.5.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.4.0 + errorish 0.5.0
    @@ -103,7 +103,7 @@

    Optional Error

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

    Optional capture

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

    Optional normalize

    normalize: boolean | NormalizeOptions
    diff --git a/docs/interfaces/normalizeoptions.html b/docs/interfaces/normalizeoptions.html index 098a9b8..d167efb 100644 --- a/docs/interfaces/normalizeoptions.html +++ b/docs/interfaces/normalizeoptions.html @@ -3,7 +3,7 @@ - NormalizeOptions | errorish 0.4.0 + NormalizeOptions | errorish 0.5.0 @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - errorish 0.4.0 + errorish 0.5.0
    @@ -94,7 +94,7 @@

    Optional message

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

    Optional name

    name: undefined | string
    diff --git a/package-lock.json b/package-lock.json index baaa382..b09caa4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "errorish", - "version": "0.4.0", + "version": "0.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2f1258f..f92d3b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "errorish", - "version": "0.4.0", + "version": "0.5.0", "author": "Rafa Mel", "description": "For those times you have an error-ish but what you really want is an Error", "keywords": [