Code coverage report for core/src/util/supplier.ts

Statements: 50% (2 / 4)      Branches: 0% (0 / 2)      Functions: 0% (0 / 2)      Lines: 66.67% (2 / 3)      Ignored: none     

All files » core/src/util/ » supplier.ts
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();
}