Fix typos

This commit is contained in:
Aria Minaei 2022-01-19 15:31:17 +01:00 committed by Aria
parent eff1f158bc
commit 9d2543d354
2 changed files with 11 additions and 5 deletions

View file

@ -15,7 +15,7 @@
"test": "jest",
"postinstall": "husky install",
"release": "zx scripts/release.mjs",
"build:api-docs": "zx scripts/build-api-docs.mjs /Users/andrew/Projects/theatre-docs/docs/api",
"build:api-docs": "zx scripts/build-api-docs.mjs",
"lint:all": "eslint . --ext ts,tsx --ignore-path=.gitignore --rulesdir ./devEnv/eslint/rules"
},
"lint-staged": {

View file

@ -56,7 +56,7 @@ import {parse as parseJsonC} from 'jsonc-parser'
)
/*
We replace the Pointer name with a similar-looking one so that that shitty
We replace the Pointer name with a similar-looking one so that
api-documenter generates two different pages for Pointer and pointer, instead
of overwriting one with the other.
@ -68,9 +68,15 @@ import {parse as parseJsonC} from 'jsonc-parser'
*/
const replacement = 'Pointer\u200E'
fs.writeFileSync('./.temp/api/dataverse.api.json', fs.readFileSync('./.temp/api/dataverse.api.json', {
encoding: 'utf-8',
}).replaceAll('"name": "Pointer"', `"name": "${replacement}"`).replaceAll('{@link Pointer}', `{@link ${replacement}}`))
fs.writeFileSync(
'./.temp/api/dataverse.api.json',
fs
.readFileSync('./.temp/api/dataverse.api.json', {
encoding: 'utf-8',
})
.replaceAll('"name": "Pointer"', `"name": "${replacement}"`)
.replaceAll('{@link Pointer}', `{@link ${replacement}}`),
)
await $`api-documenter markdown --input-folder ${pathToApiJsonFiles} --output-folder ${outputPath}`
})()