@lskjs/err
Advanced tools
Comparing version 3.3.0 to 3.8.1
@@ -1,3 +0,3 @@ | ||
"use strict";var g=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var o=(t,e)=>g(t,"name",{value:e,configurable:!0});var k=(t,e)=>{for(var s in e)g(t,s,{get:e[s],enumerable:!0})},N=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of y(e))!P.call(t,n)&&n!==s&&g(t,n,{get:()=>e[n],enumerable:!(r=_(e,n))||r.enumerable});return t};var j=t=>N(g({},"__esModule",{value:!0}),t);var b={};k(b,{Err:()=>i,default:()=>J,isErr:()=>O});module.exports=j(b);var m=o((t,e)=>{typeof e!="string"&&Object.keys(e).forEach(s=>{let r=e[s];typeof r!="function"&&(t[s]=r)})},"copyProps");var c=require("@lskjs/algos");var S=o(t=>t&&t.__err,"isLskError"),w=o(t=>(0,c.pick)(t,Object.getOwnPropertyNames(t)),"getLskErrorProps"),d=o((t,e=["name","message","stack","text"])=>(0,c.isPlainObject)(t)?t:t instanceof Error?S(t)?w(t):(0,c.pick)(t,e):{},"errProps");var h=o((...t)=>{let[e,s]=t,r={};return typeof e=="string"&&(r.code=e,typeof s=="string"&&(r.message=s)),t.forEach(n=>{r={...r,...d(n)}}),r},"errMerge");var p=require("@lskjs/algos");var M=o(t=>Array.from(new Set(t)),"uniq"),a="err_unknown",f=o((t,e=a)=>{if(typeof t=="string")return t;let s=t&&t.name!=="Error"?t.name:null;return t&&(t.message||t.text||t.code||s)||e},"getMessage"),x=o((t,e=a)=>{let s=[t.code,f(t),t.text,t.stack];return t&&M(s.filter(Boolean)).join(` | ||
`)||e||a},"getText"),u=o((t,e=a)=>t&&(t.code||t.text||t.message)||e,"getCode"),l=o((t,e=!1)=>{if(typeof t=="string")return{code:t,message:t};let s={...t&&t.__raw||{}};return e?s={...s,...(0,p.pick)(t,["name","code","message","text","data"])}:s={...s,...(0,p.omit)((0,p.pick)(t,Object.getOwnPropertyNames(t)),["__err"])},s},"getJSON"),E=o(t=>t instanceof Error,"isError");var O=o(t=>t instanceof i,"isErr"),i=class extends Error{__err=!0;constructor(...e){let s=h(...e);super(f(s)),this.name=this.constructor.name,Object.keys(s).forEach(r=>{let n=s[r];r==="message"?this.message!==n&&n&&(this.__parentErrorMessage=n):r==="stack"?this.__parentErrorStack=n:this[r]=n}),this.code||(this.code=u(s))}static getMessage(e,s=a){return f(e,s)}static getText(e,s=a){return x(e,s)}static getCode(e,s=a){return u(e,s)}static getJSON(e,s=!1){return l(e,s)}static isError(e){return E(e)}static isErr(e){return O(e)}static copyProps(e,s){m(e,s)}copyProps(e){m(this,e)}getText(){return x(this)}getJSON(e=!1){return l(this,e)}getMessage(){return f(this)}getCode(){return u(this)}toJSON(){return this.getJSON(!0)}};o(i,"Err");var J=i;0&&(module.exports={Err,isErr}); | ||
"use strict";var g=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var o=(t,e)=>g(t,"name",{value:e,configurable:!0});var k=(t,e)=>{for(var s in e)g(t,s,{get:e[s],enumerable:!0})},N=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of y(e))!P.call(t,n)&&n!==s&&g(t,n,{get:()=>e[n],enumerable:!(r=_(e,n))||r.enumerable});return t};var j=t=>N(g({},"__esModule",{value:!0}),t);var b={};k(b,{Err:()=>i,default:()=>J,isErr:()=>O});module.exports=j(b);var m=o((t,e)=>{typeof e!="string"&&Object.keys(e).forEach(s=>{let r=e[s];typeof r!="function"&&(t[s]=r)})},"copyProps");var c=require("@lskjs/algos");var S=o(t=>t&&t.__err,"isLskError"),w=o(t=>(0,c.pick)(t,Object.getOwnPropertyNames(t)),"getLskErrorProps"),l=o((t,e=["name","message","stack","text"])=>(0,c.isPlainObject)(t)?t:t instanceof Error?S(t)?w(t):(0,c.pick)(t,e):{},"errProps");var h=o((...t)=>{let[e,s]=t,r={};return typeof e=="string"&&(r.code=e,typeof s=="string"&&(r.message=s)),t.forEach(n=>{r={...r,...l(n)}}),r},"errMerge");var p=require("@lskjs/algos");var M=o(t=>Array.from(new Set(t)),"uniq"),a="err_unknown",f=o((t,e=a)=>{if(typeof t=="string")return t;let s=t&&t.name!=="Error"?t.name:null;return t&&(t.message||t.text||t.code||s)||e},"getMessage"),x=o((t,e=a)=>{let s=[t.code,f(t),t.text,t.stack];return t&&M(s.filter(Boolean)).join(` | ||
`)||e||a},"getText"),u=o((t,e=a)=>t&&(t.code||t.text||t.message)||e,"getCode"),d=o((t,e=!1)=>{if(typeof t=="string")return{code:t,message:t};let s={...t&&t.__raw||{}};return e?s={...s,...(0,p.pick)(t,["name","code","message","text","data"])}:s={...s,...(0,p.omit)((0,p.pick)(t,Object.getOwnPropertyNames(t)),["__err"])},s},"getJSON"),E=o(t=>t instanceof Error,"isError");var O=o(t=>t instanceof i,"isErr"),i=class extends Error{code;__err=!0;constructor(...e){let s=h(...e);super(f(s)),this.name=this.constructor.name,Object.keys(s).forEach(r=>{let n=s[r];r==="message"?this.message!==n&&n&&(this.__parentErrorMessage=n):r==="stack"?this.__parentErrorStack=n:this[r]=n}),this.code||(this.code=u(s))}static getMessage(e,s=a){return f(e,s)}static getText(e,s=a){return x(e,s)}static getCode(e,s=a){return u(e,s)}static getJSON(e,s=!1){return d(e,s)}static isError(e){return E(e)}static isErr(e){return O(e)}static copyProps(e,s){m(e,s)}copyProps(e){m(this,e)}getText(){return x(this)}getJSON(e=!1){return d(this,e)}getMessage(){return f(this)}getCode(){return u(this)}toJSON(){return this.getJSON(!0)}};o(i,"Err");var J=i;0&&(module.exports={Err,isErr}); | ||
//# sourceMappingURL=Err.js.map |
@@ -1,3 +0,3 @@ | ||
"use strict";var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var r=(t,e)=>m(t,"name",{value:e,configurable:!0});var S=(t,e)=>{for(var o in e)m(t,o,{get:e[o],enumerable:!0})},w=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of N(e))!j.call(t,n)&&n!==o&&m(t,n,{get:()=>e[n],enumerable:!(s=k(e,n))||s.enumerable});return t};var M=t=>w(m({},"__esModule",{value:!0}),t);var b={};S(b,{Err:()=>c,default:()=>P,errMerge:()=>h,errProps:()=>d,errUnknown:()=>a,getCode:()=>g,getJSON:()=>x,getLskErrorProps:()=>_,getMessage:()=>i,getText:()=>u,isErr:()=>y,isError:()=>E,isLskError:()=>O});module.exports=M(b);var l=r((t,e)=>{typeof e!="string"&&Object.keys(e).forEach(o=>{let s=e[o];typeof s!="function"&&(t[o]=s)})},"copyProps");var p=require("@lskjs/algos");var O=r(t=>t&&t.__err,"isLskError"),_=r(t=>(0,p.pick)(t,Object.getOwnPropertyNames(t)),"getLskErrorProps"),d=r((t,e=["name","message","stack","text"])=>(0,p.isPlainObject)(t)?t:t instanceof Error?O(t)?_(t):(0,p.pick)(t,e):{},"errProps");var h=r((...t)=>{let[e,o]=t,s={};return typeof e=="string"&&(s.code=e,typeof o=="string"&&(s.message=o)),t.forEach(n=>{s={...s,...d(n)}}),s},"errMerge");var f=require("@lskjs/algos");var J=r(t=>Array.from(new Set(t)),"uniq"),a="err_unknown",i=r((t,e=a)=>{if(typeof t=="string")return t;let o=t&&t.name!=="Error"?t.name:null;return t&&(t.message||t.text||t.code||o)||e},"getMessage"),u=r((t,e=a)=>{let o=[t.code,i(t),t.text,t.stack];return t&&J(o.filter(Boolean)).join(` | ||
`)||e||a},"getText"),g=r((t,e=a)=>t&&(t.code||t.text||t.message)||e,"getCode"),x=r((t,e=!1)=>{if(typeof t=="string")return{code:t,message:t};let o={...t&&t.__raw||{}};return e?o={...o,...(0,f.pick)(t,["name","code","message","text","data"])}:o={...o,...(0,f.omit)((0,f.pick)(t,Object.getOwnPropertyNames(t)),["__err"])},o},"getJSON"),E=r(t=>t instanceof Error,"isError");var y=r(t=>t instanceof c,"isErr"),c=class extends Error{__err=!0;constructor(...e){let o=h(...e);super(i(o)),this.name=this.constructor.name,Object.keys(o).forEach(s=>{let n=o[s];s==="message"?this.message!==n&&n&&(this.__parentErrorMessage=n):s==="stack"?this.__parentErrorStack=n:this[s]=n}),this.code||(this.code=g(o))}static getMessage(e,o=a){return i(e,o)}static getText(e,o=a){return u(e,o)}static getCode(e,o=a){return g(e,o)}static getJSON(e,o=!1){return x(e,o)}static isError(e){return E(e)}static isErr(e){return y(e)}static copyProps(e,o){l(e,o)}copyProps(e){l(this,e)}getText(){return u(this)}getJSON(e=!1){return x(this,e)}getMessage(){return i(this)}getCode(){return g(this)}toJSON(){return this.getJSON(!0)}};r(c,"Err");var P=c;0&&(module.exports={Err,errMerge,errProps,errUnknown,getCode,getJSON,getLskErrorProps,getMessage,getText,isErr,isError,isLskError}); | ||
"use strict";var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var r=(t,e)=>m(t,"name",{value:e,configurable:!0});var S=(t,e)=>{for(var o in e)m(t,o,{get:e[o],enumerable:!0})},w=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of N(e))!j.call(t,n)&&n!==o&&m(t,n,{get:()=>e[n],enumerable:!(s=k(e,n))||s.enumerable});return t};var M=t=>w(m({},"__esModule",{value:!0}),t);var b={};S(b,{Err:()=>c,default:()=>P,errMerge:()=>h,errProps:()=>l,errUnknown:()=>a,getCode:()=>g,getJSON:()=>x,getLskErrorProps:()=>_,getMessage:()=>i,getText:()=>u,isErr:()=>y,isError:()=>E,isLskError:()=>O});module.exports=M(b);var d=r((t,e)=>{typeof e!="string"&&Object.keys(e).forEach(o=>{let s=e[o];typeof s!="function"&&(t[o]=s)})},"copyProps");var p=require("@lskjs/algos");var O=r(t=>t&&t.__err,"isLskError"),_=r(t=>(0,p.pick)(t,Object.getOwnPropertyNames(t)),"getLskErrorProps"),l=r((t,e=["name","message","stack","text"])=>(0,p.isPlainObject)(t)?t:t instanceof Error?O(t)?_(t):(0,p.pick)(t,e):{},"errProps");var h=r((...t)=>{let[e,o]=t,s={};return typeof e=="string"&&(s.code=e,typeof o=="string"&&(s.message=o)),t.forEach(n=>{s={...s,...l(n)}}),s},"errMerge");var f=require("@lskjs/algos");var J=r(t=>Array.from(new Set(t)),"uniq"),a="err_unknown",i=r((t,e=a)=>{if(typeof t=="string")return t;let o=t&&t.name!=="Error"?t.name:null;return t&&(t.message||t.text||t.code||o)||e},"getMessage"),u=r((t,e=a)=>{let o=[t.code,i(t),t.text,t.stack];return t&&J(o.filter(Boolean)).join(` | ||
`)||e||a},"getText"),g=r((t,e=a)=>t&&(t.code||t.text||t.message)||e,"getCode"),x=r((t,e=!1)=>{if(typeof t=="string")return{code:t,message:t};let o={...t&&t.__raw||{}};return e?o={...o,...(0,f.pick)(t,["name","code","message","text","data"])}:o={...o,...(0,f.omit)((0,f.pick)(t,Object.getOwnPropertyNames(t)),["__err"])},o},"getJSON"),E=r(t=>t instanceof Error,"isError");var y=r(t=>t instanceof c,"isErr"),c=class extends Error{code;__err=!0;constructor(...e){let o=h(...e);super(i(o)),this.name=this.constructor.name,Object.keys(o).forEach(s=>{let n=o[s];s==="message"?this.message!==n&&n&&(this.__parentErrorMessage=n):s==="stack"?this.__parentErrorStack=n:this[s]=n}),this.code||(this.code=g(o))}static getMessage(e,o=a){return i(e,o)}static getText(e,o=a){return u(e,o)}static getCode(e,o=a){return g(e,o)}static getJSON(e,o=!1){return x(e,o)}static isError(e){return E(e)}static isErr(e){return y(e)}static copyProps(e,o){d(e,o)}copyProps(e){d(this,e)}getText(){return u(this)}getJSON(e=!1){return x(this,e)}getMessage(){return i(this)}getCode(){return g(this)}toJSON(){return this.getJSON(!0)}};r(c,"Err");var P=c;0&&(module.exports={Err,errMerge,errProps,errUnknown,getCode,getJSON,getLskErrorProps,getMessage,getText,isErr,isError,isLskError}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@lskjs/err", | ||
"version": "3.3.0", | ||
"version": "3.8.1", | ||
"description": "LSK.js – err – Error class and utils for custom code and message extracting", | ||
"author": "Igor Suvorov <hi@isuvorov.com> (https://github.com/isuvorov)", | ||
"dependencies": { | ||
"@lskjs/algos": "^3.3.0" | ||
"@lskjs/algos": "^3.8.1" | ||
}, | ||
@@ -29,2 +29,3 @@ "files": [ | ||
"repository": "https://github.com/lskjs/lskjs/tree/master//libs/err", | ||
"homepage": "https://github.com/lskjs/lskjs/tree/master//libs/err", | ||
"bugs": "https://github.com/lskjs/lskjs/issues", | ||
@@ -41,3 +42,3 @@ "license": "MIT", | ||
], | ||
"gitHead": "04ef6d9925d23a0042d287ef7cd4ab95a471fa16" | ||
"gitHead": "851edc745717332b82bef5c650eb77c233d980eb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
152508
5
Updated@lskjs/algos@^3.8.1