@visulima/error 4.4.2 → 4.4.3
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/CHANGELOG.md +11 -0
- package/dist/code-frame/index.mjs +4 -4
- package/dist/error/index.cjs +1 -1
- package/dist/error/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/captureRawStackTrace-B7M10xhx.mjs +1 -0
- package/dist/shared/captureRawStackTrace-Dle60tQN.cjs +1 -0
- package/dist/shared/getErrorCauses--fuy5DYb.cjs +1 -0
- package/dist/shared/getErrorCauses-D025FGyO.mjs +1 -0
- package/dist/shared/indexToLineColumn-BUaHBIUg.cjs +1 -0
- package/dist/shared/{indexToLineColumn-ClV9rDZJ.mjs → indexToLineColumn-BxCJ9Cey.mjs} +1 -1
- package/dist/shared/{isVisulimaError-B-Ulvg7W.mjs → isVisulimaError-7lgjv56R.mjs} +1 -1
- package/dist/shared/{parseStacktrace-CPq_BDLE.mjs → parseStacktrace-CUC_6mhC.mjs} +1 -1
- package/dist/shared/parseStacktrace-DuzLAkHs.cjs +2 -0
- package/dist/shared/{renderError-Bs1vQcPe.mjs → renderError-0-DsuASp.mjs} +2 -2
- package/dist/shared/{renderError-C7MhmUnl.cjs → renderError-CHpSwov5.cjs} +3 -3
- package/dist/shared/{serializeError-Br1DnFP1.mjs → serializeError-DlDgb1in.mjs} +1 -1
- package/dist/stacktrace/index.cjs +1 -1
- package/dist/stacktrace/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/shared/captureRawStackTrace-BaS1v79I.cjs +0 -1
- package/dist/shared/captureRawStackTrace-CIytqD_R.mjs +0 -1
- package/dist/shared/getErrorCauses-BmCcq-Tu.mjs +0 -1
- package/dist/shared/getErrorCauses-DarICRbk.cjs +0 -1
- package/dist/shared/indexToLineColumn-DukzY75E.cjs +0 -1
- package/dist/shared/parseStacktrace-BhPQp5la.cjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## @visulima/error [4.4.3](https://github.com/visulima/visulima/compare/@visulima/error@4.4.2...@visulima/error@4.4.3) (2024-09-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* fixed broken chunk splitting from packem ([1aaf277](https://github.com/visulima/visulima/commit/1aaf27779292d637923c5f8a220e18606e78caa2))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/path:** upgraded to 1.0.7
|
|
11
|
+
|
|
1
12
|
## @visulima/error [4.4.2](https://github.com/visulima/visulima/compare/@visulima/error@4.4.1...@visulima/error@4.4.2) (2024-09-07)
|
|
2
13
|
|
|
3
14
|
### Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var P=Object.defineProperty;var v=(t,e)=>P(t,"name",{value:e,configurable:!0});var
|
|
2
|
-
`),"normalizeLF"),
|
|
3
|
-
`);typeof n?.tabWidth=="number"&&(i=i.map(r=>r.replaceAll(" "," ".repeat(n.tabWidth))));const{end:
|
|
1
|
+
var P=Object.defineProperty;var v=(t,e)=>P(t,"name",{value:e,configurable:!0});var E=Object.defineProperty,F=v((t,e)=>E(t,"name",{value:e,configurable:!0}),"r$1");const N=F(t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),"normalizeLF"),S=globalThis.process||Object.create(null),j={versions:{}},k=new Proxy(S,{get(t,e){if(e in t)return t[e];if(e in j)return j[e]}});var W=Object.defineProperty,C=v((t,e)=>W(t,"name",{value:e,configurable:!0}),"b");const T=C((t,e,h,n)=>{const f={column:0,line:-1,...t.start},i={...f,...t.end},o=f.line,l=f.column,m=i.line,u=i.column;let g=Math.max(o-(h+1),0),p=Math.min(e.length,m+n);o===-1&&(g=0),m===-1&&(p=e.length);const b=m-o,a={};if(b)for(let r=0;r<=b;r++){const s=r+o;if(!l)a[s]=!0;else if(r===0){const c=e[s-1]?.length;a[s]=[l,(c??0)-l+1]}else if(r===b)a[s]=[0,u];else{const c=e[s-r]?.length;a[s]=[0,c]}}else l===u?a[o]=l?[l,0]:!0:a[o]=[l,(u??0)-(l??0)];return{end:p,markerLines:a,start:g}},"getMarkerLines");var _=Object.defineProperty,x=v((t,e)=>_(t,"name",{value:e,configurable:!0}),"o");const B=k.platform==="win32"&&!k.env?.WT_SESSION?">":"❯",I=x((t,e,h)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...h,color:{gutter:x(r=>r,"gutter"),marker:x(r=>r,"marker"),message:x(r=>r,"message"),...h?.color}},f=e.start&&typeof e.start.column=="number";let i=N(t).split(`
|
|
3
|
+
`);typeof n?.tabWidth=="number"&&(i=i.map(r=>r.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:l,start:m}=T(e,i,n.linesAbove,n.linesBelow),u=String(o).length,{gutter:g,marker:p,message:b}=n.color;let a=i.slice(m,o).map((r,s)=>{const c=m+1+s,d=l[c],w=(" "+c).slice(-u),L=!l[c+1],A=" "+w+(n.showGutter?" |":"");if(d){let y="";if(Array.isArray(d)){const O=r.replaceAll(/[^\t]/g," ").slice(0,Math.max(d[0]-1,0)),M=d[1]||1;y=[`
|
|
4
4
|
`,n.prefix+g(A.replaceAll(/\d/g," "))," ",O,p("^").repeat(M)].join(""),L&&n.message&&(y+=` ${b(n.message)}`)}return[n.prefix+p(B),g(A),r.length>0?" "+r:"",y].join("")}return n.prefix+" "+g(A)+(r.length>0?" "+r:"")}).join(`
|
|
5
5
|
`);return n.message&&!f&&(a=n.prefix+" ".repeat(u+1)+n.message+`
|
|
6
|
-
`+a),a},"codeFrame");export{B as
|
|
6
|
+
`+a),a},"codeFrame");export{B as CODE_FRAME_POINTER,I as codeFrame};
|
package/dist/error/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../shared/captureRawStackTrace-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../shared/captureRawStackTrace-Dle60tQN.cjs"),i=require("../shared/getErrorCauses--fuy5DYb.cjs"),s=require("../shared/renderError-CHpSwov5.cjs"),o=require("../shared/serializeError-DIcZqLmW.cjs"),r=require("../shared/isVisulimaError-DYPrVHSe.cjs");exports.captureRawStackTrace=e;exports.getErrorCauses=i;exports.renderError=s.renderError;exports.serializeError=o.serialize;exports.VisulimaError=r.VisulimaError;exports.isVisulimaError=r.isVisulimaError;
|
package/dist/error/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{default as o}from"../shared/captureRawStackTrace-B7M10xhx.mjs";import{default as s}from"../shared/getErrorCauses-D025FGyO.mjs";import{renderError as i}from"../shared/renderError-0-DsuASp.mjs";import{serialize as m}from"../shared/serializeError-DlDgb1in.mjs";import{VisulimaError as p,isVisulimaError as u}from"../shared/isVisulimaError-7lgjv56R.mjs";export{p as VisulimaError,o as captureRawStackTrace,s as getErrorCauses,u as isVisulimaError,i as renderError,m as serializeError};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./code-frame/index.cjs"),i=require("./shared/indexToLineColumn-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./code-frame/index.cjs"),i=require("./shared/indexToLineColumn-BUaHBIUg.cjs"),o=require("./shared/captureRawStackTrace-Dle60tQN.cjs"),a=require("./shared/getErrorCauses--fuy5DYb.cjs"),s=require("./shared/parseStacktrace-DuzLAkHs.cjs"),e=require("./shared/isVisulimaError-DYPrVHSe.cjs"),t=require("./shared/renderError-CHpSwov5.cjs"),c=require("./shared/serializeError-DIcZqLmW.cjs");exports.CODE_FRAME_POINTER=r.CODE_FRAME_POINTER;exports.codeFrame=r.codeFrame;exports.indexToLineColumn=i;exports.captureRawStackTrace=o;exports.getErrorCauses=a;exports.parseStacktrace=s;exports.VisulimaError=e.VisulimaError;exports.isVisulimaError=e.isVisulimaError;exports.renderError=t.renderError;exports.serializeError=c.serialize;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{CODE_FRAME_POINTER as o,codeFrame as a}from"./code-frame/index.mjs";import{default as s}from"./shared/indexToLineColumn-BxCJ9Cey.mjs";import{default as m}from"./shared/captureRawStackTrace-B7M10xhx.mjs";import{default as p}from"./shared/getErrorCauses-D025FGyO.mjs";import{default as u}from"./shared/parseStacktrace-CUC_6mhC.mjs";import{VisulimaError as E,isVisulimaError as d}from"./shared/isVisulimaError-7lgjv56R.mjs";import{renderError as n}from"./shared/renderError-0-DsuASp.mjs";import{serialize as R}from"./shared/serializeError-DlDgb1in.mjs";export{o as CODE_FRAME_POINTER,E as VisulimaError,m as captureRawStackTrace,a as codeFrame,p as getErrorCauses,s as indexToLineColumn,d as isVisulimaError,u as parseStacktrace,n as renderError,R as serializeError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var e=(r,a)=>c(r,"name",{value:a,configurable:!0});var t=Object.defineProperty,n=e((r,a)=>t(r,"name",{value:a,configurable:!0}),"e");const u=n(()=>{if(!Error.captureStackTrace)return;const r=new Error;return Error.captureStackTrace(r),r.stack},"captureRawStackTrace");export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(r,e)=>c(r,"name",{value:e,configurable:!0});var t=Object.defineProperty,n=a((r,e)=>t(r,"name",{value:e,configurable:!0}),"e");const o=n(()=>{if(!Error.captureStackTrace)return;const r=new Error;return Error.captureStackTrace(r),r.stack},"captureRawStackTrace");module.exports=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(r,s)=>c(r,"name",{value:s,configurable:!0});const o=require("node:util");var n=Object.defineProperty,u=a((r,s)=>n(r,"name",{value:s,configurable:!0}),"a");const i=u(r=>{const s=new Set,t=[];let e=r;for(;e;){if(s.has(e)){console.error(`Circular reference detected in error causes: ${o.inspect(r)}`);break}if(t.push(e),s.add(e),!e.cause)break;e=e.cause}return t},"getErrorCauses");module.exports=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var o=(r,a)=>s(r,"name",{value:a,configurable:!0});import{inspect as c}from"node:util";var n=Object.defineProperty,u=o((r,a)=>n(r,"name",{value:a,configurable:!0}),"a");const d=u(r=>{const a=new Set,t=[];let e=r;for(;e;){if(a.has(e)){console.error(`Circular reference detected in error causes: ${c(r)}`);break}if(t.push(e),a.add(e),!e.cause)break;e=e.cause}return t},"getErrorCauses");export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(n,t)=>c(n,"name",{value:t,configurable:!0});var f=Object.defineProperty,s=a((n,t)=>f(n,"name",{value:t,configurable:!0}),"l");const u=s((n,t)=>{let e=0,i=t.length-2;for(;e<i;){const r=e+(i-e>>1);if(n<t[r])i=r-1;else if(n>=t[r+1])e=r+1;else{e=r;break}}return e},"binarySearch"),y=s(n=>n.split(/\n|\r(?!\n)/).reduce((t,e)=>(t.push(t.at(-1)+e.length+1),t),[0]),"getLineStartIndexes"),g=s((n,t,e)=>{const i=e?.skipChecks??!1;if(!i&&(!Array.isArray(n)&&typeof n!="string"||(typeof n=="string"||Array.isArray(n))&&n.length===0))return{column:0,line:0};if(!i&&(typeof t!="number"||typeof n=="string"&&t>=n.length||Array.isArray(n)&&t+1>=n.at(-1)))return{column:0,line:0};if(typeof n=="string"){const o=y(n),l=u(t,o);return{column:t-o[l]+1,line:l+1}}const r=u(t,n);return{column:t-n[r]+1,line:r+1}},"indexToLineColumn");module.exports=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var a=(n,t)=>c(n,"name",{value:t,configurable:!0});var f=Object.defineProperty,
|
|
1
|
+
var c=Object.defineProperty;var a=(n,t)=>c(n,"name",{value:t,configurable:!0});var f=Object.defineProperty,s=a((n,t)=>f(n,"name",{value:t,configurable:!0}),"l");const u=s((n,t)=>{let e=0,i=t.length-2;for(;e<i;){const r=e+(i-e>>1);if(n<t[r])i=r-1;else if(n>=t[r+1])e=r+1;else{e=r;break}}return e},"binarySearch"),y=s(n=>n.split(/\n|\r(?!\n)/).reduce((t,e)=>(t.push(t.at(-1)+e.length+1),t),[0]),"getLineStartIndexes"),p=s((n,t,e)=>{const i=e?.skipChecks??!1;if(!i&&(!Array.isArray(n)&&typeof n!="string"||(typeof n=="string"||Array.isArray(n))&&n.length===0))return{column:0,line:0};if(!i&&(typeof t!="number"||typeof n=="string"&&t>=n.length||Array.isArray(n)&&t+1>=n.at(-1)))return{column:0,line:0};if(typeof n=="string"){const l=y(n),o=u(t,l);return{column:t-l[o]+1,line:o+1}}const r=u(t,n);return{column:t-n[r]+1,line:r+1}},"indexToLineColumn");export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var l=Object.defineProperty;var i=(s,t)=>l(s,"name",{value:t,configurable:!0});var u=Object.defineProperty,r=i((s,t)=>u(s,"name",{value:t,configurable:!0}),"t");const E=r(s=>s instanceof Error&&s.type==="VisulimaError","isVisulimaError");class
|
|
1
|
+
var l=Object.defineProperty;var i=(s,t)=>l(s,"name",{value:t,configurable:!0});var u=Object.defineProperty,r=i((s,t)=>u(s,"name",{value:t,configurable:!0}),"t");const E=r(s=>s instanceof Error&&s.type==="VisulimaError","isVisulimaError");class p extends Error{static{i(this,"VisulimaError")}static{r(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:t,hint:e,location:a,message:o,name:c,stack:n,title:h}){super(o,{cause:t}),this.title=h,this.name=c,this.stack=n??this.stack,this.loc=a,this.hint=e,Error.captureStackTrace(this,this.constructor)}setLocation(t){this.loc=t}setName(t){this.name=t}setMessage(t){this.message=t}setHint(t){this.hint=t}}export{p as VisulimaError,E as isVisulimaError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var x=Object.defineProperty;var v=(i,e)=>x(i,"name",{value:e,configurable:!0});var N=Object.defineProperty,c=v((i,e)=>N(i,"name",{value:e,configurable:!0}),"u");const u=c((i,...e)=>{process.env.DEBUG&&String(process.env.DEBUG)==="true"&&console.debug(`error:parse-stacktrace: ${i}`,...e)},"debugLog"),f="<unknown>",g=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,S=/(.*?):(\d+):(\d+)(\s<-\s(.+):(\d+):(\d+))?/,k=/(eval)\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*(<anonymous>)?:(\d+)?:(\d+)/,w=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,b=/in\s(.*)\s\(at\s(.+)\)\sat/,O=/^(?:.*@)?(.*):(\d+):(\d+)$/,E=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,J=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,A=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,p=/\(error: (.*)\)/,y=c((i,e)=>{const n=i.includes("safari-extension"),o=i.includes("safari-web-extension");return n||o?[i.includes("@")?i.split("@")[0]:f,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[i,e]},"extractSafariExtensionDetails"),$=c((i,e)=>{const n=S.exec(e);n&&(i.file=n[1],i.line=+n[2],i.column=+n[3])},"parseMapped"),G=c(i=>{const e=b.exec(i);if(e){u(`parse nested node error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const o=e[2].split(":");return{column:o[2]?+o[2]:void 0,file:o[0],line:o[1]?+o[1]:void 0,methodName:e[1]||f,raw:i,type:void 0}}const n=w.exec(i);if(n){u(`parse node error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const o={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(/at\s/,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]||f,raw:i,type:i.startsWith("internal")?"internal":void 0};return $(o,n[2]+":"+n[3]+":"+n[4]),o}},"parseNode"),W=c(i=>{const e=g.exec(i);if(e){u(`parse chrome error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),o=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let t,a;if(o){const s=h.exec(i);if(s){const r=/(\S+):(\d+):(\d+)|(\S+):(\d+)$/.exec(s[1]);r?(e[2]=r[4]??r[1],e[3]=r[5]??r[2],e[4]=r[3]):s[2]&&(e[2]=s[1]),s[2]&&(t={column:s[4]?+s[4]:void 0,file:s[2],line:s[3]?+s[3]:void 0,methodName:"eval",raw:i,type:"eval"})}else{const r=k.exec(i);r&&(a={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0},t={column:r[8]?+r[8]:void 0,file:r[2],line:r[7]?+r[7]:void 0,methodName:"eval",raw:r[0],type:"eval"})}}const[m,d]=y(e[1]?e[1].replace(/^Anonymous function$/,"<anonymous>"):f,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:t,file:d,line:e[3]?+e[3]:void 0,methodName:m,raw:i,type:o?"eval":n?"native":void 0};return a?(l.column=a.column,l.file=a.file,l.line=a.line):$(l,d+":"+e[3]+":"+e[4]),l}},"parseChromium"),D=c((i,e)=>{const n=E.exec(i);if(n){u(`parse gecko error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const o=n[3]?.includes(" > eval"),t=o&&n[3]&&J.exec(n[3]);let a;o&&t&&(n[3]=t[1],a={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:i,type:"eval"},n[4]=t[2]);const[m,d]=y(n[1]?n[1].replace(/^Anonymous function$/,"<anonymous>"):f,n[3]);let l;(e?.type==="safari"||!o&&e?.type==="firefox")&&e.column?l=e.column:!o&&n[5]&&(l=+n[5]);let s;return(e?.type==="safari"||!o&&e?.type==="firefox")&&e.line?s=e.line:n[4]&&(s=+n[4]),{column:l,evalOrigin:a,file:d,line:s,methodName:m,raw:i,type:o?"eval":d.includes("[native code]")?"native":void 0}}},"parseGecko"),j=c((i,e)=>{const n=A.exec(i);if(!(n&&n[2].includes(" > eval"))&&n)return u(`parse firefox error stack line: "${i}"`,`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||f,raw:i,type:void 0}},"parseFirefox"),z=c(i=>{const e=O.exec(i);if(e)return u(`parse react android native error stack line: "${i}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:f,raw:i,type:void 0}},"parseReactAndroidNative"),L=c((i,{filter:e,frameLimit:n=50}={})=>{let o=(i.stacktrace??i.stack??"").split(`
|
|
2
|
-
`).map(t=>(p.test(t)?t.replace(p,"$1"):t).replace(/^\s+|\s+$/g,"")).filter(t=>!/\S*(?:Error: |AggregateError:)/.test(t)&&t!=="eval code");return e&&(o=o.filter(t=>e(t))),o=o.slice(0,n),o.reduce((t,a,m)=>{if(!a||a.length>1024)return t;let d;if(/^\s*in\s.*/.test(a))d=G(a);else if(/^.*?\s*at\s.*/.test(a))d=W(a);else if(/^.*?\s*@.*|\[native code\]/.test(a)){let l;m===0&&(i.columnNumber||i.lineNumber?l={column:i.columnNumber,line:i.lineNumber,type:"firefox"}:(i.line||i.column)&&(l={column:i.column,line:i.line,type:"safari"})),d=j(a,l)||D(a,l)}else d=z(a);return d?t.push(d):u(`parse error stack line: "${a}"`,"not parser found"),t},[])},"parse");export{L as
|
|
2
|
+
`).map(t=>(p.test(t)?t.replace(p,"$1"):t).replace(/^\s+|\s+$/g,"")).filter(t=>!/\S*(?:Error: |AggregateError:)/.test(t)&&t!=="eval code");return e&&(o=o.filter(t=>e(t))),o=o.slice(0,n),o.reduce((t,a,m)=>{if(!a||a.length>1024)return t;let d;if(/^\s*in\s.*/.test(a))d=G(a);else if(/^.*?\s*at\s.*/.test(a))d=W(a);else if(/^.*?\s*@.*|\[native code\]/.test(a)){let l;m===0&&(i.columnNumber||i.lineNumber?l={column:i.columnNumber,line:i.lineNumber,type:"firefox"}:(i.line||i.column)&&(l={column:i.column,line:i.line,type:"safari"})),d=j(a,l)||D(a,l)}else d=z(a);return d?t.push(d):u(`parse error stack line: "${a}"`,"not parser found"),t},[])},"parse");export{L as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var v=(i,e)=>x(i,"name",{value:e,configurable:!0});var N=Object.defineProperty,d=v((i,e)=>N(i,"name",{value:e,configurable:!0}),"u");const u=d((i,...e)=>{process.env.DEBUG&&String(process.env.DEBUG)==="true"&&console.debug(`error:parse-stacktrace: ${i}`,...e)},"debugLog"),f="<unknown>",g=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,S=/(.*?):(\d+):(\d+)(\s<-\s(.+):(\d+):(\d+))?/,k=/(eval)\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*(<anonymous>)?:(\d+)?:(\d+)/,w=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,b=/in\s(.*)\s\(at\s(.+)\)\sat/,O=/^(?:.*@)?(.*):(\d+):(\d+)$/,E=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,J=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,A=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,p=/\(error: (.*)\)/,y=d((i,e)=>{const n=i.includes("safari-extension"),o=i.includes("safari-web-extension");return n||o?[i.includes("@")?i.split("@")[0]:f,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[i,e]},"extractSafariExtensionDetails"),$=d((i,e)=>{const n=S.exec(e);n&&(i.file=n[1],i.line=+n[2],i.column=+n[3])},"parseMapped"),G=d(i=>{const e=b.exec(i);if(e){u(`parse nested node error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const o=e[2].split(":");return{column:o[2]?+o[2]:void 0,file:o[0],line:o[1]?+o[1]:void 0,methodName:e[1]||f,raw:i,type:void 0}}const n=w.exec(i);if(n){u(`parse node error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const o={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(/at\s/,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]||f,raw:i,type:i.startsWith("internal")?"internal":void 0};return $(o,n[2]+":"+n[3]+":"+n[4]),o}},"parseNode"),W=d(i=>{const e=g.exec(i);if(e){u(`parse chrome error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),o=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let t,a;if(o){const s=h.exec(i);if(s){const r=/(\S+):(\d+):(\d+)|(\S+):(\d+)$/.exec(s[1]);r?(e[2]=r[4]??r[1],e[3]=r[5]??r[2],e[4]=r[3]):s[2]&&(e[2]=s[1]),s[2]&&(t={column:s[4]?+s[4]:void 0,file:s[2],line:s[3]?+s[3]:void 0,methodName:"eval",raw:i,type:"eval"})}else{const r=k.exec(i);r&&(a={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0},t={column:r[8]?+r[8]:void 0,file:r[2],line:r[7]?+r[7]:void 0,methodName:"eval",raw:r[0],type:"eval"})}}const[m,c]=y(e[1]?e[1].replace(/^Anonymous function$/,"<anonymous>"):f,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:t,file:c,line:e[3]?+e[3]:void 0,methodName:m,raw:i,type:o?"eval":n?"native":void 0};return a?(l.column=a.column,l.file=a.file,l.line=a.line):$(l,c+":"+e[3]+":"+e[4]),l}},"parseChromium"),D=d((i,e)=>{const n=E.exec(i);if(n){u(`parse gecko error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const o=n[3]?.includes(" > eval"),t=o&&n[3]&&J.exec(n[3]);let a;o&&t&&(n[3]=t[1],a={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:i,type:"eval"},n[4]=t[2]);const[m,c]=y(n[1]?n[1].replace(/^Anonymous function$/,"<anonymous>"):f,n[3]);let l;(e?.type==="safari"||!o&&e?.type==="firefox")&&e.column?l=e.column:!o&&n[5]&&(l=+n[5]);let s;return(e?.type==="safari"||!o&&e?.type==="firefox")&&e.line?s=e.line:n[4]&&(s=+n[4]),{column:l,evalOrigin:a,file:c,line:s,methodName:m,raw:i,type:o?"eval":c.includes("[native code]")?"native":void 0}}},"parseGecko"),j=d((i,e)=>{const n=A.exec(i);if(!(n&&n[2].includes(" > eval"))&&n)return u(`parse firefox error stack line: "${i}"`,`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||f,raw:i,type:void 0}},"parseFirefox"),z=d(i=>{const e=O.exec(i);if(e)return u(`parse react android native error stack line: "${i}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:f,raw:i,type:void 0}},"parseReactAndroidNative"),B=d((i,{filter:e,frameLimit:n=50}={})=>{let o=(i.stacktrace??i.stack??"").split(`
|
|
2
|
+
`).map(t=>(p.test(t)?t.replace(p,"$1"):t).replace(/^\s+|\s+$/g,"")).filter(t=>!/\S*(?:Error: |AggregateError:)/.test(t)&&t!=="eval code");return e&&(o=o.filter(t=>e(t))),o=o.slice(0,n),o.reduce((t,a,m)=>{if(!a||a.length>1024)return t;let c;if(/^\s*in\s.*/.test(a))c=G(a);else if(/^.*?\s*at\s.*/.test(a))c=W(a);else if(/^.*?\s*@.*|\[native code\]/.test(a)){let l;m===0&&(i.columnNumber||i.lineNumber?l={column:i.columnNumber,line:i.lineNumber,type:"firefox"}:(i.line||i.column)&&(l={column:i.column,line:i.line,type:"safari"})),c=j(a,l)||D(a,l)}else c=z(a);return c?t.push(c):u(`parse error stack line: "${a}"`,"not parser found"),t},[])},"parse");module.exports=B;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var C=Object.defineProperty;var u=(e,r)=>C(e,"name",{value:r,configurable:!0});import{existsSync as M,readFileSync as y}from"node:fs";import{relative as S}from"node:path";import{cwd as V}from"node:process";import{fileURLToPath as N}from"node:url";import{
|
|
1
|
+
var C=Object.defineProperty;var u=(e,r)=>C(e,"name",{value:r,configurable:!0});import{existsSync as M,readFileSync as y}from"node:fs";import{relative as S}from"node:path";import{cwd as V}from"node:process";import{fileURLToPath as N}from"node:url";import{codeFrame as P}from"../code-frame/index.mjs";import g from"./parseStacktrace-CUC_6mhC.mjs";var A=Object.defineProperty,s=u((e,r)=>A(e,"name",{value:r,configurable:!0}),"o");const f=s((e,r,t)=>t===0?e+"":r===" "?e+" ".repeat(t):e+" ".repeat(r*t),"getPrefix"),T=s((e,r)=>{const t=e.replace("async file:","file:");return S(r,t.startsWith("file:")?N(t):t)},"getRelativePath"),p=s((e,{color:r,hideErrorTitle:t,indentation:i,prefix:n},a)=>f(n,i,a)+(t?r.title(e.message):r.title(e.name+(e.message?": "+e.message:"")))+`
|
|
2
2
|
`,"getMessage"),v=s((e,{color:r,indentation:t,prefix:i},n)=>{if(e.hint===void 0)return;const a=f(i,t,n);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=a+l+`
|
|
3
3
|
`;else o+=a+e.hint;return r.hint(o)},"getHint"),h=s((e,{color:r,cwd:t,displayShortPath:i,indentation:n,prefix:a},o=0)=>{const l=i?T(e.file,t):e.file,{fileLine:d,method:m}=r;return f(a,n,o)+"at "+(e.methodName?m(e.methodName)+" ":"")+d(l)+":"+d(e.line+"")},"getMainFrame"),w=s((e,{color:r,indentation:t,linesAbove:i,linesBelow:n,prefix:a,showGutter:o,showLineNumbers:l,tabWidth:d},m)=>{if(e.file===void 0)return;const c=e.file.replace("file://","");if(!M(c))return;const L=y(c,"utf8");return P(L,{start:{column:e.column,line:e.line}},{color:r,linesAbove:i,linesBelow:n,prefix:f(a,t,m),showGutter:o,showLineNumbers:l,tabWidth:d})},"getCode"),E=s((e,r,t)=>{if(e.errors.length===0)return;let i=f(r.prefix,r.indentation,t)+`Errors:
|
|
4
4
|
|
|
@@ -15,4 +15,4 @@ var C=Object.defineProperty;var u=(e,r)=>C(e,"name",{value:r,configurable:!0});i
|
|
|
15
15
|
`+i},"getCause"),k=s((e,r)=>(e.length>0?`
|
|
16
16
|
`:"")+e.map(t=>h(t,r)).join(`
|
|
17
17
|
`),"getStacktrace"),b=s((e,r,t)=>{const i={cwd:V(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...r,color:{fileLine:s(o=>o,"fileLine"),gutter:s(o=>o,"gutter"),hint:s(o=>o,"hint"),marker:s(o=>o,"marker"),message:s(o=>o,"message"),method:s(o=>o,"method"),title:s(o=>o,"title"),...r.color}},n=g(e,{filter:r.filterStacktrace,frameLimit:i.framesMaxLimit}),a=n.shift();return[r.hideMessage?void 0:p(e,i,t),v(e,i,t),a?h(a,i,t):void 0,a&&!i.hideErrorCodeView?w(a,i,t):void 0,e instanceof AggregateError?E(e,i,t):void 0,e.cause===void 0?void 0:x(e,i,t),n.length>0?k(n,i):void 0].filter(Boolean).join(`
|
|
18
|
-
`)},"internalRenderError"),O=s((e,r={})=>{if(r.framesMaxLimit!==void 0&&r.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return b(e,r,0)},"renderError");export{O as
|
|
18
|
+
`)},"internalRenderError"),O=s((e,r={})=>{if(r.framesMaxLimit!==void 0&&r.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return b(e,r,0)},"renderError");export{O as renderError};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var M=Object.defineProperty;var u=(e,r)=>M(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("node:fs"),S=require("node:path"),y=require("node:process"),P=require("node:url"),V=require("../code-frame/index.cjs"),v=require("./parseStacktrace-
|
|
1
|
+
"use strict";var M=Object.defineProperty;var u=(e,r)=>M(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("node:fs"),S=require("node:path"),y=require("node:process"),P=require("node:url"),V=require("../code-frame/index.cjs"),v=require("./parseStacktrace-DuzLAkHs.cjs");var N=Object.defineProperty,a=u((e,r)=>N(e,"name",{value:r,configurable:!0}),"o");const l=a((e,r,t)=>t===0?e+"":r===" "?e+" ".repeat(t):e+" ".repeat(r*t),"getPrefix"),A=a((e,r)=>{const t=e.replace("async file:","file:");return S.relative(r,t.startsWith("file:")?P.fileURLToPath(t):t)},"getRelativePath"),p=a((e,{color:r,hideErrorTitle:t,indentation:i,prefix:n},s)=>l(n,i,s)+(t?r.title(e.message):r.title(e.name+(e.message?": "+e.message:"")))+`
|
|
2
2
|
`,"getMessage"),w=a((e,{color:r,indentation:t,prefix:i},n)=>{if(e.hint===void 0)return;const s=l(i,t,n);let o="";if(Array.isArray(e.hint))for(const d of e.hint)o+=s+d+`
|
|
3
3
|
`;else o+=s+e.hint;return r.hint(o)},"getHint"),h=a((e,{color:r,cwd:t,displayShortPath:i,indentation:n,prefix:s},o=0)=>{const d=i?A(e.file,t):e.file,{fileLine:c,method:f}=r;return l(s,n,o)+"at "+(e.methodName?f(e.methodName)+" ":"")+c(d)+":"+c(e.line+"")},"getMainFrame"),E=a((e,{color:r,indentation:t,linesAbove:i,linesBelow:n,prefix:s,showGutter:o,showLineNumbers:d,tabWidth:c},f)=>{if(e.file===void 0)return;const m=e.file.replace("file://","");if(!g.existsSync(m))return;const C=g.readFileSync(m,"utf8");return V.codeFrame(C,{start:{column:e.column,line:e.line}},{color:r,linesAbove:i,linesBelow:n,prefix:l(s,t,f),showGutter:o,showLineNumbers:d,tabWidth:c})},"getCode"),b=a((e,r,t)=>{if(e.errors.length===0)return;let i=l(r.prefix,r.indentation,t)+`Errors:
|
|
4
4
|
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
`,i+=L(s,{...r,framesMaxLimit:1,hideErrorCodeView:r.hideErrorErrorsCodeView},t+1);return`
|
|
8
8
|
`+i},"getErrors"),x=a((e,r,t)=>{let i=l(r.prefix,r.indentation,t)+`Caused by:
|
|
9
9
|
|
|
10
|
-
`;const n=e.cause;i+=p(n,r,t);const s=v
|
|
10
|
+
`;const n=e.cause;i+=p(n,r,t);const s=v(n).shift(),o=w(n,r,t);if(o&&(i+=o+`
|
|
11
11
|
`),i+=h(s,r,t),!r.hideErrorCauseCodeView){const d=E(s,r,t);d!==void 0&&(i+=`
|
|
12
12
|
`+d)}if(n.cause)i+=`
|
|
13
13
|
`+x(n,r,t+1);else if(n instanceof AggregateError){const d=b(n,r,t);d!==void 0&&(i+=`
|
|
14
14
|
`+d)}return`
|
|
15
15
|
`+i},"getCause"),T=a((e,r)=>(e.length>0?`
|
|
16
16
|
`:"")+e.map(t=>h(t,r)).join(`
|
|
17
|
-
`),"getStacktrace"),L=a((e,r,t)=>{const i={cwd:y.cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...r,color:{fileLine:a(o=>o,"fileLine"),gutter:a(o=>o,"gutter"),hint:a(o=>o,"hint"),marker:a(o=>o,"marker"),message:a(o=>o,"message"),method:a(o=>o,"method"),title:a(o=>o,"title"),...r.color}},n=v
|
|
17
|
+
`),"getStacktrace"),L=a((e,r,t)=>{const i={cwd:y.cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...r,color:{fileLine:a(o=>o,"fileLine"),gutter:a(o=>o,"gutter"),hint:a(o=>o,"hint"),marker:a(o=>o,"marker"),message:a(o=>o,"message"),method:a(o=>o,"method"),title:a(o=>o,"title"),...r.color}},n=v(e,{filter:r.filterStacktrace,frameLimit:i.framesMaxLimit}),s=n.shift();return[r.hideMessage?void 0:p(e,i,t),w(e,i,t),s?h(s,i,t):void 0,s&&!i.hideErrorCodeView?E(s,i,t):void 0,e instanceof AggregateError?b(e,i,t):void 0,e.cause===void 0?void 0:x(e,i,t),n.length>0?T(n,i):void 0].filter(Boolean).join(`
|
|
18
18
|
`)},"internalRenderError"),k=a((e,r={})=>{if(r.framesMaxLimit!==void 0&&r.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return L(e,r,0)},"renderError");exports.renderError=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=Object.defineProperty;var
|
|
1
|
+
var b=Object.defineProperty;var s=(e,t)=>b(e,"name",{value:t,configurable:!0});function p(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}s(p,"isPlainObject");const m=Object.create({},{cause:{enumerable:!0,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!0,value:void 0,writable:!0},message:{enumerable:!0,value:void 0,writable:!0},name:{enumerable:!0,value:void 0,writable:!0},stack:{enumerable:!0,value:void 0,writable:!0}});var y=Object.defineProperty,u=s((e,t)=>y(e,"name",{value:t,configurable:!0}),"c");const l=new WeakSet,d=u(e=>{l.add(e);const t=e.toJSON();return l.delete(e),t},"toJSON"),f=u((e,t,n,c)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return t.includes(e)?"[Circular]":(n+=1,a(e,c,t,n));if(c.useToJSON&&typeof e.toJSON=="function")return e.toJSON();if(typeof e=="object"&&e instanceof Date)return e.toISOString();if(typeof e=="function")return"[Function: "+(e.name||"anonymous")+"]";if(p(e)){if(n+=1,c.maxDepth&&n>=c.maxDepth)return{};const r={};for(const o in e)r[o]=f(e[o],t,n,c);return r}try{return e}catch{return"[Not Available]"}},"serializeValue"),a=u((e,t,n,c)=>{if(n.push(e),t.maxDepth===0)return{};if(t.useToJSON&&typeof e.toJSON=="function"&&!l.has(e))return d(e);const r=Object.create(m);if(r.name=Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,r.message=e.message,r.stack=e.stack,Array.isArray(e.errors)){const o=[];for(const i of e.errors){if(!(i instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.includes(i))return r.errors=[],r;o.push(a(i,t,n,c))}r.errors=o}e.cause instanceof Error&&!n.includes(e.cause)&&(r.cause=a(e.cause,t,n,c));for(const o in e)if(r[o]===void 0){const i=e[o];r[o]=f(i,n,c,t)}if(Array.isArray(t.exclude)&&t.exclude.length>0)for(const o of t.exclude)try{delete r[o]}catch{}return r},"_serialize"),S=u((e,t={})=>a(e,{exclude:t.exclude??[],maxDepth:t.maxDepth??Number.POSITIVE_INFINITY,useToJSON:t.useToJSON??!1},[],0),"serialize");export{S as serialize};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../shared/parseStacktrace-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../shared/parseStacktrace-DuzLAkHs.cjs");exports.parseStacktrace=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{default as r}from"../shared/parseStacktrace-CUC_6mhC.mjs";export{r as parseStacktrace};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/error",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.3",
|
|
4
4
|
"description": "Error with more than just a message, stacktrace parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
"@types/command-line-args": "^5.2.3",
|
|
142
142
|
"@types/node": "18.19.15",
|
|
143
143
|
"@visulima/nextra-theme-docs": "4.0.26",
|
|
144
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
145
|
-
"@visulima/path": "1.0.
|
|
144
|
+
"@visulima/packem": "^1.0.0-alpha.95",
|
|
145
|
+
"@visulima/path": "1.0.7",
|
|
146
146
|
"@vitest/coverage-v8": "^2.0.5",
|
|
147
147
|
"@vitest/ui": "^2.0.5",
|
|
148
148
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty;var a=(r,e)=>t(r,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var c=Object.defineProperty,o=a((r,e)=>c(r,"name",{value:e,configurable:!0}),"e");const n=o(()=>{if(!Error.captureStackTrace)return;const r=new Error;return Error.captureStackTrace(r),r.stack},"captureRawStackTrace");exports.c=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=Object.defineProperty;var a=(r,e)=>c(r,"name",{value:e,configurable:!0});var t=Object.defineProperty,n=a((r,e)=>t(r,"name",{value:e,configurable:!0}),"e");const u=n(()=>{if(!Error.captureStackTrace)return;const r=new Error;return Error.captureStackTrace(r),r.stack},"captureRawStackTrace");export{u as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var t=(r,a)=>s(r,"name",{value:a,configurable:!0});import{inspect as c}from"node:util";var n=Object.defineProperty,i=t((r,a)=>n(r,"name",{value:a,configurable:!0}),"a");const d=i(r=>{const a=new Set,o=[];let e=r;for(;e;){if(a.has(e)){console.error(`Circular reference detected in error causes: ${c(r)}`);break}if(o.push(e),a.add(e),!e.cause)break;e=e.cause}return o},"getErrorCauses");export{d as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var o=(r,t)=>s(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("node:util");var n=Object.defineProperty,i=o((r,t)=>n(r,"name",{value:t,configurable:!0}),"a");const u=i(r=>{const t=new Set,a=[];let e=r;for(;e;){if(t.has(e)){console.error(`Circular reference detected in error causes: ${c.inspect(r)}`);break}if(a.push(e),t.add(e),!e.cause)break;e=e.cause}return a},"getErrorCauses");exports.i=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var a=(n,t)=>c(n,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var y=Object.defineProperty,o=a((n,t)=>y(n,"name",{value:t,configurable:!0}),"l");const u=o((n,t)=>{let e=0,i=t.length-2;for(;e<i;){const r=e+(i-e>>1);if(n<t[r])i=r-1;else if(n>=t[r+1])e=r+1;else{e=r;break}}return e},"binarySearch"),f=o(n=>n.split(/\n|\r(?!\n)/).reduce((t,e)=>(t.push(t.at(-1)+e.length+1),t),[0]),"getLineStartIndexes"),g=o((n,t,e)=>{const i=e?.skipChecks??!1;if(!i&&(!Array.isArray(n)&&typeof n!="string"||(typeof n=="string"||Array.isArray(n))&&n.length===0))return{column:0,line:0};if(!i&&(typeof t!="number"||typeof n=="string"&&t>=n.length||Array.isArray(n)&&t+1>=n.at(-1)))return{column:0,line:0};if(typeof n=="string"){const l=f(n),s=u(t,l);return{column:t-l[s]+1,line:s+1}}const r=u(t,n);return{column:t-n[r]+1,line:r+1}},"indexToLineColumn");exports.u=g;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var x=Object.defineProperty;var v=(i,e)=>x(i,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var g=Object.defineProperty,c=v((i,e)=>g(i,"name",{value:e,configurable:!0}),"u");const u=c((i,...e)=>{process.env.DEBUG&&String(process.env.DEBUG)==="true"&&console.debug(`error:parse-stacktrace: ${i}`,...e)},"debugLog"),f="<unknown>",N=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,S=/(.*?):(\d+):(\d+)(\s<-\s(.+):(\d+):(\d+))?/,b=/(eval)\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*(<anonymous>)?:(\d+)?:(\d+)/,k=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,w=/in\s(.*)\s\(at\s(.+)\)\sat/,O=/^(?:.*@)?(.*):(\d+):(\d+)$/,E=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,J=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,A=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,p=/\(error: (.*)\)/,y=c((i,e)=>{const n=i.includes("safari-extension"),o=i.includes("safari-web-extension");return n||o?[i.includes("@")?i.split("@")[0]:f,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[i,e]},"extractSafariExtensionDetails"),$=c((i,e)=>{const n=S.exec(e);n&&(i.file=n[1],i.line=+n[2],i.column=+n[3])},"parseMapped"),G=c(i=>{const e=w.exec(i);if(e){u(`parse nested node error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const o=e[2].split(":");return{column:o[2]?+o[2]:void 0,file:o[0],line:o[1]?+o[1]:void 0,methodName:e[1]||f,raw:i,type:void 0}}const n=k.exec(i);if(n){u(`parse node error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const o={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(/at\s/,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]||f,raw:i,type:i.startsWith("internal")?"internal":void 0};return $(o,n[2]+":"+n[3]+":"+n[4]),o}},"parseNode"),W=c(i=>{const e=N.exec(i);if(e){u(`parse chrome error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),o=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let t,a;if(o){const s=h.exec(i);if(s){const r=/(\S+):(\d+):(\d+)|(\S+):(\d+)$/.exec(s[1]);r?(e[2]=r[4]??r[1],e[3]=r[5]??r[2],e[4]=r[3]):s[2]&&(e[2]=s[1]),s[2]&&(t={column:s[4]?+s[4]:void 0,file:s[2],line:s[3]?+s[3]:void 0,methodName:"eval",raw:i,type:"eval"})}else{const r=b.exec(i);r&&(a={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0},t={column:r[8]?+r[8]:void 0,file:r[2],line:r[7]?+r[7]:void 0,methodName:"eval",raw:r[0],type:"eval"})}}const[m,d]=y(e[1]?e[1].replace(/^Anonymous function$/,"<anonymous>"):f,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:t,file:d,line:e[3]?+e[3]:void 0,methodName:m,raw:i,type:o?"eval":n?"native":void 0};return a?(l.column=a.column,l.file=a.file,l.line=a.line):$(l,d+":"+e[3]+":"+e[4]),l}},"parseChromium"),j=c((i,e)=>{const n=E.exec(i);if(n){u(`parse gecko error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const o=n[3]?.includes(" > eval"),t=o&&n[3]&&J.exec(n[3]);let a;o&&t&&(n[3]=t[1],a={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:i,type:"eval"},n[4]=t[2]);const[m,d]=y(n[1]?n[1].replace(/^Anonymous function$/,"<anonymous>"):f,n[3]);let l;(e?.type==="safari"||!o&&e?.type==="firefox")&&e.column?l=e.column:!o&&n[5]&&(l=+n[5]);let s;return(e?.type==="safari"||!o&&e?.type==="firefox")&&e.line?s=e.line:n[4]&&(s=+n[4]),{column:l,evalOrigin:a,file:d,line:s,methodName:m,raw:i,type:o?"eval":d.includes("[native code]")?"native":void 0}}},"parseGecko"),D=c((i,e)=>{const n=A.exec(i);if(!(n&&n[2].includes(" > eval"))&&n)return u(`parse firefox error stack line: "${i}"`,`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||f,raw:i,type:void 0}},"parseFirefox"),z=c(i=>{const e=O.exec(i);if(e)return u(`parse react android native error stack line: "${i}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:f,raw:i,type:void 0}},"parseReactAndroidNative"),B=c((i,{filter:e,frameLimit:n=50}={})=>{let o=(i.stacktrace??i.stack??"").split(`
|
|
2
|
-
`).map(t=>(p.test(t)?t.replace(p,"$1"):t).replace(/^\s+|\s+$/g,"")).filter(t=>!/\S*(?:Error: |AggregateError:)/.test(t)&&t!=="eval code");return e&&(o=o.filter(t=>e(t))),o=o.slice(0,n),o.reduce((t,a,m)=>{if(!a||a.length>1024)return t;let d;if(/^\s*in\s.*/.test(a))d=G(a);else if(/^.*?\s*at\s.*/.test(a))d=W(a);else if(/^.*?\s*@.*|\[native code\]/.test(a)){let l;m===0&&(i.columnNumber||i.lineNumber?l={column:i.columnNumber,line:i.lineNumber,type:"firefox"}:(i.line||i.column)&&(l={column:i.column,line:i.line,type:"safari"})),d=D(a,l)||j(a,l)}else d=z(a);return d?t.push(d):u(`parse error stack line: "${a}"`,"not parser found"),t},[])},"parse");exports.X=B;
|