js-contracts
Version:
C# inspired Code Contracts
12 lines (11 loc) • 447 B
TypeScript
import Log from './log';
import ContractFailedError from './contract-error';
export declare type ContractCondition = (...args: any[]) => boolean;
export declare type ContractPredicate<T> = (element: T) => boolean;
export declare type ContractSettings = {
shouldFailOnCondition: boolean;
shouldSkipContractChecks: boolean;
shouldLogError: boolean;
defaultLogger: typeof Log;
defaultContractError: typeof ContractFailedError;
};