MCPcopy Index your code
hub / github.com/Effect-TS/effect / loop

Function loop

packages/cli/src/internal/commandDescriptor.ts:452–472  ·  view source on GitHub ↗
(
    self: Instruction,
    isSubcommand: boolean
  )

Source from the content-addressed store, hash-verified

450 self: Instruction
451): Array<[string, GetUserInput | Standard]> => {
452 const loop = (
453 self: Instruction,
454 isSubcommand: boolean
455 ): Array<[string, GetUserInput | Standard]> => {
456 switch (self._tag) {
457 case "Standard":
458 case "GetUserInput": {
459 return Arr.of([self.name, self])
460 }
461 case "Map": {
462 return loop(self.command, isSubcommand)
463 }
464 case "Subcommands": {
465 // Ensure that we only traverse the subcommands one level deep from the
466 // parent command
467 return isSubcommand
468 ? loop(self.parent, false)
469 : Arr.flatMap(self.children, (child) => loop(child, true))
470 }
471 }
472 }
473 return loop(self, false)
474}
475

Callers 4

getSubcommandsInternalFunction · 0.70
parseChildrenWithFunction · 0.70
wizardInternalFunction · 0.70
traverseCommandFunction · 0.70

Calls 15

isStandardFunction · 0.85
getSubcommandsInternalFunction · 0.85
getNamesInternalFunction · 0.85
parseInternalFunction · 0.70
pipeFunction · 0.70
makeChoiceFunction · 0.70
ofMethod · 0.65
pipeMethod · 0.65
nextMethod · 0.65
failMethod · 0.65
getMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…