todo
import { todo } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn.ts";A function that can be called to output any type. It's used for type hole based programming. This allows one to define interfaces and types for a function and stub them with todo() until you are ready to implement the actual behavior. The todo function will throw if it is ever actually called.
@example
import { todo } from "./fn.ts";
type InOut = {
read: () => Promise<string>,
write: (s: string) => Promise<unknown>,
}
try {
const mockInOut: InOut = todo(); // InOut !!THROWS!!
} catch (e) {
// todo() throws so this block would run
}
function todo<T>(): T;