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

Function findDtsFiles

packages/node-sdk/scripts/build-dts.mjs:128–141  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

126}
127
128async function findDtsFiles(dir) {
129 const entries = await readdir(dir, { withFileTypes: true });
130 const files = await Promise.all(
131 entries.map(async (entry) => {
132 const entryPath = path.join(dir, entry.name);
133 if (entry.isDirectory()) {
134 return findDtsFiles(entryPath);
135 }
136 return entry.name.endsWith('.d.ts') ? [entryPath] : [];
137 }),
138 );
139
140 return files.flat();
141}
142
143function packageDirForFile(file) {
144 const parts = path.relative(dtsRoot, file).split(path.sep);

Callers 1

Calls 1

readdirFunction · 0.50

Tested by

no test coverage detected