Skip to content

Commit 86f666a

Browse files
committed
👍 Fix lint
1 parent 8bf3c84 commit 86f666a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

error_object.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
import { is, PredicateType } from "@core/unknownutil";
1+
import { is, type Predicate } from "@core/unknownutil";
22

3-
export const isErrorObject = is.ObjectOf({
3+
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({
412
proto: is.String,
513
name: is.String,
614
message: is.String,
715
stack: is.OptionalOf(is.String),
816
attributes: is.Record,
917
});
1018

11-
export type ErrorObject = PredicateType<typeof isErrorObject>;
12-
1319
/**
1420
* Convert an error to an error object
1521
*/

0 commit comments

Comments
 (0)