Skip to content

Commit

Permalink
Refactor resolve path function
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Jan 12, 2025
1 parent 04840ec commit 9788e10
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/helpers/resolvePath.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { join } from 'node:path';

export const resolvePath = (path: string): string => {
return join(__dirname, '..', '..', path);
/**
* Resolves a sequence of path segments into an absolute path.
*
* @param paths - A list of path segments to be joined and resolved relative to the module's root directory.
* @returns The resolved absolute path as a string.
*/
export const resolvePath = (...paths: string[]): string => {
return join(__dirname, '..', '..', ...paths);
};

0 comments on commit 9788e10

Please sign in to comment.