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

Function findCallObjectSource

scripts/generate_slash_command_appendix.mjs:470–477  ·  view source on GitHub ↗
(source, calleeName)

Source from the content-addressed store, hash-verified

468}
469
470function findCallObjectSource(source, calleeName) {
471 const regex = new RegExp(`\\b${calleeName}\\s*\\(`, 'm')
472 const match = regex.exec(source)
473 if (!match) return null
474 const braceStart = source.indexOf('{', match.index)
475 if (braceStart === -1) return null
476 return extractBalancedSegment(source, braceStart, '{', '}')
477}
478
479function findInlineCommandObjectSource(source, symbol) {
480 const regex = new RegExp(`(?:export\\s+)?const\\s+${symbol}\\b[\\s\\S]*?=\\s*`, 'm')

Callers 2

collectBundledSkillRowsFunction · 0.85
collectBuiltinPluginRowsFunction · 0.85

Calls 1

extractBalancedSegmentFunction · 0.85

Tested by

no test coverage detected