UNPKG

@trademe/ensure

Version:

7 lines (6 loc) 287 B
import { GuardConfig } from './guard-config'; export declare type GuardFunction<T> = (value: any, key: string) => T; export declare type Guard<T> = { isGetter: boolean; } & GuardFunction<T>; export declare function ensure<T>(guard: GuardFunction<T>, config?: GuardConfig): Guard<T>;