@soga/error 1.0.8 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -15,8 +15,8 @@ declare class DError extends Error {
15
15
  toJson(): {
16
16
  name: string;
17
17
  message: string;
18
- stack: string | undefined;
19
- details: string[] | undefined;
18
+ stack: string;
19
+ details: string[];
20
20
  cause: any;
21
21
  };
22
22
  toString(): string;
package/dist/index.d.ts CHANGED
@@ -15,8 +15,8 @@ declare class DError extends Error {
15
15
  toJson(): {
16
16
  name: string;
17
17
  message: string;
18
- stack: string | undefined;
19
- details: string[] | undefined;
18
+ stack: string;
19
+ details: string[];
20
20
  cause: any;
21
21
  };
22
22
  toString(): string;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,s=Object.defineProperty,t=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,c={};((e,t)=>{for(var a in t)s(e,a,{get:t[a],enumerable:!0})})(c,{DError:()=>i,buildDError:()=>n}),module.exports=(e=c,((e,c,i,n)=>{if(c&&"object"==typeof c||"function"==typeof c)for(let u of a(c))r.call(e,u)||u===i||s(e,u,{get:()=>c[u],enumerable:!(n=t(c,u))||n.enumerable});return e})(s({},"__esModule",{value:!0}),e));var i=class extends Error{rewritable;message;stack;details;cause;constructor(e){super(e.message),this.rewritable=e.rewritable||!1,this.message=e.message||"",this.details=e.detail?[e.detail]:this.message?[this.message]:[],this.stack=e.stack,this.name="DError",this.cause=e.cause}toJson(){return{name:this.name,message:this.message,stack:this.stack,details:this.details,cause:this.cause}}toString(){const e=this.toJson();return JSON.stringify(e,null,2)}},n=(e,s={})=>{if(e instanceof i){if(!e.rewritable)return e;s.message&&(e.message=s.message);const t=s.detail||s.message;return t&&(e.details=e.details?[t,...e.details]:[t]),s.stack&&(e.stack=`${s.stack}\n${e.stack}`),s.cause?e.cause=s.cause:e.cause&&(e.cause=e.cause),e}{const t=new i({message:e.message,stack:e.stack});s.message&&(t.message=s.message);const a=s.detail||s.message;return a&&(t.details=t.details?[a,...t.details]:[a]),s.stack&&(t.stack=`${s.stack}\n${t.stack}`),s.cause?t.cause=s.cause:e.cause&&(t.cause=e.cause),void 0!==s.rewritable&&(t.rewritable=s.rewritable),t}};
1
+ var e,s=Object.defineProperty,t=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,c={};((e,t)=>{for(var a in t)s(e,a,{get:t[a],enumerable:!0})})(c,{DError:()=>i,buildDError:()=>n}),module.exports=(e=c,((e,c,i,n)=>{if(c&&"object"==typeof c||"function"==typeof c)for(let l of a(c))r.call(e,l)||l===i||s(e,l,{get:()=>c[l],enumerable:!(n=t(c,l))||n.enumerable});return e})(s({},"__esModule",{value:!0}),e));var i=class extends Error{rewritable;message;stack;details;cause;constructor(e){super(e.message),this.rewritable=e.rewritable||!1,this.message=e.message||"",this.details=e.detail?[e.detail]:this.message?[this.message]:[],this.stack=e.stack,this.name="DError",this.cause=e.cause}toJson(){return{name:this.name,message:this.message,stack:this.stack,details:this.details,cause:this.cause}}toString(){const e=this.toJson();return JSON.stringify(e,null,2)}},n=(e,s={})=>{if(e instanceof i){if(!e.rewritable)return e;s.message&&(e.message=s.message);const t=s.detail||s.message;return t&&(e.details=e.details?[t,...e.details]:[t]),s.stack&&(e.stack=`${s.stack}\n${e.stack}`),s.cause?e.cause=s.cause:e.cause&&(e.cause=e.cause),e}{const t=new i({message:e.message,stack:e.stack});s.message&&(t.message=s.message);const a=s.detail||s.message;return a&&(t.details=t.details?[a,...t.details]:[a]),s.stack&&(t.stack=`${s.stack}\n${t.stack}`),s.cause?t.cause=s.cause:e.cause&&(t.cause=e.cause),void 0!==s.rewritable&&(t.rewritable=s.rewritable),t}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soga/error",
3
- "version": "1.0.8",
3
+ "version": "1.3.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,18 +11,18 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "scripts": {
15
- "demo": "tsx ./demo/demo.ts",
16
- "build": "rimraf dist && tsup src/index.ts --format cjs,esm --dts --minify terser",
17
- "prepublishOnly": "npm run build"
18
- },
19
14
  "devDependencies": {
20
15
  "rimraf": "^6.0.1",
21
16
  "terser": "^5.43.1",
22
17
  "tsup": "^8.5.0",
23
- "tsx": "^4.20.3"
18
+ "tsx": "^4.20.6",
19
+ "@soga/typescript-config": "^1.3.6"
24
20
  },
25
21
  "keywords": [],
26
22
  "author": "",
27
- "license": "ISC"
28
- }
23
+ "license": "ISC",
24
+ "scripts": {
25
+ "demo": "tsx ./demo/demo.ts",
26
+ "build": "rimraf dist && tsup src/index.ts --format cjs,esm --dts --minify terser"
27
+ }
28
+ }