(self: Instruction)
| 594 | } |
| 595 | |
| 596 | const 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 | |
| 621 | const getMaxSizeInternal = (self: Instruction): number => { |
| 622 | switch (self._tag) { |
no outgoing calls
no test coverage detected