@matter/general
Advanced tools
Comparing version
@@ -14,3 +14,3 @@ /** | ||
* | ||
* Matter encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* matter.js encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* subfields. You can use this function to ensure all error details are presented regardless of environment. | ||
@@ -85,6 +85,2 @@ */ | ||
constructor(causes: Iterable<unknown>, message?: string); | ||
[inspect]: (depth: number, inspectionOptions?: { | ||
colors?: boolean; | ||
}) => unknown; | ||
format: (format?: "plain" | "ansi" | "html", indents?: number) => string; | ||
static [Symbol.hasInstance](instance: unknown): boolean; | ||
@@ -91,0 +87,0 @@ } |
@@ -43,3 +43,3 @@ "use strict"; | ||
* | ||
* Matter encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* matter.js encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* subfields. You can use this function to ensure all error details are presented regardless of environment. | ||
@@ -136,5 +136,5 @@ */ | ||
super(causes, message); | ||
Object.defineProperty(MatterAggregateError.prototype, inspect, { enumerable: false }); | ||
Object.defineProperty(MatterAggregateError.prototype, "format", { enumerable: false }); | ||
} | ||
[inspect] = MatterError.prototype[inspect]; | ||
format = MatterError.prototype.format; | ||
// TODO - see comment on MatterError. If that one is correct this is incorrect | ||
@@ -148,2 +148,6 @@ static [Symbol.hasInstance](instance) { | ||
} | ||
Object.assign(MatterAggregateError, { | ||
[inspect]: MatterError.prototype[inspect], | ||
format: MatterError.prototype.format | ||
}); | ||
function fallbackFormatter(value, indents = 0) { | ||
@@ -150,0 +154,0 @@ if (value === void 0 || value === null) { |
@@ -14,3 +14,3 @@ /** | ||
* | ||
* Matter encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* matter.js encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* subfields. You can use this function to ensure all error details are presented regardless of environment. | ||
@@ -85,6 +85,2 @@ */ | ||
constructor(causes: Iterable<unknown>, message?: string); | ||
[inspect]: (depth: number, inspectionOptions?: { | ||
colors?: boolean; | ||
}) => unknown; | ||
format: (format?: "plain" | "ansi" | "html", indents?: number) => string; | ||
static [Symbol.hasInstance](instance: unknown): boolean; | ||
@@ -91,0 +87,0 @@ } |
@@ -12,3 +12,3 @@ /** | ||
* | ||
* Matter encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* matter.js encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* subfields. You can use this function to ensure all error details are presented regardless of environment. | ||
@@ -105,5 +105,5 @@ */ | ||
super(causes, message); | ||
Object.defineProperty(MatterAggregateError.prototype, inspect, { enumerable: false }); | ||
Object.defineProperty(MatterAggregateError.prototype, "format", { enumerable: false }); | ||
} | ||
[inspect] = MatterError.prototype[inspect]; | ||
format = MatterError.prototype.format; | ||
// TODO - see comment on MatterError. If that one is correct this is incorrect | ||
@@ -117,2 +117,6 @@ static [Symbol.hasInstance](instance) { | ||
} | ||
Object.assign(MatterAggregateError, { | ||
[inspect]: MatterError.prototype[inspect], | ||
format: MatterError.prototype.format | ||
}); | ||
function fallbackFormatter(value, indents = 0) { | ||
@@ -119,0 +123,0 @@ if (value === void 0 || value === null) { |
{ | ||
"name": "@matter/general", | ||
"version": "0.12.0-alpha.0-20241225-902d76201", | ||
"version": "0.12.0-alpha.0-20241226-0f5b0fe87", | ||
"description": "Non-Matter support for Matter.js", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@matter/testing": "0.12.0-alpha.0-20241225-902d76201" | ||
"@matter/testing": "0.12.0-alpha.0-20241226-0f5b0fe87" | ||
}, | ||
@@ -42,0 +42,0 @@ "files": [ |
@@ -18,3 +18,3 @@ /** | ||
* | ||
* Matter encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* matter.js encodes errors with modern JS features including {@link Error#cause} and {@link AggregateError#errors} | ||
* subfields. You can use this function to ensure all error details are presented regardless of environment. | ||
@@ -146,7 +146,7 @@ */ | ||
super(causes, message); | ||
Object.defineProperty(MatterAggregateError.prototype, inspect, { enumerable: false }); | ||
Object.defineProperty(MatterAggregateError.prototype, "format", { enumerable: false }); | ||
} | ||
[inspect] = MatterError.prototype[inspect]; | ||
format = MatterError.prototype.format; | ||
// TODO - see comment on MatterError. If that one is correct this is incorrect | ||
@@ -161,2 +161,7 @@ static override [Symbol.hasInstance](instance: unknown) { | ||
Object.assign(MatterAggregateError, { | ||
[inspect]: MatterError.prototype[inspect], | ||
format: MatterError.prototype.format, | ||
}); | ||
/** | ||
@@ -163,0 +168,0 @@ * It's never reasonable to fail to present error information so we include this rudimentary fallback error formatter. |
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
1604130
0.02%32438
0.01%