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

Function relativeRuntimeSpecifiers

apps/kimi-code/scripts/native/assets.mjs:115–127  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

113}
114
115function relativeRuntimeSpecifiers(text) {
116 const specifiers = new Set();
117 for (const match of text.matchAll(/\brequire\(\s*["'](\.[^"']+)["']\s*\)/g)) {
118 specifiers.add(match[1]);
119 }
120 for (const match of text.matchAll(/(?<![.\w])import\(\s*["'](\.[^"']+)["']\s*\)/g)) {
121 specifiers.add(match[1]);
122 }
123 for (const match of text.matchAll(/\bfrom\s+["'](\.[^"']+)["']/g)) {
124 specifiers.add(match[1]);
125 }
126 return [...specifiers];
127}
128
129async function addRuntimeDependencyFiles(packageRoot, filePath, selected) {
130 const extension = extname(filePath);

Callers 1

Calls 1

addMethod · 0.65

Tested by

no test coverage detected