MCPcopy Create free account
hub / github.com/backnotprop/plannotator / resolveUserPath

Function resolveUserPath

packages/shared/resolve-file.ts:133–145  ·  view source on GitHub ↗
(
	input: string,
	baseDir = process.cwd(),
	platform = process.platform,
)

Source from the content-addressed store, hash-verified

131}
132
133export function resolveUserPath(
134 input: string,
135 baseDir = process.cwd(),
136 platform = process.platform,
137): string {
138 const normalizedInput = normalizeUserPathInput(input, platform);
139 if (!normalizedInput) {
140 return "";
141 }
142 return isAbsoluteNormalizedUserPath(normalizedInput, platform)
143 ? resolveAbsolutePath(normalizedInput, platform)
144 : resolve(baseDir, normalizedInput);
145}
146
147function normalizeComparablePath(input: string): string {
148 return stripTrailingSlashes(normalizeSeparators(resolveUserPath(input)));

Callers 15

getPlanDirFunction · 0.90
resolveFolderSourceFileFunction · 0.90
saveSourceFileAtomicFunction · 0.90
addRootFunction · 0.90
getAllowedRootPathsFunction · 0.90
getTrustedBaseDirFunction · 0.90
handleDocFunction · 0.90

Calls 4

normalizeUserPathInputFunction · 0.85
resolveAbsolutePathFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected