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