(fn: () => Promise<T>)
| 406 | } |
| 407 | |
| 408 | async function addShortCircuitFlag<T>(fn: () => Promise<T>) { |
| 409 | const ret = await fn(); |
| 410 | // Not sure if this is necessary; being lazy. Can revisit in the future. |
| 411 | if (ret == null) return ret; |
| 412 | return { |
| 413 | ...ret, |
| 414 | shortCircuit: true, |
| 415 | }; |
| 416 | } |