MCPcopy Index your code
hub / github.com/lingodotdev/lingo.dev / getDictionaryPath

Function getDictionaryPath

packages/compiler/src/_utils.ts:10–22  ·  view source on GitHub ↗
(params: GetDictionaryPathParams)

Source from the content-addressed store, hash-verified

8 relativeFilePath: string;
9};
10export const getDictionaryPath = (params: GetDictionaryPathParams) => {
11 const toFile = path.resolve(
12 params.sourceRoot,
13 params.lingoDir,
14 LCP_DICTIONARY_FILE_NAME,
15 );
16 const fromDir = path.dirname(
17 path.resolve(params.sourceRoot, params.relativeFilePath),
18 );
19 const relativePath = path.relative(fromDir, toFile);
20 const normalizedPath = relativePath.split(path.sep).join(path.posix.sep);
21 return `./${normalizedPath}`;
22};

Calls

no outgoing calls

Tested by

no test coverage detected