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

Function findCommandObjectSource

scripts/generate_slash_command_appendix.mjs:518–530  ·  view source on GitHub ↗
({ source, symbol, importKind, entryExpr, isInline })

Source from the content-addressed store, hash-verified

516}
517
518function findCommandObjectSource({ source, symbol, importKind, entryExpr, isInline }) {
519 if (isInline) return findInlineCommandObjectSource(source, symbol)
520
521 if (importKind === 'named') {
522 return findInlineCommandObjectSource(source, symbol)
523 }
524
525 if (entryExpr.endsWith('()')) {
526 return findDefaultExportObjectSource(source)
527 }
528
529 return findDefaultExportObjectSource(source) ?? findInlineCommandObjectSource(source, symbol)
530}
531
532function findIfBlocks(source) {
533 const blocks = []

Calls 2

Tested by

no test coverage detected