( a: A, b: B, _c: B, )
| 652 | } |
| 653 | |
| 654 | export function clampOutputType<A extends ValueTypes, B extends ValueTypes>( |
| 655 | a: A, |
| 656 | b: B, |
| 657 | _c: B, |
| 658 | ): ClampOutput<A, B> { |
| 659 | if (b === "float") { |
| 660 | if (isFloatType(a)) return a as ClampOutput<A, B>; |
| 661 | } else if (b === "int") { |
| 662 | if (isIntType(a)) return a as ClampOutput<A, B>; |
| 663 | } else if (b === "uint") { |
| 664 | if (isUintType(a)) return a as ClampOutput<A, B>; |
| 665 | } |
| 666 | throw new Error(`Invalid clamp types: ${a}, ${b}`); |
| 667 | } |
| 668 | |
| 669 | export function mixOutputType< |
| 670 | A extends FloatTypes, |
nothing calls this directly
no test coverage detected