-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gatsby): Convert query/utils to typescript (#22171)
* chore(gatsby): Convert query/utils to typescript * update snapshot test
- Loading branch information
1 parent
9de6d62
commit 099b4a0
Showing
4 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
export const indentString = (string: string): string => | ||
string.replace(/\n/g, `\n `) | ||
|
||
export const formatErrorDetails = (errorDetails: Map<string, any>): string => | ||
Array.from(errorDetails.entries()) | ||
.map( | ||
([name, details]) => `${name}: | ||
${indentString(details.toString())}` | ||
) | ||
.join(`\n`) |