MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / packageDirForFile

Function packageDirForFile

packages/node-sdk/scripts/build-dts.mjs:143–152  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

141}
142
143function packageDirForFile(file) {
144 const parts = path.relative(dtsRoot, file).split(path.sep);
145 const [packageDir, firstDir] = parts;
146
147 if (packageDir === undefined || firstDir !== 'src' || !packageDirs.has(packageDir)) {
148 return undefined;
149 }
150
151 return packageDir;
152}
153
154function resolveSpecifier({ currentFile, emittedFiles, packageDir, specifier }) {
155 if (specifier.startsWith('#/')) {

Callers 1

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected