UNPKG

494 BTypeScriptView Raw
1import { BasePredicate } from '.';
2import { Predicates } from './predicates';
3declare type Optionalify<P> = P extends BasePredicate<infer X> ? P & BasePredicate<X | undefined> : P;
4export interface Modifiers {
5 /**
6 Make the following predicate optional so it doesn't fail when the value is `undefined`.
7 */
8 readonly optional: {
9 [K in keyof Predicates]: Optionalify<Predicates[K]>;
10 };
11}
12declare const _default: <T>(object: T) => T & Modifiers;
13export default _default;