We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bf3c84 commit 86f666aCopy full SHA for 86f666a
error_object.ts
@@ -1,15 +1,21 @@
1
-import { is, PredicateType } from "@core/unknownutil";
+import { is, type Predicate } from "@core/unknownutil";
2
3
-export const isErrorObject = is.ObjectOf({
+export type ErrorObject = {
4
+ proto: string;
5
+ name: string;
6
+ message: string;
7
+ stack?: string;
8
+ attributes: Record<string, unknown>;
9
+};
10
+
11
+export const isErrorObject: Predicate<ErrorObject> = is.ObjectOf({
12
proto: is.String,
13
name: is.String,
14
message: is.String,
15
stack: is.OptionalOf(is.String),
16
attributes: is.Record,
17
});
18
-export type ErrorObject = PredicateType<typeof isErrorObject>;
-
19
/**
20
* Convert an error to an error object
21
*/
0 commit comments