UNPKG

@sakuli/commons

Version:

7 lines 498 B
export declare type Maybe<T> = T | null | undefined; export declare function isPresent<T>(maybe: Maybe<T>): maybe is T; export declare function ifPresent<T>(maybe: Maybe<T>, then: (v: T) => void): void; export declare function ifPresent<T, R = void>(maybe: Maybe<T>, then: (v: T) => R, otherwise: () => R): R; export declare function ensure<T>(maybe: Maybe<T>, fallback: T): T; export declare function throwIfAbsent<T>(maybe: Maybe<T>, error?: Error): T | never; //# sourceMappingURL=maybe.d.ts.map