( a: A, b: B, operation = "min", )
| 628 | } |
| 629 | |
| 630 | export function minOutputType<A extends ValueTypes, B extends ValueTypes>( |
| 631 | a: A, |
| 632 | b: B, |
| 633 | operation = "min", |
| 634 | ): MinOutput<A, B> { |
| 635 | // @ts-ignore |
| 636 | if (a === b) return a as MinOutput<A, B>; |
| 637 | if (b === "float") { |
| 638 | if (isFloatType(a)) return a as MinOutput<A, B>; |
| 639 | } else if (b === "int") { |
| 640 | if (isIntType(a)) return a as MinOutput<A, B>; |
| 641 | } else if (b === "uint") { |
| 642 | if (isUintType(a)) return a as MinOutput<A, B>; |
| 643 | } |
| 644 | throw new Error(`Invalid ${operation} types: ${a}, ${b}`); |
| 645 | } |
| 646 | |
| 647 | export function maxOutputType<A extends ValueTypes, B extends ValueTypes>( |
| 648 | a: A, |
no test coverage detected