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

Function parseRelativeRequires

scripts/generate_slash_command_appendix.mjs:399–412  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

397}
398
399function parseRelativeRequires(source) {
400 const map = new Map()
401 for (const match of source.matchAll(/const\s+\{([^}]+)\}\s*=\s*require\('(\.[^']+)'\)/gm)) {
402 const names = match[1]
403 .split(',')
404 .map(s => s.trim())
405 .filter(Boolean)
406 .map(s => s.split(/\s+as\s+/)[0].trim())
407 for (const name of names) {
408 map.set(name, match[2])
409 }
410 }
411 return map
412}
413
414function parseConditionalRequires(source) {
415 const map = new Map()

Callers 1

collectBundledSkillRowsFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected