UNPKG

deep-assert

Version:

Better deep-equals object expectations, supporting dynamic bottom-up assertions using any() and satisfies().

18 lines (17 loc) 644 B
import { $any, $compare } from "./symbols"; export interface Options { strict?: boolean; allowAdditionalProps?: boolean; } declare type InternalComparisonFunction = (actual: any) => true | Error; declare type UserComparisonFunction = (actual: any) => boolean; interface AnyComparison { [$any]: true; } interface Comparison { [$compare]: InternalComparisonFunction; } export declare function any(): AnyComparison; export declare function satisfies(compare: UserComparisonFunction): Comparison; export declare function deepEquals(actual: any, expected: any, path: Array<string | number>, opts?: Options): true | Error; export {};