diff --git a/post-process.ts b/post-process.ts index 68a89ce..7c69a0e 100644 --- a/post-process.ts +++ b/post-process.ts @@ -1,5 +1,5 @@ import { readFile, writeFile, copyFile, copy, remove } from "fs-extra"; -import { safeLoad } from "js-yaml"; +import { load } from "js-yaml"; import { join } from "path"; import { execSync } from "child_process"; @@ -9,7 +9,7 @@ export const postProcess = async () => { cname?: string; baseUrl?: string; }; - } = safeLoad(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any; + } = load(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any; const baseUrl = (config["status-website"] || {}).baseUrl || "/"; execSync(`sapper export --legacy --basepath ${baseUrl}`, { diff --git a/pre-process.ts b/pre-process.ts index c605ae6..ab838e7 100644 --- a/pre-process.ts +++ b/pre-process.ts @@ -1,9 +1,9 @@ import { readFile, writeJson, ensureDir } from "fs-extra"; -import { safeLoad } from "js-yaml"; +import { load } from "js-yaml"; import { join } from "path"; export const preProcess = async () => { - const i18n = safeLoad(await readFile(join(".", "i18n.yml"), "utf8")) as { + const i18n = load(await readFile(join(".", "i18n.yml"), "utf8")) as { [index: string]: string; }; @@ -19,7 +19,7 @@ export const preProcess = async () => { "status-website"?: { cname?: string; }; - } = safeLoad(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any; + } = load(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any; if (!config.owner || !config.repo) throw new Error("Owner/repo not set"); config.path = `https://${config.owner}.github.io/${config.repo}`; if (config["status-website"]?.cname) config.path = `https://${config["status-website"].cname}`; diff --git a/src/server.js b/src/server.js index 928d029..5317c09 100644 --- a/src/server.js +++ b/src/server.js @@ -3,13 +3,13 @@ import compression from "compression"; import fs from "fs-extra"; import polka from "polka"; import sirv from "sirv"; -import { safeLoad } from "js-yaml"; +import { load } from "js-yaml"; import { join } from "path"; const { PORT, NODE_ENV } = process.env; const dev = NODE_ENV === "development"; -let config = safeLoad(fs.readFileSync(join("..", ".upptimerc.yml"), "utf8")); +let config = load(fs.readFileSync(join("..", ".upptimerc.yml"), "utf8")); const baseUrl = (config["status-website"] || {}).baseUrl || "/"; polka()