MCPcopy Index your code
hub / github.com/upstash/context7 / resolveReadPathSync

Function resolveReadPathSync

packages/cli/src/utils/storage-paths.ts:100–107  ·  view source on GitHub ↗
(fileName: string, targetPath: string, mode?: number)

Source from the content-addressed store, hash-verified

98 * still exists. New writes should always target `targetPath`.
99 */
100export function resolveReadPathSync(fileName: string, targetPath: string, mode?: number): string {
101 migrateLegacyFileSync(fileName, targetPath, mode);
102 if (fs.existsSync(targetPath)) {
103 return targetPath;
104 }
105 const legacyPath = getLegacyFilePath(fileName);
106 return fs.existsSync(legacyPath) ? legacyPath : targetPath;
107}
108
109export async function resolveReadPath(
110 fileName: string,

Callers 1

loadTokensFunction · 0.85

Calls 2

migrateLegacyFileSyncFunction · 0.85
getLegacyFilePathFunction · 0.85

Tested by

no test coverage detected