| 1 2 3 4 5 6 7 8 9 10 11 | 1 1 |
export interface Supplier<T> {
(): T;
}
export const SUPPLY_UNDEFINED: Supplier<undefined> = () => undefined;
export function orUseSupplier<T>(item: T | undefined, supplier: Supplier<T>): T {
return item || supplier();
}
|