Skip to content

Commit

Permalink
chore(gatsby): Convert query/utils to typescript (#22171)
Browse files Browse the repository at this point in the history
* chore(gatsby): Convert query/utils to typescript

* update snapshot test
  • Loading branch information
kawamataryo authored Mar 12, 2020
1 parent 9de6d62 commit 099b4a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
13 changes: 0 additions & 13 deletions packages/gatsby/src/query/utils.js

This file was deleted.

10 changes: 10 additions & 0 deletions packages/gatsby/src/query/utils.ts
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`)

0 comments on commit 099b4a0

Please sign in to comment.