@capimjs/library-auth
Version:
Professional API using Clean Architecture and TDD. to group validators
1 lines • 742 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{commandOk:()=>commandOk,commandBadRequest:()=>commandBadRequest,commandUnauthorized:()=>commandUnauthorized,commandForbidden:()=>commandForbidden,commandServerError:()=>commandServerError});const _errors=require("../errors");const commandOk=data=>({data});const commandBadRequest=error=>({data:error});const commandUnauthorized=()=>({data:new _errors.UnauthorizedError});const commandForbidden=()=>({data:new _errors.ForbiddenError});const commandServerError=error=>({data:new _errors.ServerError(error instanceof Error?error:undefined)});