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

Function getMinSizeInternal

packages/cli/src/internal/args.ts:596–619  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

594}
595
596const getMinSizeInternal = (self: Instruction): number => {
597 switch (self._tag) {
598 case "Empty":
599 case "WithDefault":
600 case "WithFallbackConfig": {
601 return 0
602 }
603 case "Single": {
604 return 1
605 }
606 case "Map": {
607 return getMinSizeInternal(self.args as Instruction)
608 }
609 case "Both": {
610 const leftMinSize = getMinSizeInternal(self.left as Instruction)
611 const rightMinSize = getMinSizeInternal(self.right as Instruction)
612 return leftMinSize + rightMinSize
613 }
614 case "Variadic": {
615 const argsMinSize = getMinSizeInternal(self.args as Instruction)
616 return Math.floor(Option.getOrElse(self.min, () => 0) * argsMinSize)
617 }
618 }
619}
620
621const getMaxSizeInternal = (self: Instruction): number => {
622 switch (self._tag) {

Callers 3

getMinSizeFunction · 0.70
getHelpInternalFunction · 0.70
wizardInternalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected