Skyline/node_modules/ow/dist/modifiers.d.ts
2021-11-22 17:39:03 +00:00

13 lines
494 B
TypeScript

import { BasePredicate } from '.';
import { Predicates } from './predicates';
declare type Optionalify<P> = P extends BasePredicate<infer X> ? P & BasePredicate<X | undefined> : P;
export interface Modifiers {
/**
Make the following predicate optional so it doesn't fail when the value is `undefined`.
*/
readonly optional: {
[K in keyof Predicates]: Optionalify<Predicates[K]>;
};
}
declare const _default: <T>(object: T) => T & Modifiers;
export default _default;