(condition: any, a: A, b?: B)
| 75 | } |
| 76 | |
| 77 | export function iifunc< |
| 78 | A extends (...args: any) => any, |
| 79 | B extends (...args: any) => any = () => undefined, |
| 80 | >(condition: any, a: A, b?: B): ReturnType<A> | ReturnType<B> { |
| 81 | return condition ? a() : b?.(); |
| 82 | } |