mapHasKeySatisfyingAssertion:AssertionFunctionSync< readonly[ ZodCustom<Map<unknown,unknown>,Map<unknown,unknown>>, readonly[ "to have a key satisfying", "to have key satisfying", "to have a prop satisfying", "to have prop satisfying", "to have a property satisfying", "to have property satisfying", "to have a field satisfying", "to have field satisfying", ], ZodUnknown, ], ( subject:Map<unknown,unknown>, expected:unknown, )=>{message:string}|undefined, readonly[ ZodCustom<Map<unknown,unknown>,Map<unknown,unknown>>, PhraseLiteralChoiceSlot< readonly[ "to have a key satisfying", "to have key satisfying", "to have a prop satisfying", "to have prop satisfying", "to have a property satisfying", "to have property satisfying", "to have a field satisfying", "to have field satisfying", ], >, ZodUnknown, ], > = ...
Asserts that at least one key in a Map satisfies the expected shape.
Uses partial/satisfy semantics. Fails on empty Maps.
Example
constmap=newMap([ ['foo',1], [42,2], ]); expect(map,'to have a key satisfying',z.string());// passes expect(map,'to have key satisfying',z.number());// passes expect(map,'to have a prop satisfying',z.string());// alias expect(map,'to have a field satisfying',z.number());// alias
Asserts that at least one key in a Map satisfies the expected shape.
Uses partial/satisfy semantics. Fails on empty Maps.