diff --git a/packages/core/src/utils/helper.ts b/packages/core/src/utils/helper.ts index 3a2134af..10e959e0 100644 --- a/packages/core/src/utils/helper.ts +++ b/packages/core/src/utils/helper.ts @@ -123,8 +123,11 @@ export const readPackageJson = (rootPath: string): undefined | PkgJson => { } }; +export function getAbsolutePath(base: string, filepath: string): string { + return path.isAbsolute(filepath) ? filepath : path.join(base, filepath); +} + export const isObject = (obj: unknown): obj is Record => Object.prototype.toString.call(obj) === '[object Object]'; export { color, calcLongestCommonPath }; -export * from './helpers'; diff --git a/packages/core/src/utils/helpers/index.ts b/packages/core/src/utils/helpers/index.ts deleted file mode 100644 index 44bb0aa0..00000000 --- a/packages/core/src/utils/helpers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './path'; diff --git a/packages/core/src/utils/helpers/path.ts b/packages/core/src/utils/helpers/path.ts deleted file mode 100644 index 6bb4cff1..00000000 --- a/packages/core/src/utils/helpers/path.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { isAbsolute, join } from 'node:path'; - -export function getAbsolutePath(base: string, filepath: string): string { - return isAbsolute(filepath) ? filepath : join(base, filepath); -}