Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f71fea1

Browse files
authored
chore(gatsby): Convert utils/worker/page-data to typescript (gatsbyjs#22155)
1 parent cb26f59 commit f71fea1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Note: this doesn't check for conflicts between module exports
2+
import { getFilePath } from "./page-data"
3+
24
module.exports = {
3-
...require(`./page-data`),
5+
getFilePath,
46
...require(`./render-html`),
57
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
const path = require(`path`)
1+
import path from "path"
22

3-
const getFilePath = ({ publicDir }, pagePath) => {
3+
export const getFilePath = (
4+
{ publicDir }: { publicDir: string },
5+
pagePath: string
6+
): string => {
47
const fixedPagePath = pagePath === `/` ? `index` : pagePath
58
return path.join(publicDir, `page-data`, fixedPagePath, `page-data.json`)
69
}
7-
8-
module.exports = {
9-
getFilePath,
10-
}

0 commit comments

Comments
 (0)