diff --git a/packages/gatsby/src/query/__tests__/__snapshots__/utils.js.snap b/packages/gatsby/src/query/__tests__/__snapshots__/utils.ts.snap similarity index 100% rename from packages/gatsby/src/query/__tests__/__snapshots__/utils.js.snap rename to packages/gatsby/src/query/__tests__/__snapshots__/utils.ts.snap diff --git a/packages/gatsby/src/query/__tests__/utils.js b/packages/gatsby/src/query/__tests__/utils.ts similarity index 100% rename from packages/gatsby/src/query/__tests__/utils.js rename to packages/gatsby/src/query/__tests__/utils.ts diff --git a/packages/gatsby/src/query/utils.js b/packages/gatsby/src/query/utils.js deleted file mode 100644 index 71013bb11fd3a..0000000000000 --- a/packages/gatsby/src/query/utils.js +++ /dev/null @@ -1,13 +0,0 @@ -// @flow - -const indentString = (string: string): string => string.replace(/\n/g, `\n `) - -const formatErrorDetails = (errorDetails: Map): string => - Array.from(errorDetails.entries()) - .map( - ([name, details]) => `${name}: - ${indentString(details.toString())}` - ) - .join(`\n`) - -export { indentString, formatErrorDetails } diff --git a/packages/gatsby/src/query/utils.ts b/packages/gatsby/src/query/utils.ts new file mode 100644 index 0000000000000..fea157b624a84 --- /dev/null +++ b/packages/gatsby/src/query/utils.ts @@ -0,0 +1,10 @@ +export const indentString = (string: string): string => + string.replace(/\n/g, `\n `) + +export const formatErrorDetails = (errorDetails: Map): string => + Array.from(errorDetails.entries()) + .map( + ([name, details]) => `${name}: + ${indentString(details.toString())}` + ) + .join(`\n`)