Skip to content

Commit

Permalink
chore(release): v8.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Feb 9, 2023
1 parent 7db383d commit 71d8b5c
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 89 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [8.2.1](https://github.com/Itee/itee-database/compare/v8.2.0...v8.2.1) (2023-02-09)


### Bug Fixes

* **package:** remove karme dependencies with broken peer deps ([d03dc72](https://github.com/Itee/itee-database/commit/d03dc721c923049a5664851d2494462f4da29f6f))
* **tabstractresponder:** add default status code to formatted error from Error ([309a152](https://github.com/Itee/itee-database/commit/309a152e8cba75c37393d6d7fb55425046da6e6a))

# [8.2.0](https://github.com/Itee/itee-database/compare/v8.1.5...v8.2.0) (2022-03-02)


Expand Down
3 changes: 2 additions & 1 deletion builds/itee-database.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion builds/itee-database.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/itee-database.cjs.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author [Tristan Valcke]{@link https://github.com/Itee}
* @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}
*/class v extends r.TAbstractObject{static _formatErrors(r=[]){const t=e.isArray(r)?r:[r];let s=[];for(let e=0,r=t.length;e<r;e++)s.push(v._formatError(t[e]));return s}static _formatError(r){let t;if(r instanceof Error)t=r;else if(e.isString(r))t=new m(r);else if(e.isObject(r)){const e=r.name,s=r.message||"Empty message...";t=new m(s),e&&(t.name=e)}else t=new m(r.toString());return t}static returnNotFound(r){if(e.isFunction(r))return r();r.headersSent||r.status(204).end()}static returnError(r,t){if(e.isFunction(t))return t(r,null);if(t.headersSent)return;const s=v._formatError(r);t.format({"application/json":()=>{t.status(s.statusCode).json(s)},default:()=>{t.status(406).send("Not Acceptable")}})}static returnData(r,t){if(e.isFunction(t))return t(null,r);if(t.headersSent)return;const s=e.isArray(r)?r:[r];t.format({"application/json":()=>{t.status(200).json(s)},default:()=>{t.status(406).send("Not Acceptable")}})}static returnErrorAndData(r,t,s){if(e.isFunction(s))return s(r,t);if(s.headersSent)return;const n={errors:v._formatErrors(r),datas:t};s.format({"application/json":()=>{s.status(416).json(n)},default:()=>{s.status(416).send("Range Not Satisfiable")}})}static return(r,t={}){const s=Object.assign({immediate:null,beforeAll:null,beforeReturnErrorAndData:null,afterReturnErrorAndData:null,beforeReturnError:null,afterReturnError:null,beforeReturnData:null,afterReturnData:null,beforeReturnNotFound:null,afterReturnNotFound:null,afterAll:null},t,{returnErrorAndData:v.returnErrorAndData.bind(this),returnError:v.returnError.bind(this),returnData:v.returnData.bind(this),returnNotFound:v.returnNotFound.bind(this)});return s.immediate&&s.immediate(),function(t=null,n=null){const i=e.isDefined(n),o=e.isDefined(t);s.beforeAll&&s.beforeAll(),i&&o?(s.beforeReturnErrorAndData&&s.beforeReturnErrorAndData(t,n),s.returnErrorAndData(t,n,r),s.afterReturnErrorAndData&&s.afterReturnErrorAndData(t,n)):i&&!o?(s.beforeReturnData&&s.beforeReturnData(n),s.returnData(n,r),s.afterReturnData&&s.afterReturnData(n)):!i&&o?(s.beforeReturnError&&s.beforeReturnError(t),s.returnError(t,r),s.afterReturnError&&s.afterReturnError(t)):i||o||(s.beforeReturnNotFound&&s.beforeReturnNotFound(),s.returnNotFound(r),s.afterReturnNotFound&&s.afterReturnNotFound()),s.afterAll&&s.afterAll()}}constructor(e={}){super({...e})}}
*/class v extends r.TAbstractObject{static _formatErrors(r=[]){const t=e.isArray(r)?r:[r];let s=[];for(let e=0,r=t.length;e<r;e++)s.push(v._formatError(t[e]));return s}static _formatError(r){let t;if(r instanceof Error)t=r,t.statusCode=500;else if(e.isString(r))t=new m(r);else if(e.isObject(r)){const e=r.name,s=r.message||"Empty message...";t=new m(s),e&&(t.name=e)}else t=new m(r.toString());return t}static returnNotFound(r){if(e.isFunction(r))return r();r.headersSent||r.status(204).end()}static returnError(r,t){if(e.isFunction(t))return t(r,null);if(t.headersSent)return;const s=v._formatError(r);t.format({"application/json":()=>{t.status(s.statusCode).json(s)},default:()=>{t.status(406).send("Not Acceptable")}})}static returnData(r,t){if(e.isFunction(t))return t(null,r);if(t.headersSent)return;const s=e.isArray(r)?r:[r];t.format({"application/json":()=>{t.status(200).json(s)},default:()=>{t.status(406).send("Not Acceptable")}})}static returnErrorAndData(r,t,s){if(e.isFunction(s))return s(r,t);if(s.headersSent)return;const n={errors:v._formatErrors(r),datas:t};s.format({"application/json":()=>{s.status(416).json(n)},default:()=>{s.status(416).send("Range Not Satisfiable")}})}static return(r,t={}){const s=Object.assign({immediate:null,beforeAll:null,beforeReturnErrorAndData:null,afterReturnErrorAndData:null,beforeReturnError:null,afterReturnError:null,beforeReturnData:null,afterReturnData:null,beforeReturnNotFound:null,afterReturnNotFound:null,afterAll:null},t,{returnErrorAndData:v.returnErrorAndData.bind(this),returnError:v.returnError.bind(this),returnData:v.returnData.bind(this),returnNotFound:v.returnNotFound.bind(this)});return s.immediate&&s.immediate(),function(t=null,n=null){const i=e.isDefined(n),o=e.isDefined(t);s.beforeAll&&s.beforeAll(),i&&o?(s.beforeReturnErrorAndData&&s.beforeReturnErrorAndData(t,n),s.returnErrorAndData(t,n,r),s.afterReturnErrorAndData&&s.afterReturnErrorAndData(t,n)):i&&!o?(s.beforeReturnData&&s.beforeReturnData(n),s.returnData(n,r),s.afterReturnData&&s.afterReturnData(n)):!i&&o?(s.beforeReturnError&&s.beforeReturnError(t),s.returnError(t,r),s.afterReturnError&&s.afterReturnError(t)):i||o||(s.beforeReturnNotFound&&s.beforeReturnNotFound(),s.returnNotFound(r),s.afterReturnNotFound&&s.afterReturnNotFound()),s.afterAll&&s.afterAll()}}constructor(e={}){super({...e})}}
/**
* @module Messages/HTTP/ClientErrors/UnprocessableEntityError
* @desc Export the AbstractHTTPError abstract class.
Expand Down
3 changes: 2 additions & 1 deletion builds/itee-database.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion builds/itee-database.esm.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 71d8b5c

Please sign in to comment.