MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseRelativeImports

Function parseRelativeImports

scripts/generate_slash_command_appendix.mjs:384–397  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

382}
383
384function parseRelativeImports(source) {
385 const map = new Map()
386 for (const match of source.matchAll(/^import\s+\{([^}]+)\}\s+from\s+'(\.[^']+)'/gm)) {
387 const names = match[1]
388 .split(',')
389 .map(s => s.trim())
390 .filter(Boolean)
391 .map(s => s.split(/\s+as\s+/)[0].trim())
392 for (const name of names) {
393 map.set(name, match[2])
394 }
395 }
396 return map
397}
398
399function parseRelativeRequires(source) {
400 const map = new Map()

Callers 1

collectBundledSkillRowsFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected