@visulima/error 4.4.15 → 4.4.17

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 CHANGED
@@ -1,3 +1,33 @@
1
+ ## @visulima/error [4.4.17](https://github.com/visulima/visulima/compare/@visulima/error@4.4.16...@visulima/error@4.4.17) (2025-05-30)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **error:** update dependencies ([9357477](https://github.com/visulima/visulima/commit/93574770142c8471e19e46b768421b011a0e7681))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * updated dev dependencies ([2433ed5](https://github.com/visulima/visulima/commit/2433ed5fb662e0303c37edee8ddc21b46c21263f))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * **@visulima/path:** upgraded to 1.3.6
15
+
16
+ ## @visulima/error [4.4.16](https://github.com/visulima/visulima/compare/@visulima/error@4.4.15...@visulima/error@4.4.16) (2025-03-07)
17
+
18
+ ### Bug Fixes
19
+
20
+ * updated @visulima/packem and other dev deps, for better bundling size ([e940581](https://github.com/visulima/visulima/commit/e9405812201594e54dd81d17ddb74177df5f3c24))
21
+
22
+ ### Miscellaneous Chores
23
+
24
+ * updated dev dependencies ([487a976](https://github.com/visulima/visulima/commit/487a976932dc7c39edfc19ffd3968960ff338066))
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * **@visulima/path:** upgraded to 1.3.5
30
+
1
31
  ## @visulima/error [4.4.15](https://github.com/visulima/visulima/compare/@visulima/error@4.4.14...@visulima/error@4.4.15) (2025-01-25)
2
32
 
3
33
  ### Bug Fixes
package/README.md CHANGED
@@ -430,6 +430,7 @@ If you would like to help take a look at the [list of issues](https://github.com
430
430
  The visulima error is open-sourced software licensed under the [MIT][license-url]
431
431
 
432
432
  [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
433
+
433
434
  [typescript-url]: https://www.typescriptlang.org/ "TypeScript" "typescript"
434
435
  [license-image]: https://img.shields.io/npm/l/@visulima/error?color=blueviolet&style=for-the-badge
435
436
  [license-url]: LICENSE.md "license"
@@ -18,7 +18,7 @@ const process = new Proxy(_process, {
18
18
  if (property in processShims) {
19
19
  return processShims[property];
20
20
  }
21
- return undefined;
21
+ return void 0;
22
22
  }
23
23
  });
24
24
 
@@ -82,7 +82,6 @@ const codeFrame = /* @__PURE__ */ __name((source, loc, options) => {
82
82
  linesBelow: 3,
83
83
  prefix: "",
84
84
  showGutter: true,
85
- showLineNumbers: true,
86
85
  tabWidth: 4,
87
86
  ...options,
88
87
  color: {
@@ -1,5 +1,5 @@
1
- import { a as CodeFrameNodeLocation, b as CodeFrameOptions } from '../packem_shared/types-CrVmNoPV.d.mjs';
2
- export { C as CodeFrameLocation, c as ColorizeMethod } from '../packem_shared/types-CrVmNoPV.d.mjs';
1
+ import { a as CodeFrameNodeLocation, b as CodeFrameOptions } from '../packem_shared/types-CrVmNoPV.js';
2
+ export { C as CodeFrameLocation, c as ColorizeMethod } from '../packem_shared/types-CrVmNoPV.js';
3
3
 
4
4
  declare const CODE_FRAME_POINTER: string;
5
5
  declare const codeFrame: (source: string, loc: CodeFrameNodeLocation, options?: CodeFrameOptions) => string;
@@ -14,7 +14,7 @@ const process = new Proxy(_process, {
14
14
  if (property in processShims) {
15
15
  return processShims[property];
16
16
  }
17
- return undefined;
17
+ return void 0;
18
18
  }
19
19
  });
20
20
 
@@ -78,7 +78,6 @@ const codeFrame = /* @__PURE__ */ __name((source, loc, options) => {
78
78
  linesBelow: 3,
79
79
  prefix: "",
80
80
  showGutter: true,
81
- showLineNumbers: true,
82
81
  tabWidth: 4,
83
82
  ...options,
84
83
  color: {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
4
 
5
- const captureRawStackTrace = require('../packem_shared/captureRawStackTrace-DjD7FUtZ.cjs');
5
+ const captureRawStackTrace = require('../packem_shared/captureRawStackTrace-ClSI1tHb.cjs');
6
6
  const getErrorCauses = require('../packem_shared/getErrorCauses-miTeYJEG.cjs');
7
- const renderError = require('../packem_shared/renderError-ZhN2-BE7.cjs');
8
- const serializeError = require('../packem_shared/serializeError-C3BTAUm5.cjs');
7
+ const renderError = require('../packem_shared/renderError-CXZTAXig.cjs');
8
+ const serializeError = require('../packem_shared/serializeError-CT7s0Ffk.cjs');
9
9
  const isVisulimaError = require('../packem_shared/isVisulimaError-BVLWvREw.cjs');
10
10
 
11
11
 
@@ -31,7 +31,7 @@ declare class VisulimaError extends Error {
31
31
  setHint(hint: ErrorHint): void;
32
32
  }
33
33
 
34
- declare const getErrorCauses: <E = unknown>(error: E) => E[];
34
+ declare const getErrorCauses: <E = Error | VisulimaError | unknown>(error: E) => E[];
35
35
 
36
36
  type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
37
37
  color: CodeFrameOptions["color"] & {
@@ -31,7 +31,7 @@ declare class VisulimaError extends Error {
31
31
  setHint(hint: ErrorHint): void;
32
32
  }
33
33
 
34
- declare const getErrorCauses: <E = unknown>(error: E) => E[];
34
+ declare const getErrorCauses: <E = Error | VisulimaError | unknown>(error: E) => E[];
35
35
 
36
36
  type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
37
37
  color: CodeFrameOptions["color"] & {
@@ -1,4 +1,4 @@
1
- import { b as CodeFrameOptions, c as ColorizeMethod } from '../packem_shared/types-CrVmNoPV.d.mjs';
1
+ import { b as CodeFrameOptions, c as ColorizeMethod } from '../packem_shared/types-CrVmNoPV.js';
2
2
 
3
3
  declare const captureRawStackTrace: () => string | undefined;
4
4
 
@@ -31,7 +31,7 @@ declare class VisulimaError extends Error {
31
31
  setHint(hint: ErrorHint): void;
32
32
  }
33
33
 
34
- declare const getErrorCauses: <E = unknown>(error: E) => E[];
34
+ declare const getErrorCauses: <E = Error | VisulimaError | unknown>(error: E) => E[];
35
35
 
36
36
  type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
37
37
  color: CodeFrameOptions["color"] & {
@@ -1,5 +1,5 @@
1
- export { default as captureRawStackTrace } from '../packem_shared/captureRawStackTrace-CAQrHENg.mjs';
1
+ export { default as captureRawStackTrace } from '../packem_shared/captureRawStackTrace-Tl3Rqkat.mjs';
2
2
  export { default as getErrorCauses } from '../packem_shared/getErrorCauses-CG_JRE6j.mjs';
3
- export { renderError } from '../packem_shared/renderError-ndNjm7dW.mjs';
4
- export { serialize as serializeError } from '../packem_shared/serializeError-BNAsxuJ_.mjs';
3
+ export { renderError } from '../packem_shared/renderError-BWpM2m6k.mjs';
4
+ export { serialize as serializeError } from '../packem_shared/serializeError-DusTUACt.mjs';
5
5
  export { VisulimaError, isVisulimaError } from '../packem_shared/isVisulimaError-H6TqEA42.mjs';
package/dist/index.cjs CHANGED
@@ -4,12 +4,12 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
4
4
 
5
5
  const codeFrame_index = require('./code-frame/index.cjs');
6
6
  const indexToLineColumn = require('./packem_shared/indexToLineColumn-DjmjeiIY.cjs');
7
- const captureRawStackTrace = require('./packem_shared/captureRawStackTrace-DjD7FUtZ.cjs');
7
+ const captureRawStackTrace = require('./packem_shared/captureRawStackTrace-ClSI1tHb.cjs');
8
8
  const getErrorCauses = require('./packem_shared/getErrorCauses-miTeYJEG.cjs');
9
- const parseStacktrace = require('./packem_shared/parseStacktrace-CPbfvO-n.cjs');
9
+ const parseStacktrace = require('./packem_shared/parseStacktrace-6pFoXW43.cjs');
10
10
  const isVisulimaError = require('./packem_shared/isVisulimaError-BVLWvREw.cjs');
11
- const renderError = require('./packem_shared/renderError-ZhN2-BE7.cjs');
12
- const serializeError = require('./packem_shared/serializeError-C3BTAUm5.cjs');
11
+ const renderError = require('./packem_shared/renderError-CXZTAXig.cjs');
12
+ const serializeError = require('./packem_shared/serializeError-CT7s0Ffk.cjs');
13
13
 
14
14
 
15
15
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CODE_FRAME_POINTER, codeFrame } from './code-frame/index.js';
2
2
  export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, RenderErrorOptions, SerializedError, VisulimaError, captureRawStackTrace, getErrorCauses, isVisulimaError, renderError, serializeError } from './error/index.js';
3
3
  export { Trace, TraceType, parseStacktrace } from './stacktrace/index.js';
4
- export { C as CodeFrameLocation, a as CodeFrameNodeLocation, b as CodeFrameOptions, c as ColorizeMethod } from './packem_shared/types-CrVmNoPV.d.mjs';
4
+ export { C as CodeFrameLocation, a as CodeFrameNodeLocation, b as CodeFrameOptions, c as ColorizeMethod } from './packem_shared/types-CrVmNoPV.js';
5
5
 
6
6
  declare const indexToLineColumn: (input: number[] | string, index: number, options?: {
7
7
  skipChecks: boolean;
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  export { CODE_FRAME_POINTER, codeFrame } from './code-frame/index.mjs';
2
2
  export { default as indexToLineColumn } from './packem_shared/indexToLineColumn-Dx91YDU1.mjs';
3
- export { default as captureRawStackTrace } from './packem_shared/captureRawStackTrace-CAQrHENg.mjs';
3
+ export { default as captureRawStackTrace } from './packem_shared/captureRawStackTrace-Tl3Rqkat.mjs';
4
4
  export { default as getErrorCauses } from './packem_shared/getErrorCauses-CG_JRE6j.mjs';
5
- export { default as parseStacktrace } from './packem_shared/parseStacktrace-B-BUrkkI.mjs';
5
+ export { default as parseStacktrace } from './packem_shared/parseStacktrace-BKGoWCwC.mjs';
6
6
  export { VisulimaError, isVisulimaError } from './packem_shared/isVisulimaError-H6TqEA42.mjs';
7
- export { renderError } from './packem_shared/renderError-ndNjm7dW.mjs';
8
- export { serialize as serializeError } from './packem_shared/serializeError-BNAsxuJ_.mjs';
7
+ export { renderError } from './packem_shared/renderError-BWpM2m6k.mjs';
8
+ export { serialize as serializeError } from './packem_shared/serializeError-DusTUACt.mjs';
@@ -4,7 +4,7 @@ var __defProp = Object.defineProperty;
4
4
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
5
  const captureRawStackTrace = /* @__PURE__ */ __name(() => {
6
6
  if (!Error.captureStackTrace) {
7
- return undefined;
7
+ return void 0;
8
8
  }
9
9
  const stack = new Error();
10
10
  Error.captureStackTrace(stack);
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  const captureRawStackTrace = /* @__PURE__ */ __name(() => {
4
4
  if (!Error.captureStackTrace) {
5
- return undefined;
5
+ return void 0;
6
6
  }
7
7
  const stack = new Error();
8
8
  Error.captureStackTrace(stack);
@@ -44,31 +44,31 @@ const parseNode = /* @__PURE__ */ __name((line) => {
44
44
  debugLog(`parse nested node error stack line: "${line}"`, `found: ${JSON.stringify(nestedNode)}`);
45
45
  const split = nestedNode[2].split(":");
46
46
  return {
47
- column: split[2] ? +split[2] : undefined,
47
+ column: split[2] ? +split[2] : void 0,
48
48
  file: split[0],
49
- line: split[1] ? +split[1] : undefined,
49
+ line: split[1] ? +split[1] : void 0,
50
50
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
51
51
  methodName: nestedNode[1] || UNKNOWN_FUNCTION,
52
52
  raw: line,
53
- type: undefined
53
+ type: void 0
54
54
  };
55
55
  }
56
56
  const node = NODE_REGEX.exec(line);
57
57
  if (node) {
58
58
  debugLog(`parse node error stack line: "${line}"`, `found: ${JSON.stringify(node)}`);
59
59
  const trace = {
60
- column: node[4] ? +node[4] : undefined,
61
- file: node[2] ? node[2].replace(/at\s/, "") : undefined,
62
- line: node[3] ? +node[3] : undefined,
60
+ column: node[4] ? +node[4] : void 0,
61
+ file: node[2] ? node[2].replace(/at\s/, "") : void 0,
62
+ line: node[3] ? +node[3] : void 0,
63
63
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
64
64
  methodName: node[1] || UNKNOWN_FUNCTION,
65
65
  raw: line,
66
- type: line.startsWith("internal") ? "internal" : undefined
66
+ type: line.startsWith("internal") ? "internal" : void 0
67
67
  };
68
68
  parseMapped(trace, node[2] + ":" + node[3] + ":" + node[4]);
69
69
  return trace;
70
70
  }
71
- return undefined;
71
+ return void 0;
72
72
  }, "parseNode");
73
73
  const parseChromium = /* @__PURE__ */ __name((line) => {
74
74
  const parts = CHROMIUM_REGEX.exec(line);
@@ -91,9 +91,9 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
91
91
  }
92
92
  if (subMatch[2]) {
93
93
  evalOrigin = {
94
- column: subMatch[4] ? +subMatch[4] : undefined,
94
+ column: subMatch[4] ? +subMatch[4] : void 0,
95
95
  file: subMatch[2],
96
- line: subMatch[3] ? +subMatch[3] : undefined,
96
+ line: subMatch[3] ? +subMatch[3] : void 0,
97
97
  methodName: "eval",
98
98
  raw: line,
99
99
  type: "eval"
@@ -103,14 +103,14 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
103
103
  const windowsSubMatch = WINDOWS_EVAL_REGEX.exec(line);
104
104
  if (windowsSubMatch) {
105
105
  windowsParts = {
106
- column: windowsSubMatch[5] ? +windowsSubMatch[5] : undefined,
106
+ column: windowsSubMatch[5] ? +windowsSubMatch[5] : void 0,
107
107
  file: windowsSubMatch[3],
108
- line: windowsSubMatch[4] ? +windowsSubMatch[4] : undefined
108
+ line: windowsSubMatch[4] ? +windowsSubMatch[4] : void 0
109
109
  };
110
110
  evalOrigin = {
111
- column: windowsSubMatch[8] ? +windowsSubMatch[8] : undefined,
111
+ column: windowsSubMatch[8] ? +windowsSubMatch[8] : void 0,
112
112
  file: windowsSubMatch[2],
113
- line: windowsSubMatch[7] ? +windowsSubMatch[7] : undefined,
113
+ line: windowsSubMatch[7] ? +windowsSubMatch[7] : void 0,
114
114
  methodName: "eval",
115
115
  raw: windowsSubMatch[0],
116
116
  type: "eval"
@@ -124,13 +124,13 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
124
124
  parts[2]
125
125
  );
126
126
  const trace = {
127
- column: parts[4] ? +parts[4] : undefined,
127
+ column: parts[4] ? +parts[4] : void 0,
128
128
  evalOrigin,
129
129
  file,
130
- line: parts[3] ? +parts[3] : undefined,
130
+ line: parts[3] ? +parts[3] : void 0,
131
131
  methodName,
132
132
  raw: line,
133
- type: isEval ? "eval" : isNative ? "native" : undefined
133
+ type: isEval ? "eval" : isNative ? "native" : void 0
134
134
  };
135
135
  if (windowsParts) {
136
136
  trace.column = windowsParts.column;
@@ -141,7 +141,7 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
141
141
  }
142
142
  return trace;
143
143
  }
144
- return undefined;
144
+ return void 0;
145
145
  }, "parseChromium");
146
146
  const parseGecko = /* @__PURE__ */ __name((line, topFrameMeta) => {
147
147
  const parts = GECKO_REGEX.exec(line);
@@ -153,9 +153,9 @@ const parseGecko = /* @__PURE__ */ __name((line, topFrameMeta) => {
153
153
  if (isEval && subMatch) {
154
154
  parts[3] = subMatch[1];
155
155
  evalOrigin = {
156
- column: parts[5] ? +parts[5] : undefined,
156
+ column: parts[5] ? +parts[5] : void 0,
157
157
  file: parts[3],
158
- line: parts[4] ? +parts[4] : undefined,
158
+ line: parts[4] ? +parts[4] : void 0,
159
159
  methodName: "eval",
160
160
  raw: line,
161
161
  type: "eval"
@@ -186,10 +186,10 @@ const parseGecko = /* @__PURE__ */ __name((line, topFrameMeta) => {
186
186
  line: lineNumber,
187
187
  methodName,
188
188
  raw: line,
189
- type: isEval ? "eval" : file.includes("[native code]") ? "native" : undefined
189
+ type: isEval ? "eval" : file.includes("[native code]") ? "native" : void 0
190
190
  };
191
191
  }
192
- return undefined;
192
+ return void 0;
193
193
  }, "parseGecko");
194
194
  const parseFirefox = /* @__PURE__ */ __name((line, topFrameMeta) => {
195
195
  const parts = FIREFOX_REGEX.exec(line);
@@ -197,31 +197,31 @@ const parseFirefox = /* @__PURE__ */ __name((line, topFrameMeta) => {
197
197
  if (!isEval && parts) {
198
198
  debugLog(`parse firefox error stack line: "${line}"`, `found: ${JSON.stringify(parts)}`);
199
199
  return {
200
- column: parts[4] ? +parts[4] : topFrameMeta?.column ?? undefined,
200
+ column: parts[4] ? +parts[4] : topFrameMeta?.column ?? void 0,
201
201
  file: parts[2],
202
- line: parts[3] ? +parts[3] : topFrameMeta?.line ?? undefined,
202
+ line: parts[3] ? +parts[3] : topFrameMeta?.line ?? void 0,
203
203
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
204
204
  methodName: parts[1] || UNKNOWN_FUNCTION,
205
205
  raw: line,
206
- type: undefined
206
+ type: void 0
207
207
  };
208
208
  }
209
- return undefined;
209
+ return void 0;
210
210
  }, "parseFirefox");
211
211
  const parseReactAndroidNative = /* @__PURE__ */ __name((line) => {
212
212
  const parts = REACT_ANDROID_NATIVE_REGEX.exec(line);
213
213
  if (parts) {
214
214
  debugLog(`parse react android native error stack line: "${line}"`, `found: ${JSON.stringify(parts)}`);
215
215
  return {
216
- column: parts[3] ? +parts[3] : undefined,
216
+ column: parts[3] ? +parts[3] : void 0,
217
217
  file: parts[1],
218
- line: parts[2] ? +parts[2] : undefined,
218
+ line: parts[2] ? +parts[2] : void 0,
219
219
  methodName: UNKNOWN_FUNCTION,
220
220
  raw: line,
221
- type: undefined
221
+ type: void 0
222
222
  };
223
223
  }
224
- return undefined;
224
+ return void 0;
225
225
  }, "parseReactAndroidNative");
226
226
  const parse = /* @__PURE__ */ __name((error, { filter, frameLimit = 50 } = {}) => {
227
227
  let lines = (error.stacktrace ?? error.stack ?? "").split("\n").map((line) => {
@@ -42,31 +42,31 @@ const parseNode = /* @__PURE__ */ __name((line) => {
42
42
  debugLog(`parse nested node error stack line: "${line}"`, `found: ${JSON.stringify(nestedNode)}`);
43
43
  const split = nestedNode[2].split(":");
44
44
  return {
45
- column: split[2] ? +split[2] : undefined,
45
+ column: split[2] ? +split[2] : void 0,
46
46
  file: split[0],
47
- line: split[1] ? +split[1] : undefined,
47
+ line: split[1] ? +split[1] : void 0,
48
48
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
49
49
  methodName: nestedNode[1] || UNKNOWN_FUNCTION,
50
50
  raw: line,
51
- type: undefined
51
+ type: void 0
52
52
  };
53
53
  }
54
54
  const node = NODE_REGEX.exec(line);
55
55
  if (node) {
56
56
  debugLog(`parse node error stack line: "${line}"`, `found: ${JSON.stringify(node)}`);
57
57
  const trace = {
58
- column: node[4] ? +node[4] : undefined,
59
- file: node[2] ? node[2].replace(/at\s/, "") : undefined,
60
- line: node[3] ? +node[3] : undefined,
58
+ column: node[4] ? +node[4] : void 0,
59
+ file: node[2] ? node[2].replace(/at\s/, "") : void 0,
60
+ line: node[3] ? +node[3] : void 0,
61
61
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
62
62
  methodName: node[1] || UNKNOWN_FUNCTION,
63
63
  raw: line,
64
- type: line.startsWith("internal") ? "internal" : undefined
64
+ type: line.startsWith("internal") ? "internal" : void 0
65
65
  };
66
66
  parseMapped(trace, node[2] + ":" + node[3] + ":" + node[4]);
67
67
  return trace;
68
68
  }
69
- return undefined;
69
+ return void 0;
70
70
  }, "parseNode");
71
71
  const parseChromium = /* @__PURE__ */ __name((line) => {
72
72
  const parts = CHROMIUM_REGEX.exec(line);
@@ -89,9 +89,9 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
89
89
  }
90
90
  if (subMatch[2]) {
91
91
  evalOrigin = {
92
- column: subMatch[4] ? +subMatch[4] : undefined,
92
+ column: subMatch[4] ? +subMatch[4] : void 0,
93
93
  file: subMatch[2],
94
- line: subMatch[3] ? +subMatch[3] : undefined,
94
+ line: subMatch[3] ? +subMatch[3] : void 0,
95
95
  methodName: "eval",
96
96
  raw: line,
97
97
  type: "eval"
@@ -101,14 +101,14 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
101
101
  const windowsSubMatch = WINDOWS_EVAL_REGEX.exec(line);
102
102
  if (windowsSubMatch) {
103
103
  windowsParts = {
104
- column: windowsSubMatch[5] ? +windowsSubMatch[5] : undefined,
104
+ column: windowsSubMatch[5] ? +windowsSubMatch[5] : void 0,
105
105
  file: windowsSubMatch[3],
106
- line: windowsSubMatch[4] ? +windowsSubMatch[4] : undefined
106
+ line: windowsSubMatch[4] ? +windowsSubMatch[4] : void 0
107
107
  };
108
108
  evalOrigin = {
109
- column: windowsSubMatch[8] ? +windowsSubMatch[8] : undefined,
109
+ column: windowsSubMatch[8] ? +windowsSubMatch[8] : void 0,
110
110
  file: windowsSubMatch[2],
111
- line: windowsSubMatch[7] ? +windowsSubMatch[7] : undefined,
111
+ line: windowsSubMatch[7] ? +windowsSubMatch[7] : void 0,
112
112
  methodName: "eval",
113
113
  raw: windowsSubMatch[0],
114
114
  type: "eval"
@@ -122,13 +122,13 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
122
122
  parts[2]
123
123
  );
124
124
  const trace = {
125
- column: parts[4] ? +parts[4] : undefined,
125
+ column: parts[4] ? +parts[4] : void 0,
126
126
  evalOrigin,
127
127
  file,
128
- line: parts[3] ? +parts[3] : undefined,
128
+ line: parts[3] ? +parts[3] : void 0,
129
129
  methodName,
130
130
  raw: line,
131
- type: isEval ? "eval" : isNative ? "native" : undefined
131
+ type: isEval ? "eval" : isNative ? "native" : void 0
132
132
  };
133
133
  if (windowsParts) {
134
134
  trace.column = windowsParts.column;
@@ -139,7 +139,7 @@ const parseChromium = /* @__PURE__ */ __name((line) => {
139
139
  }
140
140
  return trace;
141
141
  }
142
- return undefined;
142
+ return void 0;
143
143
  }, "parseChromium");
144
144
  const parseGecko = /* @__PURE__ */ __name((line, topFrameMeta) => {
145
145
  const parts = GECKO_REGEX.exec(line);
@@ -151,9 +151,9 @@ const parseGecko = /* @__PURE__ */ __name((line, topFrameMeta) => {
151
151
  if (isEval && subMatch) {
152
152
  parts[3] = subMatch[1];
153
153
  evalOrigin = {
154
- column: parts[5] ? +parts[5] : undefined,
154
+ column: parts[5] ? +parts[5] : void 0,
155
155
  file: parts[3],
156
- line: parts[4] ? +parts[4] : undefined,
156
+ line: parts[4] ? +parts[4] : void 0,
157
157
  methodName: "eval",
158
158
  raw: line,
159
159
  type: "eval"
@@ -184,10 +184,10 @@ const parseGecko = /* @__PURE__ */ __name((line, topFrameMeta) => {
184
184
  line: lineNumber,
185
185
  methodName,
186
186
  raw: line,
187
- type: isEval ? "eval" : file.includes("[native code]") ? "native" : undefined
187
+ type: isEval ? "eval" : file.includes("[native code]") ? "native" : void 0
188
188
  };
189
189
  }
190
- return undefined;
190
+ return void 0;
191
191
  }, "parseGecko");
192
192
  const parseFirefox = /* @__PURE__ */ __name((line, topFrameMeta) => {
193
193
  const parts = FIREFOX_REGEX.exec(line);
@@ -195,31 +195,31 @@ const parseFirefox = /* @__PURE__ */ __name((line, topFrameMeta) => {
195
195
  if (!isEval && parts) {
196
196
  debugLog(`parse firefox error stack line: "${line}"`, `found: ${JSON.stringify(parts)}`);
197
197
  return {
198
- column: parts[4] ? +parts[4] : topFrameMeta?.column ?? undefined,
198
+ column: parts[4] ? +parts[4] : topFrameMeta?.column ?? void 0,
199
199
  file: parts[2],
200
- line: parts[3] ? +parts[3] : topFrameMeta?.line ?? undefined,
200
+ line: parts[3] ? +parts[3] : topFrameMeta?.line ?? void 0,
201
201
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
202
202
  methodName: parts[1] || UNKNOWN_FUNCTION,
203
203
  raw: line,
204
- type: undefined
204
+ type: void 0
205
205
  };
206
206
  }
207
- return undefined;
207
+ return void 0;
208
208
  }, "parseFirefox");
209
209
  const parseReactAndroidNative = /* @__PURE__ */ __name((line) => {
210
210
  const parts = REACT_ANDROID_NATIVE_REGEX.exec(line);
211
211
  if (parts) {
212
212
  debugLog(`parse react android native error stack line: "${line}"`, `found: ${JSON.stringify(parts)}`);
213
213
  return {
214
- column: parts[3] ? +parts[3] : undefined,
214
+ column: parts[3] ? +parts[3] : void 0,
215
215
  file: parts[1],
216
- line: parts[2] ? +parts[2] : undefined,
216
+ line: parts[2] ? +parts[2] : void 0,
217
217
  methodName: UNKNOWN_FUNCTION,
218
218
  raw: line,
219
- type: undefined
219
+ type: void 0
220
220
  };
221
221
  }
222
- return undefined;
222
+ return void 0;
223
223
  }, "parseReactAndroidNative");
224
224
  const parse = /* @__PURE__ */ __name((error, { filter, frameLimit = 50 } = {}) => {
225
225
  let lines = (error.stacktrace ?? error.stack ?? "").split("\n").map((line) => {
@@ -3,7 +3,7 @@ import { relative } from 'node:path';
3
3
  import { cwd } from 'node:process';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { codeFrame } from '../code-frame/index.mjs';
6
- import parse from './parseStacktrace-B-BUrkkI.mjs';
6
+ import parse from './parseStacktrace-BKGoWCwC.mjs';
7
7
 
8
8
  var __defProp = Object.defineProperty;
9
9
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
@@ -22,8 +22,8 @@ const getRelativePath = /* @__PURE__ */ __name((filePath, cwdPath) => {
22
22
  }, "getRelativePath");
23
23
  const getMessage = /* @__PURE__ */ __name((error, { color, hideErrorTitle, indentation, prefix }, deep) => getPrefix(prefix, indentation, deep) + (hideErrorTitle ? color.title(error.message) : color.title(error.name + (error.message ? ": " + error.message : ""))) + "\n", "getMessage");
24
24
  const getHint = /* @__PURE__ */ __name((error, { color, indentation, prefix }, deep) => {
25
- if (error.hint === undefined) {
26
- return undefined;
25
+ if (error.hint === void 0) {
26
+ return void 0;
27
27
  }
28
28
  const spaces = getPrefix(prefix, indentation, deep);
29
29
  let message = "";
@@ -43,12 +43,12 @@ const getMainFrame = /* @__PURE__ */ __name((trace, { color, cwd: cwdPath, displ
43
43
  fileLine(trace.line + "");
44
44
  }, "getMainFrame");
45
45
  const getCode = /* @__PURE__ */ __name((trace, { color, indentation, linesAbove, linesBelow, prefix, showGutter, showLineNumbers, tabWidth }, deep) => {
46
- if (trace.file === undefined) {
47
- return undefined;
46
+ if (trace.file === void 0) {
47
+ return void 0;
48
48
  }
49
49
  const filePath = trace.file.replace("file://", "");
50
50
  if (!existsSync(filePath)) {
51
- return undefined;
51
+ return void 0;
52
52
  }
53
53
  const fileContent = readFileSync(filePath, "utf8");
54
54
  return codeFrame(
@@ -61,7 +61,7 @@ const getCode = /* @__PURE__ */ __name((trace, { color, indentation, linesAbove,
61
61
  }, "getCode");
62
62
  const getErrors = /* @__PURE__ */ __name((error, options, deep) => {
63
63
  if (error.errors.length === 0) {
64
- return undefined;
64
+ return void 0;
65
65
  }
66
66
  let message = getPrefix(options.prefix, options.indentation, deep) + "Errors:\n\n";
67
67
  let first = true;
@@ -94,7 +94,7 @@ const getCause = /* @__PURE__ */ __name((error, options, deep) => {
94
94
  message += getMainFrame(mainFrame, options, deep);
95
95
  if (!options.hideErrorCauseCodeView) {
96
96
  const code = getCode(mainFrame, options, deep);
97
- if (code !== undefined) {
97
+ if (code !== void 0) {
98
98
  message += "\n" + code;
99
99
  }
100
100
  }
@@ -103,7 +103,7 @@ const getCause = /* @__PURE__ */ __name((error, options, deep) => {
103
103
  message += "\n" + getCause(cause, options, deep + 1);
104
104
  } else if (cause instanceof AggregateError) {
105
105
  const errors = getErrors(cause, options, deep);
106
- if (errors !== undefined) {
106
+ if (errors !== void 0) {
107
107
  message += "\n" + errors;
108
108
  }
109
109
  }
@@ -114,7 +114,7 @@ const internalRenderError = /* @__PURE__ */ __name((error, options, deep) => {
114
114
  const config = {
115
115
  cwd: cwd(),
116
116
  displayShortPath: false,
117
- filterStacktrace: undefined,
117
+ filterStacktrace: void 0,
118
118
  framesMaxLimit: Number.POSITIVE_INFINITY,
119
119
  hideErrorCauseCodeView: false,
120
120
  hideErrorCodeView: false,
@@ -146,17 +146,17 @@ const internalRenderError = /* @__PURE__ */ __name((error, options, deep) => {
146
146
  });
147
147
  const mainFrame = stack.shift();
148
148
  return [
149
- options.hideMessage ? undefined : getMessage(error, config, deep),
149
+ options.hideMessage ? void 0 : getMessage(error, config, deep),
150
150
  getHint(error, config, deep),
151
- mainFrame ? getMainFrame(mainFrame, config, deep) : undefined,
152
- mainFrame && !config.hideErrorCodeView ? getCode(mainFrame, config, deep) : undefined,
153
- error instanceof AggregateError ? getErrors(error, config, deep) : undefined,
154
- error.cause === undefined ? undefined : getCause(error, config, deep),
155
- stack.length > 0 ? getStacktrace(stack, config) : undefined
151
+ mainFrame ? getMainFrame(mainFrame, config, deep) : void 0,
152
+ mainFrame && !config.hideErrorCodeView ? getCode(mainFrame, config, deep) : void 0,
153
+ error instanceof AggregateError ? getErrors(error, config, deep) : void 0,
154
+ error.cause === void 0 ? void 0 : getCause(error, config, deep),
155
+ stack.length > 0 ? getStacktrace(stack, config) : void 0
156
156
  ].filter(Boolean).join("\n").replaceAll("\\", "/");
157
157
  }, "internalRenderError");
158
158
  const renderError = /* @__PURE__ */ __name((error, options = {}) => {
159
- if (options.framesMaxLimit !== undefined && options.framesMaxLimit <= 0) {
159
+ if (options.framesMaxLimit !== void 0 && options.framesMaxLimit <= 0) {
160
160
  throw new RangeError("The 'framesMaxLimit' option must be a positive number");
161
161
  }
162
162
  return internalRenderError(error, options, 0);
@@ -7,7 +7,7 @@ const node_path = require('node:path');
7
7
  const node_process = require('node:process');
8
8
  const node_url = require('node:url');
9
9
  const codeFrame_index = require('../code-frame/index.cjs');
10
- const parseStacktrace = require('./parseStacktrace-CPbfvO-n.cjs');
10
+ const parseStacktrace = require('./parseStacktrace-6pFoXW43.cjs');
11
11
 
12
12
  var __defProp = Object.defineProperty;
13
13
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
@@ -26,8 +26,8 @@ const getRelativePath = /* @__PURE__ */ __name((filePath, cwdPath) => {
26
26
  }, "getRelativePath");
27
27
  const getMessage = /* @__PURE__ */ __name((error, { color, hideErrorTitle, indentation, prefix }, deep) => getPrefix(prefix, indentation, deep) + (hideErrorTitle ? color.title(error.message) : color.title(error.name + (error.message ? ": " + error.message : ""))) + "\n", "getMessage");
28
28
  const getHint = /* @__PURE__ */ __name((error, { color, indentation, prefix }, deep) => {
29
- if (error.hint === undefined) {
30
- return undefined;
29
+ if (error.hint === void 0) {
30
+ return void 0;
31
31
  }
32
32
  const spaces = getPrefix(prefix, indentation, deep);
33
33
  let message = "";
@@ -47,12 +47,12 @@ const getMainFrame = /* @__PURE__ */ __name((trace, { color, cwd: cwdPath, displ
47
47
  fileLine(trace.line + "");
48
48
  }, "getMainFrame");
49
49
  const getCode = /* @__PURE__ */ __name((trace, { color, indentation, linesAbove, linesBelow, prefix, showGutter, showLineNumbers, tabWidth }, deep) => {
50
- if (trace.file === undefined) {
51
- return undefined;
50
+ if (trace.file === void 0) {
51
+ return void 0;
52
52
  }
53
53
  const filePath = trace.file.replace("file://", "");
54
54
  if (!node_fs.existsSync(filePath)) {
55
- return undefined;
55
+ return void 0;
56
56
  }
57
57
  const fileContent = node_fs.readFileSync(filePath, "utf8");
58
58
  return codeFrame_index.codeFrame(
@@ -65,7 +65,7 @@ const getCode = /* @__PURE__ */ __name((trace, { color, indentation, linesAbove,
65
65
  }, "getCode");
66
66
  const getErrors = /* @__PURE__ */ __name((error, options, deep) => {
67
67
  if (error.errors.length === 0) {
68
- return undefined;
68
+ return void 0;
69
69
  }
70
70
  let message = getPrefix(options.prefix, options.indentation, deep) + "Errors:\n\n";
71
71
  let first = true;
@@ -98,7 +98,7 @@ const getCause = /* @__PURE__ */ __name((error, options, deep) => {
98
98
  message += getMainFrame(mainFrame, options, deep);
99
99
  if (!options.hideErrorCauseCodeView) {
100
100
  const code = getCode(mainFrame, options, deep);
101
- if (code !== undefined) {
101
+ if (code !== void 0) {
102
102
  message += "\n" + code;
103
103
  }
104
104
  }
@@ -107,7 +107,7 @@ const getCause = /* @__PURE__ */ __name((error, options, deep) => {
107
107
  message += "\n" + getCause(cause, options, deep + 1);
108
108
  } else if (cause instanceof AggregateError) {
109
109
  const errors = getErrors(cause, options, deep);
110
- if (errors !== undefined) {
110
+ if (errors !== void 0) {
111
111
  message += "\n" + errors;
112
112
  }
113
113
  }
@@ -118,7 +118,7 @@ const internalRenderError = /* @__PURE__ */ __name((error, options, deep) => {
118
118
  const config = {
119
119
  cwd: node_process.cwd(),
120
120
  displayShortPath: false,
121
- filterStacktrace: undefined,
121
+ filterStacktrace: void 0,
122
122
  framesMaxLimit: Number.POSITIVE_INFINITY,
123
123
  hideErrorCauseCodeView: false,
124
124
  hideErrorCodeView: false,
@@ -150,17 +150,17 @@ const internalRenderError = /* @__PURE__ */ __name((error, options, deep) => {
150
150
  });
151
151
  const mainFrame = stack.shift();
152
152
  return [
153
- options.hideMessage ? undefined : getMessage(error, config, deep),
153
+ options.hideMessage ? void 0 : getMessage(error, config, deep),
154
154
  getHint(error, config, deep),
155
- mainFrame ? getMainFrame(mainFrame, config, deep) : undefined,
156
- mainFrame && !config.hideErrorCodeView ? getCode(mainFrame, config, deep) : undefined,
157
- error instanceof AggregateError ? getErrors(error, config, deep) : undefined,
158
- error.cause === undefined ? undefined : getCause(error, config, deep),
159
- stack.length > 0 ? getStacktrace(stack, config) : undefined
155
+ mainFrame ? getMainFrame(mainFrame, config, deep) : void 0,
156
+ mainFrame && !config.hideErrorCodeView ? getCode(mainFrame, config, deep) : void 0,
157
+ error instanceof AggregateError ? getErrors(error, config, deep) : void 0,
158
+ error.cause === void 0 ? void 0 : getCause(error, config, deep),
159
+ stack.length > 0 ? getStacktrace(stack, config) : void 0
160
160
  ].filter(Boolean).join("\n").replaceAll("\\", "/");
161
161
  }, "internalRenderError");
162
162
  const renderError = /* @__PURE__ */ __name((error, options = {}) => {
163
- if (options.framesMaxLimit !== undefined && options.framesMaxLimit <= 0) {
163
+ if (options.framesMaxLimit !== void 0 && options.framesMaxLimit <= 0) {
164
164
  throw new RangeError("The 'framesMaxLimit' option must be a positive number");
165
165
  }
166
166
  return internalRenderError(error, options, 0);
@@ -18,32 +18,32 @@ const ErrorProto = Object.create(
18
18
  {
19
19
  cause: {
20
20
  enumerable: true,
21
- value: undefined,
21
+ value: void 0,
22
22
  writable: true
23
23
  },
24
24
  code: {
25
25
  enumerable: true,
26
- value: undefined,
26
+ value: void 0,
27
27
  writable: true
28
28
  },
29
29
  errors: {
30
30
  enumerable: true,
31
- value: undefined,
31
+ value: void 0,
32
32
  writable: true
33
33
  },
34
34
  message: {
35
35
  enumerable: true,
36
- value: undefined,
36
+ value: void 0,
37
37
  writable: true
38
38
  },
39
39
  name: {
40
40
  enumerable: true,
41
- value: undefined,
41
+ value: void 0,
42
42
  writable: true
43
43
  },
44
44
  stack: {
45
45
  enumerable: true,
46
- value: undefined,
46
+ value: void 0,
47
47
  writable: true
48
48
  }
49
49
  }
@@ -128,7 +128,7 @@ const _serialize = /* @__PURE__ */ __name((error, options, seen, depth) => {
128
128
  protoError.cause = _serialize(error.cause, options, seen, depth);
129
129
  }
130
130
  for (const key in error) {
131
- if (protoError[key] === undefined) {
131
+ if (protoError[key] === void 0) {
132
132
  const value = error[key];
133
133
  protoError[key] = serializeValue(value, seen, depth, options);
134
134
  }
@@ -14,32 +14,32 @@ const ErrorProto = Object.create(
14
14
  {
15
15
  cause: {
16
16
  enumerable: true,
17
- value: undefined,
17
+ value: void 0,
18
18
  writable: true
19
19
  },
20
20
  code: {
21
21
  enumerable: true,
22
- value: undefined,
22
+ value: void 0,
23
23
  writable: true
24
24
  },
25
25
  errors: {
26
26
  enumerable: true,
27
- value: undefined,
27
+ value: void 0,
28
28
  writable: true
29
29
  },
30
30
  message: {
31
31
  enumerable: true,
32
- value: undefined,
32
+ value: void 0,
33
33
  writable: true
34
34
  },
35
35
  name: {
36
36
  enumerable: true,
37
- value: undefined,
37
+ value: void 0,
38
38
  writable: true
39
39
  },
40
40
  stack: {
41
41
  enumerable: true,
42
- value: undefined,
42
+ value: void 0,
43
43
  writable: true
44
44
  }
45
45
  }
@@ -124,7 +124,7 @@ const _serialize = /* @__PURE__ */ __name((error, options, seen, depth) => {
124
124
  protoError.cause = _serialize(error.cause, options, seen, depth);
125
125
  }
126
126
  for (const key in error) {
127
- if (protoError[key] === undefined) {
127
+ if (protoError[key] === void 0) {
128
128
  const value = error[key];
129
129
  protoError[key] = serializeValue(value, seen, depth, options);
130
130
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
4
 
5
- const parseStacktrace = require('../packem_shared/parseStacktrace-CPbfvO-n.cjs');
5
+ const parseStacktrace = require('../packem_shared/parseStacktrace-6pFoXW43.cjs');
6
6
 
7
7
 
8
8
 
@@ -1 +1 @@
1
- export { default as parseStacktrace } from '../packem_shared/parseStacktrace-B-BUrkkI.mjs';
1
+ export { default as parseStacktrace } from '../packem_shared/parseStacktrace-BKGoWCwC.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/error",
3
- "version": "4.4.15",
3
+ "version": "4.4.17",
4
4
  "description": "Error with more than just a message, stacktrace parsing.",
5
5
  "keywords": [
6
6
  "anolilab",