MCPcopy
hub / github.com/freshframework/fresh / pathWithRoot

Function pathWithRoot

packages/plugin-vite/src/utils.ts:8–18  ·  view source on GitHub ↗
(fileOrDir: string, root?: string)

Source from the content-addressed store, hash-verified

6export const JSX_REG = /\.[tj]sx(\?.*)?$/;
7
8export function pathWithRoot(fileOrDir: string, root?: string): string {
9 if (path.isAbsolute(fileOrDir)) return fileOrDir;
10
11 if (root === undefined) {
12 return path.join(Deno.cwd(), fileOrDir);
13 }
14
15 if (path.isAbsolute(root)) return path.join(root, fileOrDir);
16
17 return path.join(Deno.cwd(), root, fileOrDir);
18}
19
20export interface FreshState {
21 namer: UniqueNamer;

Callers 9

configResolvedFunction · 0.90
configFunction · 0.90
configResolvedFunction · 0.90
configResolvedFunction · 0.90
configFunction · 0.90
configResolvedFunction · 0.90
configResolvedFunction · 0.90
configResolvedFunction · 0.90
configResolvedFunction · 0.90

Calls 1

cwdMethod · 0.80

Tested by

no test coverage detected