Preview:```ts
type HandlerWithCtx<T extends Opts> = (
foo: string,
ctx: T["test"] extends true ? 1 : 0
) => Promise<void>
type Opts = {
test?: boolean
}
const wrap = <T extends Opts>(
cb: HandlerWithCtx<T>,
options: T
) => {
if (options?.test) {
return (foo: string) => cb(foo,
...```
You can choose specific lines to embed by selecting them before copying the link.