From e5dbb111ba6684c469657138de1212af65f7252f Mon Sep 17 00:00:00 2001 From: CondorHero Date: Tue, 9 May 2023 12:48:37 +0800 Subject: [PATCH] fix: getAbsFileName & getDirname Missing first parameter --- src/utils/getAbsFileName.ts | 4 ++-- src/utils/getDirname.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/getAbsFileName.ts b/src/utils/getAbsFileName.ts index a9cad56..22560fa 100644 --- a/src/utils/getAbsFileName.ts +++ b/src/utils/getAbsFileName.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from "node:url"; -export function getAbsFileName() { - return fileURLToPath(import.meta.url); +export function getAbsFileName(metaURL: string) { + return fileURLToPath(metaURL); } diff --git a/src/utils/getDirname.ts b/src/utils/getDirname.ts index 937d6ed..8e834b7 100644 --- a/src/utils/getDirname.ts +++ b/src/utils/getDirname.ts @@ -1,6 +1,6 @@ import { dirname } from "node:path"; import { getAbsFileName } from "./getAbsFileName"; -export function getDirname() { - return dirname(getAbsFileName()); +export function getDirname(metaURL: string) { + return dirname(getAbsFileName(metaURL)); }