import { CombinedAssertions } from './assertions/combined/CombinedAssertions'; import { getCombinedAssertions, getCombinedAssertionsForEach, getNegatedCombinedAssertions, getNegatedCombinedAssertionsForEach } from './assertions/combined/assertions'; type AssertThat = ((value: TValue) => ({ is: CombinedAssertions & { not: CombinedAssertions; }; })) & { eachElementOf: (value: TValue) => TValue extends Set ? { is: CombinedAssertions & { not: CombinedAssertions; }; } : TValue extends Map ? { is: CombinedAssertions & { not: CombinedAssertions; }; } : TValue extends (infer TContent)[] ? { is: CombinedAssertions & { not: CombinedAssertions; }; } : never; }; // eslint-disable-next-line consistent-this const that: AssertThat = function (actual: any): any { return { is: { ...getCombinedAssertions(actual), not: { ...getNegatedCombinedAssertions(actual) } } }; }; that.eachElementOf = (actualCollection: any): any => ({ is: { ...getCombinedAssertionsForEach(actualCollection), not: { ...getNegatedCombinedAssertionsForEach(actualCollection) } } }); const assert = { that }; export { assert };