Const
Function
Asserts that ALL values in a Map, Set, or Array individually satisfy the expected shape.
Uses partial/satisfy semantics — every value must match. Empty collections pass vacuously.
For Map, values (not keys) are checked. Use mapKeysSatisfyAssertion to assert on Map keys instead.
Map
mapKeysSatisfyAssertion
expect([{ a: 1 }, { a: 2, b: 3 }], 'to have values satisfying', { a: z.number(),}); // passesexpect(new Set([1, 2, 3]), 'to have values satisfying', z.number()); // passesexpect(new Map([['k', { x: 1 }]]), 'to have values satisfying', { x: z.number(),}); // passes Copy
expect([{ a: 1 }, { a: 2, b: 3 }], 'to have values satisfying', { a: z.number(),}); // passesexpect(new Set([1, 2, 3]), 'to have values satisfying', z.number()); // passesexpect(new Map([['k', { x: 1 }]]), 'to have values satisfying', { x: z.number(),}); // passes
collection-to-have-values-satisfying-any
collections
Asserts that ALL values in a Map, Set, or Array individually satisfy the expected shape.
Uses partial/satisfy semantics — every value must match. Empty collections pass vacuously.