From 33660b9f8c54ad3733505690d6e8c3a727e7970b Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 24 Aug 2023 22:28:25 +0000 Subject: [PATCH] fix linting --- src/utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils.js b/src/utils.js index 88c9c7d..b59b74e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,6 @@ import { createHash } from "crypto"; -import path from 'path'; -import url from 'url'; +import path from "path"; +import url from "url"; import * as fs from "fs"; import { getUsedResources, requestPVE } from "./pve.js"; @@ -129,18 +129,18 @@ export function getTimeLeft (timeout) { */ export function recursiveImport (router, baseroute, target, from = import.meta.url) { const thisPath = path.dirname(url.fileURLToPath(import.meta.url)); - const fromPath = path.relative(".", path.dirname(url.fileURLToPath(from))); + const fromPath = path.relative(".", path.dirname(url.fileURLToPath(from))); const targetPath = path.relative(".", `${fromPath}/${target}`); const importPath = path.relative(thisPath, targetPath); const files = fs.readdirSync(targetPath); files.forEach((file) => { if (file.endsWith(".js")) { const path = `./${importPath}/${file}`; - const route = `${baseroute}/${file.replace(".js", "")}` + const route = `${baseroute}/${file.replace(".js", "")}`; import(path).then((module) => { router.use(route, module.router); }); console.log(`routes: loaded ${path} as ${route}`); } }); -} \ No newline at end of file +}