-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pretty-print-error to print errors in console
- Loading branch information
Showing
5 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,5 +45,10 @@ | |
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=22.11.0" | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"pretty-print-error": "patches/pretty-print-error.patch" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/src/index.ts b/src/index.ts | ||
index c8f62a743b89040c1d10a8ae3795bec8afcbc134..7cd7c1e98c1c9516b40f678627f51fd1adfa18c7 100644 | ||
--- a/src/index.ts | ||
+++ b/src/index.ts | ||
@@ -109,9 +109,9 @@ export function formatError( | ||
(name) => name !== "stack" && name !== "message" | ||
); | ||
if (propNames.length > 0) { | ||
- const props = {}; | ||
+ const props: Record<string, unknown> = {}; | ||
propNames.forEach((name) => { | ||
- props[name] = err[name]; | ||
+ props[name] = (err as Record<string, object>)[name]; | ||
}); | ||
|
||
let propertiesString; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.