MCPcopy Create free account
hub / github.com/Snapchat/Valdi / resolveFilePath

Function resolveFilePath

npm_modules/cli/src/utils/fileUtils.ts:59–65  ·  view source on GitHub ↗
(pathString: string)

Source from the content-addressed store, hash-verified

57}
58
59export function resolveFilePath(pathString: string): string {
60 if (pathString.startsWith('~')) {
61 const tildeResolvedPath = path.join(os.homedir(), pathString.slice(1));
62 return path.resolve(tildeResolvedPath);
63 }
64 return path.resolve(pathString);
65}
66
67export function fileExists(filePath: string): boolean {
68 return fs.existsSync(filePath);

Callers 6

initializeConfigFilesFunction · 0.90
getUserConfigFunction · 0.85
getAllFilePathsFunction · 0.85
isDirectoryEmptyFunction · 0.85
isPathAllowedFunction · 0.85

Calls 3

startsWithMethod · 0.80
resolveMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected