MCPcopy Index your code
hub / github.com/code-pushup/cli / computeRelativePresetImport

Function computeRelativePresetImport

packages/create-cli/src/lib/setup/codegen.ts:87–94  ·  view source on GitHub ↗
(
  projectRelativeDir: string,
  presetFilename: string,
)

Source from the content-addressed store, hash-verified

85}
86
87export function computeRelativePresetImport(
88 projectRelativeDir: string,
89 presetFilename: string,
90): string {
91 const relativePath = path.relative(projectRelativeDir, presetFilename);
92 const importPath = toUnixPath(relativePath).replace(/\.ts$/, '.js');
93 return importPath.startsWith('.') ? importPath : `./${importPath}`;
94}
95
96function formatImport({
97 moduleSpecifier,

Callers 2

writeMonorepoConfigsFunction · 0.85

Calls 1

toUnixPathFunction · 0.90

Tested by

no test coverage detected