bupkis 0.18.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/dist/assertion/assertion-async.cjs +268 -0
- package/dist/assertion/assertion-async.cjs.map +1 -0
- package/dist/assertion/assertion-async.d.cts +40 -0
- package/dist/assertion/assertion-async.d.cts.map +1 -0
- package/dist/assertion/assertion-async.d.ts +40 -0
- package/dist/assertion/assertion-async.d.ts.map +1 -0
- package/dist/assertion/assertion-async.js +259 -0
- package/dist/assertion/assertion-async.js.map +1 -0
- package/dist/assertion/assertion-standard-schema-async.cjs +132 -0
- package/dist/assertion/assertion-standard-schema-async.cjs.map +1 -0
- package/dist/assertion/assertion-standard-schema-async.d.cts +52 -0
- package/dist/assertion/assertion-standard-schema-async.d.cts.map +1 -0
- package/dist/assertion/assertion-standard-schema-async.d.ts +52 -0
- package/dist/assertion/assertion-standard-schema-async.d.ts.map +1 -0
- package/dist/assertion/assertion-standard-schema-async.js +128 -0
- package/dist/assertion/assertion-standard-schema-async.js.map +1 -0
- package/dist/assertion/assertion-standard-schema-sync.cjs +141 -0
- package/dist/assertion/assertion-standard-schema-sync.cjs.map +1 -0
- package/dist/assertion/assertion-standard-schema-sync.d.cts +52 -0
- package/dist/assertion/assertion-standard-schema-sync.d.cts.map +1 -0
- package/dist/assertion/assertion-standard-schema-sync.d.ts +52 -0
- package/dist/assertion/assertion-standard-schema-sync.d.ts.map +1 -0
- package/dist/assertion/assertion-standard-schema-sync.js +137 -0
- package/dist/assertion/assertion-standard-schema-sync.js.map +1 -0
- package/dist/assertion/assertion-sync.cjs +281 -0
- package/dist/assertion/assertion-sync.cjs.map +1 -0
- package/dist/assertion/assertion-sync.d.cts +60 -0
- package/dist/assertion/assertion-sync.d.cts.map +1 -0
- package/dist/assertion/assertion-sync.d.ts +60 -0
- package/dist/assertion/assertion-sync.d.ts.map +1 -0
- package/dist/assertion/assertion-sync.js +275 -0
- package/dist/assertion/assertion-sync.js.map +1 -0
- package/dist/assertion/assertion-types.cjs +20 -0
- package/dist/assertion/assertion-types.cjs.map +1 -0
- package/dist/assertion/assertion-types.d.cts +1086 -0
- package/dist/assertion/assertion-types.d.cts.map +1 -0
- package/dist/assertion/assertion-types.d.ts +1086 -0
- package/dist/assertion/assertion-types.d.ts.map +1 -0
- package/dist/assertion/assertion-types.js +19 -0
- package/dist/assertion/assertion-types.js.map +1 -0
- package/dist/assertion/assertion.cjs +382 -0
- package/dist/assertion/assertion.cjs.map +1 -0
- package/dist/assertion/assertion.d.cts +109 -0
- package/dist/assertion/assertion.d.cts.map +1 -0
- package/dist/assertion/assertion.d.ts +109 -0
- package/dist/assertion/assertion.d.ts.map +1 -0
- package/dist/assertion/assertion.js +375 -0
- package/dist/assertion/assertion.js.map +1 -0
- package/dist/assertion/create.cjs +148 -0
- package/dist/assertion/create.cjs.map +1 -0
- package/dist/assertion/create.d.cts +85 -0
- package/dist/assertion/create.d.cts.map +1 -0
- package/dist/assertion/create.d.ts +85 -0
- package/dist/assertion/create.d.ts.map +1 -0
- package/dist/assertion/create.js +143 -0
- package/dist/assertion/create.js.map +1 -0
- package/dist/assertion/format-assertion-failure.cjs +63 -0
- package/dist/assertion/format-assertion-failure.cjs.map +1 -0
- package/dist/assertion/format-assertion-failure.d.cts +21 -0
- package/dist/assertion/format-assertion-failure.d.cts.map +1 -0
- package/dist/assertion/format-assertion-failure.d.ts +21 -0
- package/dist/assertion/format-assertion-failure.d.ts.map +1 -0
- package/dist/assertion/format-assertion-failure.js +59 -0
- package/dist/assertion/format-assertion-failure.js.map +1 -0
- package/dist/assertion/impl/assertion-util.cjs +68 -0
- package/dist/assertion/impl/assertion-util.cjs.map +1 -0
- package/dist/assertion/impl/assertion-util.d.cts +36 -0
- package/dist/assertion/impl/assertion-util.d.cts.map +1 -0
- package/dist/assertion/impl/assertion-util.d.ts +36 -0
- package/dist/assertion/impl/assertion-util.d.ts.map +1 -0
- package/dist/assertion/impl/assertion-util.js +62 -0
- package/dist/assertion/impl/assertion-util.js.map +1 -0
- package/dist/assertion/impl/async-iterable.cjs +627 -0
- package/dist/assertion/impl/async-iterable.cjs.map +1 -0
- package/dist/assertion/impl/async-iterable.d.cts +406 -0
- package/dist/assertion/impl/async-iterable.d.cts.map +1 -0
- package/dist/assertion/impl/async-iterable.d.ts +406 -0
- package/dist/assertion/impl/async-iterable.d.ts.map +1 -0
- package/dist/assertion/impl/async-iterable.js +624 -0
- package/dist/assertion/impl/async-iterable.js.map +1 -0
- package/dist/assertion/impl/async-parametric.cjs +412 -0
- package/dist/assertion/impl/async-parametric.cjs.map +1 -0
- package/dist/assertion/impl/async-parametric.d.cts +278 -0
- package/dist/assertion/impl/async-parametric.d.cts.map +1 -0
- package/dist/assertion/impl/async-parametric.d.ts +278 -0
- package/dist/assertion/impl/async-parametric.d.ts.map +1 -0
- package/dist/assertion/impl/async-parametric.js +409 -0
- package/dist/assertion/impl/async-parametric.js.map +1 -0
- package/dist/assertion/impl/async.cjs +56 -0
- package/dist/assertion/impl/async.cjs.map +1 -0
- package/dist/assertion/impl/async.d.cts +179 -0
- package/dist/assertion/impl/async.d.cts.map +1 -0
- package/dist/assertion/impl/async.d.ts +179 -0
- package/dist/assertion/impl/async.d.ts.map +1 -0
- package/dist/assertion/impl/async.js +39 -0
- package/dist/assertion/impl/async.js.map +1 -0
- package/dist/assertion/impl/index.cjs +37 -0
- package/dist/assertion/impl/index.cjs.map +1 -0
- package/dist/assertion/impl/index.d.cts +21 -0
- package/dist/assertion/impl/index.d.cts.map +1 -0
- package/dist/assertion/impl/index.d.ts +21 -0
- package/dist/assertion/impl/index.d.ts.map +1 -0
- package/dist/assertion/impl/index.js +21 -0
- package/dist/assertion/impl/index.js.map +1 -0
- package/dist/assertion/impl/iteration-util.cjs +297 -0
- package/dist/assertion/impl/iteration-util.cjs.map +1 -0
- package/dist/assertion/impl/iteration-util.d.cts +12 -0
- package/dist/assertion/impl/iteration-util.d.cts.map +1 -0
- package/dist/assertion/impl/iteration-util.d.ts +12 -0
- package/dist/assertion/impl/iteration-util.d.ts.map +1 -0
- package/dist/assertion/impl/iteration-util.js +282 -0
- package/dist/assertion/impl/iteration-util.js.map +1 -0
- package/dist/assertion/impl/snapshot.cjs +276 -0
- package/dist/assertion/impl/snapshot.cjs.map +1 -0
- package/dist/assertion/impl/snapshot.d.cts +278 -0
- package/dist/assertion/impl/snapshot.d.cts.map +1 -0
- package/dist/assertion/impl/snapshot.d.ts +278 -0
- package/dist/assertion/impl/snapshot.d.ts.map +1 -0
- package/dist/assertion/impl/snapshot.js +273 -0
- package/dist/assertion/impl/snapshot.js.map +1 -0
- package/dist/assertion/impl/sync-basic.cjs +553 -0
- package/dist/assertion/impl/sync-basic.cjs.map +1 -0
- package/dist/assertion/impl/sync-basic.d.cts +528 -0
- package/dist/assertion/impl/sync-basic.d.cts.map +1 -0
- package/dist/assertion/impl/sync-basic.d.ts +528 -0
- package/dist/assertion/impl/sync-basic.d.ts.map +1 -0
- package/dist/assertion/impl/sync-basic.js +550 -0
- package/dist/assertion/impl/sync-basic.js.map +1 -0
- package/dist/assertion/impl/sync-collection.cjs +1424 -0
- package/dist/assertion/impl/sync-collection.cjs.map +1 -0
- package/dist/assertion/impl/sync-collection.d.cts +922 -0
- package/dist/assertion/impl/sync-collection.d.cts.map +1 -0
- package/dist/assertion/impl/sync-collection.d.ts +922 -0
- package/dist/assertion/impl/sync-collection.d.ts.map +1 -0
- package/dist/assertion/impl/sync-collection.js +1418 -0
- package/dist/assertion/impl/sync-collection.js.map +1 -0
- package/dist/assertion/impl/sync-date.cjs +341 -0
- package/dist/assertion/impl/sync-date.cjs.map +1 -0
- package/dist/assertion/impl/sync-date.d.cts +209 -0
- package/dist/assertion/impl/sync-date.d.cts.map +1 -0
- package/dist/assertion/impl/sync-date.d.ts +209 -0
- package/dist/assertion/impl/sync-date.d.ts.map +1 -0
- package/dist/assertion/impl/sync-date.js +338 -0
- package/dist/assertion/impl/sync-date.js.map +1 -0
- package/dist/assertion/impl/sync-esoteric.cjs +214 -0
- package/dist/assertion/impl/sync-esoteric.cjs.map +1 -0
- package/dist/assertion/impl/sync-esoteric.d.cts +191 -0
- package/dist/assertion/impl/sync-esoteric.d.cts.map +1 -0
- package/dist/assertion/impl/sync-esoteric.d.ts +191 -0
- package/dist/assertion/impl/sync-esoteric.d.ts.map +1 -0
- package/dist/assertion/impl/sync-esoteric.js +211 -0
- package/dist/assertion/impl/sync-esoteric.js.map +1 -0
- package/dist/assertion/impl/sync-iterable.cjs +512 -0
- package/dist/assertion/impl/sync-iterable.cjs.map +1 -0
- package/dist/assertion/impl/sync-iterable.d.cts +334 -0
- package/dist/assertion/impl/sync-iterable.d.cts.map +1 -0
- package/dist/assertion/impl/sync-iterable.d.ts +334 -0
- package/dist/assertion/impl/sync-iterable.d.ts.map +1 -0
- package/dist/assertion/impl/sync-iterable.js +509 -0
- package/dist/assertion/impl/sync-iterable.js.map +1 -0
- package/dist/assertion/impl/sync-parametric.cjs +805 -0
- package/dist/assertion/impl/sync-parametric.cjs.map +1 -0
- package/dist/assertion/impl/sync-parametric.d.cts +560 -0
- package/dist/assertion/impl/sync-parametric.d.cts.map +1 -0
- package/dist/assertion/impl/sync-parametric.d.ts +560 -0
- package/dist/assertion/impl/sync-parametric.d.ts.map +1 -0
- package/dist/assertion/impl/sync-parametric.js +802 -0
- package/dist/assertion/impl/sync-parametric.js.map +1 -0
- package/dist/assertion/impl/sync.cjs +229 -0
- package/dist/assertion/impl/sync.cjs.map +1 -0
- package/dist/assertion/impl/sync.d.cts +536 -0
- package/dist/assertion/impl/sync.d.cts.map +1 -0
- package/dist/assertion/impl/sync.d.ts +536 -0
- package/dist/assertion/impl/sync.d.ts.map +1 -0
- package/dist/assertion/impl/sync.js +212 -0
- package/dist/assertion/impl/sync.js.map +1 -0
- package/dist/assertion/index.cjs +38 -0
- package/dist/assertion/index.cjs.map +1 -0
- package/dist/assertion/index.d.cts +18 -0
- package/dist/assertion/index.d.cts.map +1 -0
- package/dist/assertion/index.d.ts +18 -0
- package/dist/assertion/index.d.ts.map +1 -0
- package/dist/assertion/index.js +17 -0
- package/dist/assertion/index.js.map +1 -0
- package/dist/assertion/slotify.cjs +165 -0
- package/dist/assertion/slotify.cjs.map +1 -0
- package/dist/assertion/slotify.d.cts +11 -0
- package/dist/assertion/slotify.d.cts.map +1 -0
- package/dist/assertion/slotify.d.ts +11 -0
- package/dist/assertion/slotify.d.ts.map +1 -0
- package/dist/assertion/slotify.js +161 -0
- package/dist/assertion/slotify.js.map +1 -0
- package/dist/bootstrap.cjs +43 -0
- package/dist/bootstrap.cjs.map +1 -0
- package/dist/bootstrap.d.cts +27 -0
- package/dist/bootstrap.d.cts.map +1 -0
- package/dist/bootstrap.d.ts +27 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +40 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/constant.cjs +82 -0
- package/dist/constant.cjs.map +1 -0
- package/dist/constant.d.cts +69 -0
- package/dist/constant.d.cts.map +1 -0
- package/dist/constant.d.ts +69 -0
- package/dist/constant.d.ts.map +1 -0
- package/dist/constant.js +79 -0
- package/dist/constant.js.map +1 -0
- package/dist/diff.cjs +340 -0
- package/dist/diff.cjs.map +1 -0
- package/dist/diff.d.cts +51 -0
- package/dist/diff.d.cts.map +1 -0
- package/dist/diff.d.ts +51 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +334 -0
- package/dist/diff.js.map +1 -0
- package/dist/error.cjs +194 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.cts +212 -0
- package/dist/error.d.cts.map +1 -0
- package/dist/error.d.ts +212 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +181 -0
- package/dist/error.js.map +1 -0
- package/dist/expect.cjs +587 -0
- package/dist/expect.cjs.map +1 -0
- package/dist/expect.d.cts +138 -0
- package/dist/expect.d.cts.map +1 -0
- package/dist/expect.d.ts +138 -0
- package/dist/expect.d.ts.map +1 -0
- package/dist/expect.js +582 -0
- package/dist/expect.js.map +1 -0
- package/dist/guards.cjs +291 -0
- package/dist/guards.cjs.map +1 -0
- package/dist/guards.d.cts +225 -0
- package/dist/guards.d.cts.map +1 -0
- package/dist/guards.d.ts +225 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +273 -0
- package/dist/guards.js.map +1 -0
- package/dist/index.cjs +111 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +460 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +460 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/internal-schema.cjs +234 -0
- package/dist/internal-schema.cjs.map +1 -0
- package/dist/internal-schema.d.cts +8 -0
- package/dist/internal-schema.d.cts.map +1 -0
- package/dist/internal-schema.d.ts +8 -0
- package/dist/internal-schema.d.ts.map +1 -0
- package/dist/internal-schema.js +229 -0
- package/dist/internal-schema.js.map +1 -0
- package/dist/metadata.cjs +57 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.cts +27 -0
- package/dist/metadata.d.cts.map +1 -0
- package/dist/metadata.d.ts +27 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +54 -0
- package/dist/metadata.js.map +1 -0
- package/dist/schema.cjs +1522 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +1196 -0
- package/dist/schema.d.cts.map +1 -0
- package/dist/schema.d.ts +1196 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +1516 -0
- package/dist/schema.js.map +1 -0
- package/dist/snapshot/adapter.cjs +29 -0
- package/dist/snapshot/adapter.cjs.map +1 -0
- package/dist/snapshot/adapter.d.cts +258 -0
- package/dist/snapshot/adapter.d.cts.map +1 -0
- package/dist/snapshot/adapter.d.ts +258 -0
- package/dist/snapshot/adapter.d.ts.map +1 -0
- package/dist/snapshot/adapter.js +25 -0
- package/dist/snapshot/adapter.js.map +1 -0
- package/dist/snapshot/adapters/fallback.cjs +452 -0
- package/dist/snapshot/adapters/fallback.cjs.map +1 -0
- package/dist/snapshot/adapters/fallback.d.cts +185 -0
- package/dist/snapshot/adapters/fallback.d.cts.map +1 -0
- package/dist/snapshot/adapters/fallback.d.ts +185 -0
- package/dist/snapshot/adapters/fallback.d.ts.map +1 -0
- package/dist/snapshot/adapters/fallback.js +445 -0
- package/dist/snapshot/adapters/fallback.js.map +1 -0
- package/dist/snapshot/adapters/node-test.cjs +297 -0
- package/dist/snapshot/adapters/node-test.cjs.map +1 -0
- package/dist/snapshot/adapters/node-test.d.cts +131 -0
- package/dist/snapshot/adapters/node-test.d.cts.map +1 -0
- package/dist/snapshot/adapters/node-test.d.ts +131 -0
- package/dist/snapshot/adapters/node-test.d.ts.map +1 -0
- package/dist/snapshot/adapters/node-test.js +293 -0
- package/dist/snapshot/adapters/node-test.js.map +1 -0
- package/dist/snapshot/index.cjs +61 -0
- package/dist/snapshot/index.cjs.map +1 -0
- package/dist/snapshot/index.d.cts +40 -0
- package/dist/snapshot/index.d.cts.map +1 -0
- package/dist/snapshot/index.d.ts +40 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/snapshot/index.js +44 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/snapshot/node-version.cjs +49 -0
- package/dist/snapshot/node-version.cjs.map +1 -0
- package/dist/snapshot/node-version.d.cts +34 -0
- package/dist/snapshot/node-version.d.cts.map +1 -0
- package/dist/snapshot/node-version.d.ts +34 -0
- package/dist/snapshot/node-version.d.ts.map +1 -0
- package/dist/snapshot/node-version.js +44 -0
- package/dist/snapshot/node-version.js.map +1 -0
- package/dist/snapshot/select-adapter.cjs +170 -0
- package/dist/snapshot/select-adapter.cjs.map +1 -0
- package/dist/snapshot/select-adapter.d.cts +128 -0
- package/dist/snapshot/select-adapter.d.cts.map +1 -0
- package/dist/snapshot/select-adapter.d.ts +128 -0
- package/dist/snapshot/select-adapter.d.ts.map +1 -0
- package/dist/snapshot/select-adapter.js +164 -0
- package/dist/snapshot/select-adapter.js.map +1 -0
- package/dist/snapshot/serializer.cjs +245 -0
- package/dist/snapshot/serializer.cjs.map +1 -0
- package/dist/snapshot/serializer.d.cts +126 -0
- package/dist/snapshot/serializer.d.cts.map +1 -0
- package/dist/snapshot/serializer.d.ts +126 -0
- package/dist/snapshot/serializer.d.ts.map +1 -0
- package/dist/snapshot/serializer.js +237 -0
- package/dist/snapshot/serializer.js.map +1 -0
- package/dist/standard-schema.cjs +13 -0
- package/dist/standard-schema.cjs.map +1 -0
- package/dist/standard-schema.d.cts +192 -0
- package/dist/standard-schema.d.cts.map +1 -0
- package/dist/standard-schema.d.ts +192 -0
- package/dist/standard-schema.d.ts.map +1 -0
- package/dist/standard-schema.js +12 -0
- package/dist/standard-schema.js.map +1 -0
- package/dist/types.cjs +22 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +756 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +756 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +21 -0
- package/dist/types.js.map +1 -0
- package/dist/use.cjs +240 -0
- package/dist/use.cjs.map +1 -0
- package/dist/use.d.cts +8 -0
- package/dist/use.d.cts.map +1 -0
- package/dist/use.d.ts +8 -0
- package/dist/use.d.ts.map +1 -0
- package/dist/use.js +236 -0
- package/dist/use.js.map +1 -0
- package/dist/util.cjs +255 -0
- package/dist/util.cjs.map +1 -0
- package/dist/util.d.cts +141 -0
- package/dist/util.d.cts.map +1 -0
- package/dist/util.d.ts +141 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +234 -0
- package/dist/util.js.map +1 -0
- package/dist/value-to-schema.cjs +537 -0
- package/dist/value-to-schema.cjs.map +1 -0
- package/dist/value-to-schema.d.cts +144 -0
- package/dist/value-to-schema.d.cts.map +1 -0
- package/dist/value-to-schema.d.ts +144 -0
- package/dist/value-to-schema.d.ts.map +1 -0
- package/dist/value-to-schema.js +533 -0
- package/dist/value-to-schema.js.map +1 -0
- package/package.json +22 -19
- package/src/assertion/assertion-types.ts +4 -8
- package/src/assertion/assertion.ts +1 -1
- package/src/assertion/format-assertion-failure.ts +2 -0
- package/src/assertion/impl/assertion-util.ts +1 -2
- package/src/assertion/impl/iteration-util.ts +1 -3
- package/src/assertion/impl/sync-collection.ts +633 -7
- package/src/assertion/impl/sync.ts +27 -0
- package/src/error.ts +13 -22
- package/src/guards.ts +8 -14
- package/src/internal-schema.ts +4 -8
- package/src/metadata.ts +1 -2
- package/src/snapshot/adapter.ts +2 -3
- package/src/snapshot/adapters/fallback.ts +2 -3
- package/src/snapshot/adapters/node-test.ts +14 -20
- package/src/snapshot/select-adapter.ts +3 -3
- package/src/snapshot/serializer.ts +2 -3
- package/src/types.ts +2 -162
|
@@ -0,0 +1,922 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that a Map or WeakMap contains a specific key. For WeakMap, the key
|
|
4
|
+
* must be an object.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const map = new Map([['key', 'value']]);
|
|
10
|
+
* expect(map, 'to contain', 'key'); // passes
|
|
11
|
+
*
|
|
12
|
+
* const obj = {};
|
|
13
|
+
* const weakMap = new WeakMap([[obj, 'value']]);
|
|
14
|
+
* expect(weakMap, 'to contain', obj); // passes
|
|
15
|
+
* expect(weakMap, 'to contain', 'string'); // fails (not an object)
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @group Collection Assertions
|
|
19
|
+
* @bupkisAnchor map-to-contain-any
|
|
20
|
+
* @bupkisAssertionCategory collections
|
|
21
|
+
*/
|
|
22
|
+
export declare const mapContainsAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<[z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<WeakMap<WeakKey, unknown>, WeakMap<WeakKey, unknown>>]>, readonly ["to contain", "to include"], z.ZodUnknown], (subject: Map<unknown, unknown> | WeakMap<WeakKey, unknown>, key: unknown) => {
|
|
23
|
+
message: string;
|
|
24
|
+
} | undefined, readonly [z.ZodUnion<[z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<WeakMap<WeakKey, unknown>, WeakMap<WeakKey, unknown>>]>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to contain", "to include"]>, z.ZodUnknown]>;
|
|
25
|
+
/**
|
|
26
|
+
* Asserts that a Map has a specific size.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const map = new Map([
|
|
32
|
+
* ['a', 1],
|
|
33
|
+
* ['b', 2],
|
|
34
|
+
* ]);
|
|
35
|
+
* expect(map, 'to have size', 2); // passes
|
|
36
|
+
* expect(map, 'to have size', 3); // fails
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @group Collection Assertions
|
|
40
|
+
* @bupkisAnchor map-to-have-size-nonnegative-integer
|
|
41
|
+
* @bupkisAssertionCategory collections
|
|
42
|
+
*/
|
|
43
|
+
export declare const mapSizeAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, "to have size", z.ZodInt], (_subject: Map<unknown, unknown>, expectedSize: number) => z.ZodMap<z.ZodUnknown, z.ZodUnknown>, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have size">, z.ZodInt]>;
|
|
44
|
+
/**
|
|
45
|
+
* Asserts that a Map is empty.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* expect(new Map(), 'to be empty'); // passes
|
|
51
|
+
* expect(new Map([['key', 'value']]), 'to be empty'); // fails
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @group Collection Assertions
|
|
55
|
+
* @bupkisAnchor map-to-be-empty
|
|
56
|
+
* @bupkisAssertionCategory collections
|
|
57
|
+
*/
|
|
58
|
+
export declare const emptyMapAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, "to be empty"], z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to be empty">]>;
|
|
59
|
+
/**
|
|
60
|
+
* Asserts that a Set or WeakSet contains a specific value. For WeakSet, the
|
|
61
|
+
* value must be an object.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* const set = new Set(['a', 'b']);
|
|
67
|
+
* expect(set, 'to contain', 'a'); // passes
|
|
68
|
+
*
|
|
69
|
+
* const obj = {};
|
|
70
|
+
* const weakSet = new WeakSet([obj]);
|
|
71
|
+
* expect(weakSet, 'to contain', obj); // passes
|
|
72
|
+
* expect(weakSet, 'to contain', 'string'); // fails (not an object)
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @group Collection Assertions
|
|
76
|
+
* @bupkisAnchor set-to-contain-any
|
|
77
|
+
* @bupkisAssertionCategory collections
|
|
78
|
+
*/
|
|
79
|
+
export declare const setContainsAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<[z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodCustom<WeakSet<WeakKey>, WeakSet<WeakKey>>]>, readonly ["to contain", "to include"], z.ZodUnknown], (subject: Set<unknown> | WeakSet<WeakKey>, value: unknown) => {
|
|
80
|
+
message: string;
|
|
81
|
+
} | undefined, readonly [z.ZodUnion<[z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodCustom<WeakSet<WeakKey>, WeakSet<WeakKey>>]>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to contain", "to include"]>, z.ZodUnknown]>;
|
|
82
|
+
/**
|
|
83
|
+
* Asserts that a Set has a specific size.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* const set = new Set(['a', 'b']);
|
|
89
|
+
* expect(set, 'to have size', 2); // passes
|
|
90
|
+
* expect(set, 'to have size', 3); // fails
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @group Collection Assertions
|
|
94
|
+
* @bupkisAnchor set-to-have-size-nonnegative-integer
|
|
95
|
+
* @bupkisAssertionCategory collections
|
|
96
|
+
*/
|
|
97
|
+
export declare const setSizeAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to have size", z.ZodInt], (_subject: Set<unknown>, expectedSize: number) => z.ZodSet<z.ZodUnknown>, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have size">, z.ZodInt]>;
|
|
98
|
+
/**
|
|
99
|
+
* Asserts that a Set is empty.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
*
|
|
103
|
+
* ```ts
|
|
104
|
+
* expect(new Set(), 'to be empty'); // passes
|
|
105
|
+
* expect(new Set(['value']), 'to be empty'); // fails
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @group Collection Assertions
|
|
109
|
+
* @bupkisAnchor set-to-be-empty
|
|
110
|
+
* @bupkisAssertionCategory collections
|
|
111
|
+
*/
|
|
112
|
+
export declare const emptySetAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to be empty"], z.ZodCustom<Set<unknown>, Set<unknown>>, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to be empty">]>;
|
|
113
|
+
/**
|
|
114
|
+
* Asserts that an array contains a specific value.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
*
|
|
118
|
+
* ```ts
|
|
119
|
+
* expect([1, 2, 3], 'to contain', 2); // passes
|
|
120
|
+
* expect([1, 2, 3], 'to contain', 4); // fails
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @group Collection Assertions
|
|
124
|
+
* @bupkisAnchor array-to-contain-any
|
|
125
|
+
* @bupkisAssertionCategory collections
|
|
126
|
+
*/
|
|
127
|
+
export declare const arrayContainsAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodArray<z.ZodUnknown>, readonly ["to contain", "to include"], z.ZodUnknown], (subject: unknown[], value: unknown) => {
|
|
128
|
+
message: string;
|
|
129
|
+
} | undefined, readonly [z.ZodArray<z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to contain", "to include"]>, z.ZodUnknown]>;
|
|
130
|
+
/**
|
|
131
|
+
* Asserts that an array contains an item that satisfies a given shape or
|
|
132
|
+
* pattern. Uses partial matching semantics - the item only needs to match the
|
|
133
|
+
* specified properties.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
*
|
|
137
|
+
* ```ts
|
|
138
|
+
* expect([{ a: 1, b: 2 }, { c: 3 }], 'to have item satisfying', { a: 1 }); // passes
|
|
139
|
+
* expect([{ a: 1 }, { b: 2 }], 'to have an item satisfying', { c: 3 }); // fails
|
|
140
|
+
* expect([1, 2, 3], 'to contain item satisfying', 2); // passes (exact match)
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @group Collection Assertions
|
|
144
|
+
* @bupkisAnchor array-to-have-item-satisfying
|
|
145
|
+
* @bupkisAssertionCategory collections
|
|
146
|
+
*/
|
|
147
|
+
export declare const arrayItemSatisfiesAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodArray<z.ZodUnknown>, readonly ["to have item satisfying", "to have an item satisfying", "to contain item satisfying"], z.ZodUnknown], (subject: unknown[], shape: unknown) => {
|
|
148
|
+
message: string;
|
|
149
|
+
} | undefined, readonly [z.ZodArray<z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have item satisfying", "to have an item satisfying", "to contain item satisfying"]>, z.ZodUnknown]>;
|
|
150
|
+
/**
|
|
151
|
+
* Asserts that an array has a specific size.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
*
|
|
155
|
+
* ```ts
|
|
156
|
+
* expect([1, 2, 3], 'to have length', 3); // passes
|
|
157
|
+
* expect([1, 2, 3], 'to have size', 2); // fails
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @group Collection Assertions
|
|
161
|
+
* @bupkisAnchor array-to-have-size-nonnegative-integer
|
|
162
|
+
* @bupkisAssertionCategory collections
|
|
163
|
+
*/
|
|
164
|
+
export declare const arraySizeAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodArray<z.ZodUnknown>, readonly ["to have length", "to have size"], z.ZodInt], (_subject: unknown[], expectedSize: number) => z.ZodArray<z.ZodUnknown>, readonly [z.ZodArray<z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have length", "to have size"]>, z.ZodInt]>;
|
|
165
|
+
/**
|
|
166
|
+
* Asserts that an array is non-empty.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
*
|
|
170
|
+
* ```ts
|
|
171
|
+
* expect([1, 2, 3], 'to be non-empty'); // passes
|
|
172
|
+
* expect([], 'to be non-empty'); // fails
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @group Collection Assertions
|
|
176
|
+
* @bupkisAnchor array-not-to-be-empty
|
|
177
|
+
* @bupkisAssertionCategory collections
|
|
178
|
+
*/
|
|
179
|
+
export declare const nonEmptyArrayAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly [z.ZodArray<z.ZodUnknown>, "to be non-empty"], z.ZodArray<z.ZodUnknown>, readonly [z.ZodArray<z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralSlot<"to be non-empty">]>;
|
|
180
|
+
/**
|
|
181
|
+
* Asserts that an object has specific keys/properties.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
*
|
|
185
|
+
* ```ts
|
|
186
|
+
* expect({ a: 1, b: 2 }, 'to have keys', 'a', 'b'); // passes
|
|
187
|
+
* expect({ a: 1 }, 'to have keys', 'a', 'b'); // fails
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @group Collection Assertions
|
|
191
|
+
* @bupkisAnchor object-to-have-keys-array
|
|
192
|
+
* @bupkisAssertionCategory object
|
|
193
|
+
*/
|
|
194
|
+
export declare const objectKeysAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly ["to have keys", "to have properties", "to have props", "to contain keys", "to contain properties", "to contain props", "to include keys", "to include properties", "to include props"], z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>>], (_subject: Record<PropertyKey, unknown> | ((...args: any[]) => any), keys: (string | number | symbol)[]) => z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have keys", "to have properties", "to have props", "to contain keys", "to contain properties", "to contain props", "to include keys", "to include properties", "to include props"]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>>]>;
|
|
195
|
+
/**
|
|
196
|
+
* Asserts that an object has a property at the specified keypath using dot or
|
|
197
|
+
* bracket notation. Uses the `has()` function to traverse nested properties and
|
|
198
|
+
* supports complex keypaths like 'foo.bar[0]["baz"]'.
|
|
199
|
+
*
|
|
200
|
+
* This assertion supports:
|
|
201
|
+
*
|
|
202
|
+
* - Dot notation: 'prop.nested'
|
|
203
|
+
* - Bracket notation with numbers: 'arr[0]'
|
|
204
|
+
* - Bracket notation with quoted strings: 'obj["key"]' or "obj['key']"
|
|
205
|
+
* - Mixed notation: 'data.items[1].name'
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
*
|
|
209
|
+
* ```ts
|
|
210
|
+
* const obj = {
|
|
211
|
+
* foo: { bar: [{ baz: 'value' }] },
|
|
212
|
+
* 'kebab-case': 'works',
|
|
213
|
+
* };
|
|
214
|
+
*
|
|
215
|
+
* expect(obj, 'to have key', 'foo.bar'); // passes
|
|
216
|
+
* expect(obj, 'to have property', 'foo.bar[0].baz'); // passes
|
|
217
|
+
* expect(obj, 'to have prop', 'foo["kebab-case"]'); // passes
|
|
218
|
+
* expect(obj, 'to have key', 'nonexistent.path'); // fails
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* @group Collection Assertions
|
|
222
|
+
* @bupkisAnchor object-to-have-key-string-number-symbol
|
|
223
|
+
* @bupkisAssertionCategory object
|
|
224
|
+
*/
|
|
225
|
+
export declare const objectKeyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly ["to have key", "to have property", "to have prop", "to contain key", "to contain property", "to contain prop", "to include key", "to include property", "to include prop"], z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>], (subject: Record<PropertyKey, unknown> | ((...args: any[]) => any), keypath: string) => {
|
|
226
|
+
actual: string;
|
|
227
|
+
expect: string;
|
|
228
|
+
message: string;
|
|
229
|
+
} | undefined, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have key", "to have property", "to have prop", "to contain key", "to contain property", "to contain prop", "to include key", "to include property", "to include prop"]>, z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>]>;
|
|
230
|
+
/**
|
|
231
|
+
* Asserts that an object has an exact property key without keypath traversal.
|
|
232
|
+
* This assertion checks for direct properties on the object and supports
|
|
233
|
+
* symbols and keys that would conflict with bracket/dot notation.
|
|
234
|
+
*
|
|
235
|
+
* Unlike `objectKeyAssertion`, this does not use the `has()` function and
|
|
236
|
+
* therefore:
|
|
237
|
+
*
|
|
238
|
+
* - Does not support keypath traversal (no dots or brackets)
|
|
239
|
+
* - Can check for symbol keys
|
|
240
|
+
* - Can check for keys containing dots, brackets, or other special characters
|
|
241
|
+
* - Only checks direct properties (no nested access)
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
*
|
|
245
|
+
* ```ts
|
|
246
|
+
* const sym = Symbol('test');
|
|
247
|
+
* const obj = {
|
|
248
|
+
* simple: 'value',
|
|
249
|
+
* 'key.with.dots': 'direct property',
|
|
250
|
+
* 'key[with]brackets': 'another direct property',
|
|
251
|
+
* [sym]: 'symbol value',
|
|
252
|
+
* };
|
|
253
|
+
*
|
|
254
|
+
* expect(obj, 'to have exact key', 'simple'); // passes
|
|
255
|
+
* expect(obj, 'to have exact property', 'key.with.dots'); // passes (literal key)
|
|
256
|
+
* expect(obj, 'to have exact prop', 'key[with]brackets'); // passes (literal key)
|
|
257
|
+
* expect(obj, 'to have exact key', sym); // passes (symbol key)
|
|
258
|
+
*
|
|
259
|
+
* // These would fail because they're not direct properties:
|
|
260
|
+
* expect(obj, 'to have exact key', 'nested.path'); // fails (no keypath traversal)
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* @group Collection Assertions
|
|
264
|
+
* @bupkisAnchor object-to-have-only-keys-array
|
|
265
|
+
* @bupkisAssertionCategory object
|
|
266
|
+
*/
|
|
267
|
+
export declare const objectExactKeyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly ["to have exact key", "to have exact property", "to have exact prop"], z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>], (_: Record<PropertyKey, unknown> | ((...args: any[]) => any), key: string | number | symbol) => z.ZodPipe<z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, z.ZodTransform<{}, Record<PropertyKey, unknown> | ((...args: any[]) => any)>>, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have exact key", "to have exact property", "to have exact prop"]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>]>;
|
|
268
|
+
/**
|
|
269
|
+
* Asserts that an object has a specific number of keys.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
*
|
|
273
|
+
* ```ts
|
|
274
|
+
* expect({ a: 1, b: 2 }, 'to have size', 2); // passes
|
|
275
|
+
* expect({ a: 1 }, 'to have size', 2); // fails
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @group Collection Assertions
|
|
279
|
+
* @bupkisAnchor unknown-to-be-an-object
|
|
280
|
+
* @bupkisAssertionCategory object
|
|
281
|
+
*/
|
|
282
|
+
export declare const objectSizeAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, z.ZodUnknown>, "to have size", z.ZodInt], (subject: Record<string | number | symbol, unknown>, expectedSize: number) => {
|
|
283
|
+
actual: number;
|
|
284
|
+
expected: number;
|
|
285
|
+
message: string;
|
|
286
|
+
} | undefined, readonly [z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralSlot<"to have size">, z.ZodInt]>;
|
|
287
|
+
/**
|
|
288
|
+
* Asserts that two Sets are equal (same elements, order-independent).
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
*
|
|
292
|
+
* ```ts
|
|
293
|
+
* expect(new Set([1, 2]), 'to equal', new Set([2, 1])); // passes
|
|
294
|
+
* expect(new Set([1, 2]), 'to equal', new Set([1, 3])); // fails
|
|
295
|
+
* ```
|
|
296
|
+
*
|
|
297
|
+
* @group Collection Assertions
|
|
298
|
+
* @bupkisAnchor set-to-equal-set
|
|
299
|
+
* @bupkisAssertionCategory collections
|
|
300
|
+
*/
|
|
301
|
+
export declare const setEqualityAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to equal", z.ZodCustom<Set<unknown>, Set<unknown>>], (actual: Set<unknown>, expected: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to equal">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
302
|
+
/**
|
|
303
|
+
* Asserts that one Set is a subset of another.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
*
|
|
307
|
+
* ```ts
|
|
308
|
+
* expect(new Set([1, 2]), 'to be a subset of', new Set([1, 2, 3])); // passes
|
|
309
|
+
* expect(new Set([1, 4]), 'to be a subset of', new Set([1, 2, 3])); // fails
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* @group Collection Assertions
|
|
313
|
+
* @bupkisAnchor set-to-be-a-subset-of-set
|
|
314
|
+
* @bupkisAssertionCategory collections
|
|
315
|
+
*/
|
|
316
|
+
export declare const setSubsetAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to be a subset of", z.ZodCustom<Set<unknown>, Set<unknown>>], (subset: Set<unknown>, superset: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to be a subset of">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
317
|
+
/**
|
|
318
|
+
* Asserts that one Set is a superset of another.
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
*
|
|
322
|
+
* ```ts
|
|
323
|
+
* expect(new Set([1, 2, 3]), 'to be a superset of', new Set([1, 2])); // passes
|
|
324
|
+
* expect(new Set([1, 2]), 'to be a superset of', new Set([1, 2, 3])); // fails
|
|
325
|
+
* ```
|
|
326
|
+
*
|
|
327
|
+
* @group Collection Assertions
|
|
328
|
+
* @bupkisAnchor set-to-be-a-superset-of-set
|
|
329
|
+
* @bupkisAssertionCategory collections
|
|
330
|
+
*/
|
|
331
|
+
export declare const setSupersetAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to be a superset of", z.ZodCustom<Set<unknown>, Set<unknown>>], (superset: Set<unknown>, subset: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to be a superset of">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
332
|
+
/**
|
|
333
|
+
* Asserts that two Sets intersect (have common elements).
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
*
|
|
337
|
+
* ```ts
|
|
338
|
+
* expect(new Set([1, 2]), 'to intersect with', new Set([2, 3])); // passes
|
|
339
|
+
* expect(new Set([1, 2]), 'to intersect with', new Set([3, 4])); // fails
|
|
340
|
+
* ```
|
|
341
|
+
*
|
|
342
|
+
* @group Collection Assertions
|
|
343
|
+
* @bupkisAnchor set-to-have-intersection-with-set-satisfying-any
|
|
344
|
+
* @bupkisAssertionCategory collections
|
|
345
|
+
*/
|
|
346
|
+
export declare const setIntersectionAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to intersect with", z.ZodCustom<Set<unknown>, Set<unknown>>], (setA: Set<unknown>, setB: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to intersect with">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
347
|
+
/**
|
|
348
|
+
* Asserts that two Sets are disjoint (have no common elements).
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
*
|
|
352
|
+
* ```ts
|
|
353
|
+
* expect(new Set([1, 2]), 'to be disjoint from', new Set([3, 4])); // passes
|
|
354
|
+
* expect(new Set([1, 2]), 'to be disjoint from', new Set([2, 3])); // fails
|
|
355
|
+
* ```
|
|
356
|
+
*
|
|
357
|
+
* @group Collection Assertions
|
|
358
|
+
* @bupkisAnchor set-to-be-disjoint-from-set
|
|
359
|
+
* @bupkisAssertionCategory collections
|
|
360
|
+
*/
|
|
361
|
+
export declare const setDisjointAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to be disjoint from", z.ZodCustom<Set<unknown>, Set<unknown>>], (setA: Set<unknown>, setB: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to be disjoint from">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
362
|
+
/**
|
|
363
|
+
* Asserts that the union of two Sets equals a third Set.
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
*
|
|
367
|
+
* ```ts
|
|
368
|
+
* expect(
|
|
369
|
+
* new Set([1, 2]),
|
|
370
|
+
* 'to have union',
|
|
371
|
+
* new Set([3]),
|
|
372
|
+
* 'equal to',
|
|
373
|
+
* new Set([1, 2, 3]),
|
|
374
|
+
* ); // passes
|
|
375
|
+
* ```
|
|
376
|
+
*
|
|
377
|
+
* @group Collection Assertions
|
|
378
|
+
* @bupkisAnchor set-union-with-set-to-equal-set
|
|
379
|
+
* @bupkisAssertionCategory collections
|
|
380
|
+
*/
|
|
381
|
+
export declare const setUnionEqualityAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to have union", z.ZodCustom<Set<unknown>, Set<unknown>>, "equal to", z.ZodCustom<Set<unknown>, Set<unknown>>], (setA: Set<unknown>, setB: Set<unknown>, expected: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have union">, z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"equal to">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
382
|
+
/**
|
|
383
|
+
* Asserts that the intersection of two Sets equals a third Set.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
*
|
|
387
|
+
* ```ts
|
|
388
|
+
* expect(
|
|
389
|
+
* new Set([1, 2, 3]),
|
|
390
|
+
* 'to have intersection',
|
|
391
|
+
* new Set([2, 3, 4]),
|
|
392
|
+
* 'equal to',
|
|
393
|
+
* new Set([2, 3]),
|
|
394
|
+
* ); // passes
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @group Collection Assertions
|
|
398
|
+
* @bupkisAnchor set-intersection-with-set-to-equal-set
|
|
399
|
+
* @bupkisAssertionCategory collections
|
|
400
|
+
*/
|
|
401
|
+
export declare const setIntersectionEqualityAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to have intersection", z.ZodCustom<Set<unknown>, Set<unknown>>, "equal to", z.ZodCustom<Set<unknown>, Set<unknown>>], (setA: Set<unknown>, setB: Set<unknown>, expected: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have intersection">, z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"equal to">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
402
|
+
/**
|
|
403
|
+
* Asserts that the difference between two Sets equals a third Set.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
*
|
|
407
|
+
* ```ts
|
|
408
|
+
* expect(
|
|
409
|
+
* new Set([1, 2, 3]),
|
|
410
|
+
* 'to have difference',
|
|
411
|
+
* new Set([2, 4]),
|
|
412
|
+
* 'equal to',
|
|
413
|
+
* new Set([1, 3]),
|
|
414
|
+
* ); // passes
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
417
|
+
* @group Collection Assertions
|
|
418
|
+
* @bupkisAnchor set-difference-with-set-to-equal-set
|
|
419
|
+
* @bupkisAssertionCategory collections
|
|
420
|
+
*/
|
|
421
|
+
export declare const setDifferenceEqualityAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to have difference", z.ZodCustom<Set<unknown>, Set<unknown>>, "equal to", z.ZodCustom<Set<unknown>, Set<unknown>>], (setA: Set<unknown>, setB: Set<unknown>, expected: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have difference">, z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"equal to">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
422
|
+
/**
|
|
423
|
+
* Asserts that the symmetric difference between two Sets equals a third Set.
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
*
|
|
427
|
+
* ```ts
|
|
428
|
+
* expect(
|
|
429
|
+
* new Set([1, 2]),
|
|
430
|
+
* 'to have symmetric difference',
|
|
431
|
+
* new Set([2, 3]),
|
|
432
|
+
* 'equal to',
|
|
433
|
+
* new Set([1, 3]),
|
|
434
|
+
* ); // passes
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* @group Collection Assertions
|
|
438
|
+
* @bupkisAnchor set-symmetric-difference-with-set-to-equal-set
|
|
439
|
+
* @bupkisAssertionCategory collections
|
|
440
|
+
*/
|
|
441
|
+
export declare const setSymmetricDifferenceEqualityAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, "to have symmetric difference", z.ZodCustom<Set<unknown>, Set<unknown>>, "equal to", z.ZodCustom<Set<unknown>, Set<unknown>>], (setA: Set<unknown>, setB: Set<unknown>, expected: Set<unknown>) => boolean, readonly [z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have symmetric difference">, z.ZodCustom<Set<unknown>, Set<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"equal to">, z.ZodCustom<Set<unknown>, Set<unknown>>]>;
|
|
442
|
+
/**
|
|
443
|
+
* Asserts that a Map has a specific key.
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
*
|
|
447
|
+
* ```ts
|
|
448
|
+
* const map = new Map([['key', 'value']]);
|
|
449
|
+
* expect(map, 'to have key', 'key'); // passes
|
|
450
|
+
* expect(map, 'to have key', 'missing'); // fails
|
|
451
|
+
* ```
|
|
452
|
+
*
|
|
453
|
+
* @group Collection Assertions
|
|
454
|
+
* @bupkisAnchor map-to-have-key-any
|
|
455
|
+
* @bupkisAssertionCategory collections
|
|
456
|
+
*/
|
|
457
|
+
export declare const mapKeyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, "to have key", z.ZodUnknown], (map: Map<unknown, unknown>, key: unknown) => {
|
|
458
|
+
actual: unknown[];
|
|
459
|
+
expected: unknown[];
|
|
460
|
+
message: string;
|
|
461
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to have key">, z.ZodUnknown]>;
|
|
462
|
+
/**
|
|
463
|
+
* Asserts that a Map contains a specific value.
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
*
|
|
467
|
+
* ```ts
|
|
468
|
+
* const map = new Map([['key', 'value']]);
|
|
469
|
+
* expect(map, 'to have value', 'value'); // passes
|
|
470
|
+
* expect(map, 'to have value', 'missing'); // fails
|
|
471
|
+
* ```
|
|
472
|
+
*
|
|
473
|
+
* @group Collection Assertions
|
|
474
|
+
* @bupkisAnchor map-to-have-value-any
|
|
475
|
+
* @bupkisAssertionCategory collections
|
|
476
|
+
*/
|
|
477
|
+
export declare const mapValueAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, readonly ["to have value", "to contain value", "to include value"], z.ZodUnknown], (map: Map<unknown, unknown>, value: unknown) => {
|
|
478
|
+
actual: unknown[];
|
|
479
|
+
expected: unknown;
|
|
480
|
+
message: string;
|
|
481
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have value", "to contain value", "to include value"]>, z.ZodUnknown]>;
|
|
482
|
+
/**
|
|
483
|
+
* Asserts that a Map has a specific key-value entry.
|
|
484
|
+
*
|
|
485
|
+
* @example
|
|
486
|
+
*
|
|
487
|
+
* ```ts
|
|
488
|
+
* const map = new Map([['key', 'value']]);
|
|
489
|
+
* expect(map, 'to have entry', ['key', 'value']); // passes
|
|
490
|
+
* expect(map, 'to have entry', ['key', 'wrong']); // fails
|
|
491
|
+
* ```
|
|
492
|
+
*
|
|
493
|
+
* @group Collection Assertions
|
|
494
|
+
* @bupkisAnchor map-to-have-entry-any-any
|
|
495
|
+
* @bupkisAssertionCategory collections
|
|
496
|
+
*/
|
|
497
|
+
export declare const mapEntryAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<[z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<WeakMap<WeakKey, unknown>, WeakMap<WeakKey, unknown>>]>, readonly ["to have entry", "to have key/value pair", "to contain entry", "to contain key/value pair", "to include entry", "to include key/value pair"], z.ZodTuple<[z.ZodUnknown, z.ZodUnknown], null>], (map: Map<unknown, unknown> | WeakMap<WeakKey, unknown>, [key, value]: [unknown, unknown]) => {
|
|
498
|
+
message: string;
|
|
499
|
+
actual?: undefined;
|
|
500
|
+
expected?: undefined;
|
|
501
|
+
} | {
|
|
502
|
+
actual: unknown[] | undefined;
|
|
503
|
+
expected: unknown[];
|
|
504
|
+
message: string;
|
|
505
|
+
} | undefined, readonly [z.ZodUnion<[z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<WeakMap<WeakKey, unknown>, WeakMap<WeakKey, unknown>>]>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have entry", "to have key/value pair", "to contain entry", "to contain key/value pair", "to include entry", "to include key/value pair"]>, z.ZodTuple<[z.ZodUnknown, z.ZodUnknown], null>]>;
|
|
506
|
+
/**
|
|
507
|
+
* Asserts that two Maps are equal (same key-value pairs, order-independent).
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
*
|
|
511
|
+
* ```ts
|
|
512
|
+
* const map1 = new Map([
|
|
513
|
+
* ['a', 1],
|
|
514
|
+
* ['b', 2],
|
|
515
|
+
* ]);
|
|
516
|
+
* const map2 = new Map([
|
|
517
|
+
* ['b', 2],
|
|
518
|
+
* ['a', 1],
|
|
519
|
+
* ]);
|
|
520
|
+
* expect(map1, 'to equal', map2); // passes
|
|
521
|
+
* ```
|
|
522
|
+
*
|
|
523
|
+
* @group Collection Assertions
|
|
524
|
+
* @bupkisAnchor map-to-equal-map
|
|
525
|
+
* @bupkisAssertionCategory collections
|
|
526
|
+
*/
|
|
527
|
+
export declare const mapEqualityAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, "to equal", z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>], (mapA: Map<unknown, unknown>, mapB: Map<unknown, unknown>) => {
|
|
528
|
+
actual: number;
|
|
529
|
+
expected: number;
|
|
530
|
+
message: string;
|
|
531
|
+
} | {
|
|
532
|
+
message: string;
|
|
533
|
+
actual?: undefined;
|
|
534
|
+
expected?: undefined;
|
|
535
|
+
} | {
|
|
536
|
+
actual: unknown[];
|
|
537
|
+
expected: unknown[];
|
|
538
|
+
message: string;
|
|
539
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to equal">, z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>]>;
|
|
540
|
+
/**
|
|
541
|
+
* Asserts that a collection (Map or Set) has a size greater than a threshold.
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
*
|
|
545
|
+
* ```ts
|
|
546
|
+
* expect(new Set([1, 2, 3]), 'to have size greater than', 2); // passes
|
|
547
|
+
* expect(new Set([1]), 'to have size greater than', 2); // fails
|
|
548
|
+
* ```
|
|
549
|
+
*
|
|
550
|
+
* @group Collection Assertions
|
|
551
|
+
* @bupkisAnchor collection-to-have-size-greater-than-nonnegative-integer
|
|
552
|
+
* @bupkisAssertionCategory collections
|
|
553
|
+
*/
|
|
554
|
+
export declare const collectionSizeGreaterThanAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>]>, "to have size greater than", z.ZodInt], (collection: Map<unknown, unknown> | Set<unknown>, minSize: number) => {
|
|
555
|
+
actual: number;
|
|
556
|
+
expected: number;
|
|
557
|
+
message: string;
|
|
558
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>]>, import("../assertion-types.js").PhraseLiteralSlot<"to have size greater than">, z.ZodInt]>;
|
|
559
|
+
/**
|
|
560
|
+
* Asserts that a collection (Map or Set) has a size less than a threshold.
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
*
|
|
564
|
+
* ```ts
|
|
565
|
+
* expect(new Set([1]), 'to have size less than', 2); // passes
|
|
566
|
+
* expect(new Set([1, 2, 3]), 'to have size less than', 2); // fails
|
|
567
|
+
* ```
|
|
568
|
+
*
|
|
569
|
+
* @group Collection Assertions
|
|
570
|
+
* @bupkisAnchor collection-to-have-size-less-than-nonnegative-integer
|
|
571
|
+
* @bupkisAssertionCategory collections
|
|
572
|
+
*/
|
|
573
|
+
export declare const collectionSizeLessThanAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>]>, "to have size less than", z.ZodInt], (collection: Map<unknown, unknown> | Set<unknown>, maxSize: number) => {
|
|
574
|
+
actual: number;
|
|
575
|
+
expected: number;
|
|
576
|
+
message: string;
|
|
577
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>]>, import("../assertion-types.js").PhraseLiteralSlot<"to have size less than">, z.ZodInt]>;
|
|
578
|
+
/**
|
|
579
|
+
* Asserts that a collection (Map or Set) has a size within a specific range.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
*
|
|
583
|
+
* ```ts
|
|
584
|
+
* expect(new Set([1, 2]), 'to have size between', [1, 3]); // passes
|
|
585
|
+
* expect(new Set([1, 2, 3, 4]), 'to have size between', [1, 3]); // fails
|
|
586
|
+
* ```
|
|
587
|
+
*
|
|
588
|
+
* @group Collection Assertions
|
|
589
|
+
* @bupkisAnchor collection-to-have-size-between-nonnegative-integer-and-nonnegative-integer
|
|
590
|
+
* @bupkisAssertionCategory collections
|
|
591
|
+
*/
|
|
592
|
+
export declare const collectionSizeBetweenAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>]>, "to have size between", z.ZodTuple<[z.ZodInt, z.ZodInt], null>], (collection: Map<unknown, unknown> | Set<unknown>, [min, max]: [number, number]) => {
|
|
593
|
+
message: string;
|
|
594
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>]>, import("../assertion-types.js").PhraseLiteralSlot<"to have size between">, z.ZodTuple<[z.ZodInt, z.ZodInt], null>]>;
|
|
595
|
+
/**
|
|
596
|
+
* Asserts that ALL values in a Map, Set, or Array individually satisfy the
|
|
597
|
+
* expected shape.
|
|
598
|
+
*
|
|
599
|
+
* Uses partial/satisfy semantics — every value must match. Empty collections
|
|
600
|
+
* pass vacuously.
|
|
601
|
+
*
|
|
602
|
+
* @remarks
|
|
603
|
+
* For `Map`, values (not keys) are checked. Use `mapKeysSatisfyAssertion` to
|
|
604
|
+
* assert on Map keys instead.
|
|
605
|
+
* @example
|
|
606
|
+
*
|
|
607
|
+
* ```ts
|
|
608
|
+
* expect([{ a: 1 }, { a: 2, b: 3 }], 'to have values satisfying', {
|
|
609
|
+
* a: z.number(),
|
|
610
|
+
* }); // passes
|
|
611
|
+
* expect(new Set([1, 2, 3]), 'to have values satisfying', z.number()); // passes
|
|
612
|
+
* expect(new Map([['k', { x: 1 }]]), 'to have values satisfying', {
|
|
613
|
+
* x: z.number(),
|
|
614
|
+
* }); // passes
|
|
615
|
+
* ```
|
|
616
|
+
*
|
|
617
|
+
* @function
|
|
618
|
+
* @group Collection Assertions
|
|
619
|
+
* @bupkisAnchor collection-to-have-values-satisfying-any
|
|
620
|
+
* @bupkisAssertionCategory collections
|
|
621
|
+
*/
|
|
622
|
+
export declare const collectionValuesSatisfyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, readonly ["to have values satisfying", "to contain values satisfying"], z.ZodUnknown], (subject: unknown[] | Map<unknown, unknown> | Set<unknown>, expected: unknown) => {
|
|
623
|
+
message: string;
|
|
624
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have values satisfying", "to contain values satisfying"]>, z.ZodUnknown]>;
|
|
625
|
+
/**
|
|
626
|
+
* Asserts that ALL values in a Map, Set, or Array individually match with deep
|
|
627
|
+
* equality.
|
|
628
|
+
*
|
|
629
|
+
* Uses strict deep-equality semantics — every value must exactly match. Empty
|
|
630
|
+
* collections pass vacuously.
|
|
631
|
+
*
|
|
632
|
+
* @example
|
|
633
|
+
*
|
|
634
|
+
* ```ts
|
|
635
|
+
* expect([{ a: 1 }, { a: 1 }], 'to have values exhaustively satisfying', {
|
|
636
|
+
* a: 1,
|
|
637
|
+
* }); // passes
|
|
638
|
+
* expect([{ a: 1, b: 2 }], 'to have values exhaustively satisfying', {
|
|
639
|
+
* a: 1,
|
|
640
|
+
* }); // fails — extra property b
|
|
641
|
+
* ```
|
|
642
|
+
*
|
|
643
|
+
* @function
|
|
644
|
+
* @group Collection Assertions
|
|
645
|
+
* @bupkisAnchor collection-to-have-values-exhaustively-satisfying-any
|
|
646
|
+
* @bupkisAssertionCategory collections
|
|
647
|
+
*/
|
|
648
|
+
export declare const collectionValuesExhaustivelySatisfyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, "to have values exhaustively satisfying", z.ZodUnknown], (subject: unknown[] | Map<unknown, unknown> | Set<unknown>, expected: unknown) => {
|
|
649
|
+
message: string;
|
|
650
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, import("../assertion-types.js").PhraseLiteralSlot<"to have values exhaustively satisfying">, z.ZodUnknown]>;
|
|
651
|
+
/**
|
|
652
|
+
* Asserts that at least one value in a Map, Set, or Array satisfies the
|
|
653
|
+
* expected shape.
|
|
654
|
+
*
|
|
655
|
+
* Uses partial/satisfy semantics — any single matching value is sufficient.
|
|
656
|
+
* Fails on empty collections.
|
|
657
|
+
*
|
|
658
|
+
* @remarks
|
|
659
|
+
* For `Map`, values (not keys) are checked.
|
|
660
|
+
* @example
|
|
661
|
+
*
|
|
662
|
+
* ```ts
|
|
663
|
+
* expect([{ a: 1, b: 2 }, { c: 3 }], 'to have a value satisfying', {
|
|
664
|
+
* a: 1,
|
|
665
|
+
* }); // passes
|
|
666
|
+
* expect(new Set([1, 'two', 3]), 'to have a value satisfying', z.string()); // passes
|
|
667
|
+
* expect([1, 2, 3], 'to have value satisfying', 2); // passes
|
|
668
|
+
* ```
|
|
669
|
+
*
|
|
670
|
+
* @function
|
|
671
|
+
* @group Collection Assertions
|
|
672
|
+
* @bupkisAnchor collection-to-have-a-value-satisfying-any
|
|
673
|
+
* @bupkisAssertionCategory collections
|
|
674
|
+
*/
|
|
675
|
+
export declare const collectionHasValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, readonly ["to have a value satisfying", "to have value satisfying", "to contain a value satisfying"], z.ZodUnknown], (subject: unknown[] | Map<unknown, unknown> | Set<unknown>, expected: unknown) => {
|
|
676
|
+
message: string;
|
|
677
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have a value satisfying", "to have value satisfying", "to contain a value satisfying"]>, z.ZodUnknown]>;
|
|
678
|
+
/**
|
|
679
|
+
* Asserts that at least one value in a Map, Set, or Array exhaustively matches
|
|
680
|
+
* the expected value.
|
|
681
|
+
*
|
|
682
|
+
* Uses strict deep-equality semantics. Fails on empty collections.
|
|
683
|
+
*
|
|
684
|
+
* @example
|
|
685
|
+
*
|
|
686
|
+
* ```ts
|
|
687
|
+
* expect(
|
|
688
|
+
* [{ a: 1 }, { a: 1, b: 2 }],
|
|
689
|
+
* 'to have a value exhaustively satisfying',
|
|
690
|
+
* {
|
|
691
|
+
* a: 1,
|
|
692
|
+
* },
|
|
693
|
+
* ); // passes — first element matches exactly
|
|
694
|
+
* expect([{ a: 1, b: 2 }], 'to have a value exhaustively satisfying', {
|
|
695
|
+
* a: 1,
|
|
696
|
+
* }); // fails — extra property b
|
|
697
|
+
* ```
|
|
698
|
+
*
|
|
699
|
+
* @function
|
|
700
|
+
* @group Collection Assertions
|
|
701
|
+
* @bupkisAnchor collection-to-have-a-value-exhaustively-satisfying-any
|
|
702
|
+
* @bupkisAssertionCategory collections
|
|
703
|
+
*/
|
|
704
|
+
export declare const collectionHasValueExhaustivelySatisfyingAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, readonly ["to have a value exhaustively satisfying", "to have value exhaustively satisfying"], z.ZodUnknown], (subject: unknown[] | Map<unknown, unknown> | Set<unknown>, expected: unknown) => {
|
|
705
|
+
message: string;
|
|
706
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, z.ZodCustom<Set<unknown>, Set<unknown>>, z.ZodArray<z.ZodUnknown>]>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have a value exhaustively satisfying", "to have value exhaustively satisfying"]>, z.ZodUnknown]>;
|
|
707
|
+
/**
|
|
708
|
+
* Asserts that ALL keys in a Map individually satisfy the expected shape.
|
|
709
|
+
*
|
|
710
|
+
* Uses partial/satisfy semantics — every key must match. Empty Maps pass
|
|
711
|
+
* vacuously.
|
|
712
|
+
*
|
|
713
|
+
* @example
|
|
714
|
+
*
|
|
715
|
+
* ```ts
|
|
716
|
+
* const map = new Map([
|
|
717
|
+
* ['foo', 1],
|
|
718
|
+
* ['bar', 2],
|
|
719
|
+
* ]);
|
|
720
|
+
* expect(map, 'to have keys satisfying', z.string()); // passes
|
|
721
|
+
* expect(map, 'to have props satisfying', z.string()); // alias — same assertion
|
|
722
|
+
* expect(map, 'to have fields satisfying', z.string()); // alias
|
|
723
|
+
* expect(map, 'to contain keys satisfying', /^[a-z]+$/); // alias
|
|
724
|
+
* ```
|
|
725
|
+
*
|
|
726
|
+
* @function
|
|
727
|
+
* @group Collection Assertions
|
|
728
|
+
* @bupkisAnchor map-to-have-keys-satisfying-any
|
|
729
|
+
* @bupkisAssertionCategory collections
|
|
730
|
+
*/
|
|
731
|
+
export declare const mapKeysSatisfyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, readonly ["to have keys satisfying", "to have props satisfying", "to have properties satisfying", "to have fields satisfying", "to contain keys satisfying", "to contain props satisfying", "to contain properties satisfying", "to contain fields satisfying"], z.ZodUnknown], (subject: Map<unknown, unknown>, expected: unknown) => {
|
|
732
|
+
message: string;
|
|
733
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have keys satisfying", "to have props satisfying", "to have properties satisfying", "to have fields satisfying", "to contain keys satisfying", "to contain props satisfying", "to contain properties satisfying", "to contain fields satisfying"]>, z.ZodUnknown]>;
|
|
734
|
+
/**
|
|
735
|
+
* Asserts that ALL keys in a Map individually match with deep equality.
|
|
736
|
+
*
|
|
737
|
+
* Uses strict deep-equality semantics — every key must exactly match. Empty
|
|
738
|
+
* Maps pass vacuously.
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
*
|
|
742
|
+
* ```ts
|
|
743
|
+
* const map = new Map([
|
|
744
|
+
* [{ id: 1 }, 'a'],
|
|
745
|
+
* [{ id: 2 }, 'b'],
|
|
746
|
+
* ]);
|
|
747
|
+
* expect(map, 'to have keys exhaustively satisfying', { id: z.number() }); // fails — extra strict
|
|
748
|
+
* expect(map, 'to have props exhaustively satisfying', { id: z.number() }); // alias
|
|
749
|
+
* expect(map, 'to have fields exhaustively satisfying', {
|
|
750
|
+
* id: z.number(),
|
|
751
|
+
* }); // alias
|
|
752
|
+
* ```
|
|
753
|
+
*
|
|
754
|
+
* @function
|
|
755
|
+
* @group Collection Assertions
|
|
756
|
+
* @bupkisAnchor map-to-have-keys-exhaustively-satisfying-any
|
|
757
|
+
* @bupkisAssertionCategory collections
|
|
758
|
+
*/
|
|
759
|
+
export declare const mapKeysExhaustivelySatisfyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, readonly ["to have keys exhaustively satisfying", "to have props exhaustively satisfying", "to have properties exhaustively satisfying", "to have fields exhaustively satisfying"], z.ZodUnknown], (subject: Map<unknown, unknown>, expected: unknown) => {
|
|
760
|
+
message: string;
|
|
761
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have keys exhaustively satisfying", "to have props exhaustively satisfying", "to have properties exhaustively satisfying", "to have fields exhaustively satisfying"]>, z.ZodUnknown]>;
|
|
762
|
+
/**
|
|
763
|
+
* Asserts that at least one key in a Map satisfies the expected shape.
|
|
764
|
+
*
|
|
765
|
+
* Uses partial/satisfy semantics. Fails on empty Maps.
|
|
766
|
+
*
|
|
767
|
+
* @example
|
|
768
|
+
*
|
|
769
|
+
* ```ts
|
|
770
|
+
* const map = new Map([
|
|
771
|
+
* ['foo', 1],
|
|
772
|
+
* [42, 2],
|
|
773
|
+
* ]);
|
|
774
|
+
* expect(map, 'to have a key satisfying', z.string()); // passes
|
|
775
|
+
* expect(map, 'to have key satisfying', z.number()); // passes
|
|
776
|
+
* expect(map, 'to have a prop satisfying', z.string()); // alias
|
|
777
|
+
* expect(map, 'to have a field satisfying', z.number()); // alias
|
|
778
|
+
* ```
|
|
779
|
+
*
|
|
780
|
+
* @function
|
|
781
|
+
* @group Collection Assertions
|
|
782
|
+
* @bupkisAnchor map-to-have-a-key-satisfying-any
|
|
783
|
+
* @bupkisAssertionCategory collections
|
|
784
|
+
*/
|
|
785
|
+
export declare const mapHasKeySatisfyingAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.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"], z.ZodUnknown], (subject: Map<unknown, unknown>, expected: unknown) => {
|
|
786
|
+
message: string;
|
|
787
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").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"]>, z.ZodUnknown]>;
|
|
788
|
+
/**
|
|
789
|
+
* Asserts that at least one key in a Map exhaustively matches the expected
|
|
790
|
+
* value.
|
|
791
|
+
*
|
|
792
|
+
* Uses strict deep-equality semantics. Fails on empty Maps.
|
|
793
|
+
*
|
|
794
|
+
* @example
|
|
795
|
+
*
|
|
796
|
+
* ```ts
|
|
797
|
+
* const map = new Map([
|
|
798
|
+
* [{ id: 1 }, 'a'],
|
|
799
|
+
* [{ id: 2 }, 'b'],
|
|
800
|
+
* ]);
|
|
801
|
+
* expect(map, 'to have a key exhaustively satisfying', { id: 1 }); // passes
|
|
802
|
+
* expect(map, 'to have a prop exhaustively satisfying', { id: 1 }); // alias
|
|
803
|
+
* expect(map, 'to have a field exhaustively satisfying', { id: 2 }); // alias
|
|
804
|
+
* ```
|
|
805
|
+
*
|
|
806
|
+
* @function
|
|
807
|
+
* @group Collection Assertions
|
|
808
|
+
* @bupkisAnchor map-to-have-a-key-exhaustively-satisfying-any
|
|
809
|
+
* @bupkisAssertionCategory collections
|
|
810
|
+
*/
|
|
811
|
+
export declare const mapHasKeyExhaustivelySatisfyingAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, readonly ["to have a key exhaustively satisfying", "to have key exhaustively satisfying", "to have a prop exhaustively satisfying", "to have prop exhaustively satisfying", "to have a property exhaustively satisfying", "to have property exhaustively satisfying", "to have a field exhaustively satisfying", "to have field exhaustively satisfying"], z.ZodUnknown], (subject: Map<unknown, unknown>, expected: unknown) => {
|
|
812
|
+
message: string;
|
|
813
|
+
} | undefined, readonly [z.ZodCustom<Map<unknown, unknown>, Map<unknown, unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have a key exhaustively satisfying", "to have key exhaustively satisfying", "to have a prop exhaustively satisfying", "to have prop exhaustively satisfying", "to have a property exhaustively satisfying", "to have property exhaustively satisfying", "to have a field exhaustively satisfying", "to have field exhaustively satisfying"]>, z.ZodUnknown]>;
|
|
814
|
+
/**
|
|
815
|
+
* Asserts that ALL own enumerable string keys of a non-collection object
|
|
816
|
+
* individually satisfy the expected shape.
|
|
817
|
+
*
|
|
818
|
+
* Uses partial/satisfy semantics — every key must match. Empty objects pass
|
|
819
|
+
* vacuously.
|
|
820
|
+
*
|
|
821
|
+
* @remarks
|
|
822
|
+
* Only considers own enumerable string keys (equivalent to `Object.keys()`).
|
|
823
|
+
* Symbol keys and non-enumerable keys are not checked.
|
|
824
|
+
* @example
|
|
825
|
+
*
|
|
826
|
+
* ```ts
|
|
827
|
+
* expect({ foo: 1, bar: 2 }, 'to have keys satisfying', z.string()); // passes
|
|
828
|
+
* expect({ foo: 1, bar: 2 }, 'to have props satisfying', /^[a-z]+$/); // alias
|
|
829
|
+
* expect({ foo: 1, bar: 2 }, 'to have fields satisfying', /^[a-z]+$/); // alias
|
|
830
|
+
* expect({ FOO: 1 }, 'to have keys satisfying', /^[a-z]+$/); // fails
|
|
831
|
+
* ```
|
|
832
|
+
*
|
|
833
|
+
* @function
|
|
834
|
+
* @group Collection Assertions
|
|
835
|
+
* @bupkisAnchor object-to-have-keys-satisfying-any
|
|
836
|
+
* @bupkisAssertionCategory object
|
|
837
|
+
*/
|
|
838
|
+
export declare const objectKeysSatisfyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly ["to have keys satisfying", "to have props satisfying", "to have properties satisfying", "to have fields satisfying"], z.ZodUnknown], (subject: Record<PropertyKey, unknown> | ((...args: any[]) => any), expected: unknown) => {
|
|
839
|
+
message: string;
|
|
840
|
+
} | undefined, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have keys satisfying", "to have props satisfying", "to have properties satisfying", "to have fields satisfying"]>, z.ZodUnknown]>;
|
|
841
|
+
/**
|
|
842
|
+
* Asserts that at least one own enumerable string key of a non-collection
|
|
843
|
+
* object satisfies the expected shape.
|
|
844
|
+
*
|
|
845
|
+
* Uses partial/satisfy semantics. Fails on objects with no own enumerable
|
|
846
|
+
* string keys.
|
|
847
|
+
*
|
|
848
|
+
* @remarks
|
|
849
|
+
* Only considers own enumerable string keys (equivalent to `Object.keys()`).
|
|
850
|
+
* Symbol keys and non-enumerable keys are not checked.
|
|
851
|
+
* @example
|
|
852
|
+
*
|
|
853
|
+
* ```ts
|
|
854
|
+
* expect({ foo: 1, BAR: 2 }, 'to have a key satisfying', /^[a-z]+$/); // passes
|
|
855
|
+
* expect({ foo: 1 }, 'to have key satisfying', z.string()); // passes
|
|
856
|
+
* expect({ foo: 1 }, 'to have a prop satisfying', z.string()); // alias
|
|
857
|
+
* expect({ foo: 1 }, 'to have a field satisfying', z.string()); // alias
|
|
858
|
+
* ```
|
|
859
|
+
*
|
|
860
|
+
* @function
|
|
861
|
+
* @group Collection Assertions
|
|
862
|
+
* @bupkisAnchor object-to-have-a-key-satisfying-any
|
|
863
|
+
* @bupkisAssertionCategory object
|
|
864
|
+
*/
|
|
865
|
+
export declare const objectHasKeySatisfyingAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, 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"], z.ZodUnknown], (subject: Record<PropertyKey, unknown> | ((...args: any[]) => any), expected: unknown) => {
|
|
866
|
+
message: string;
|
|
867
|
+
} | undefined, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").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"]>, z.ZodUnknown]>;
|
|
868
|
+
/**
|
|
869
|
+
* Asserts that ALL own enumerable string keys of a non-collection object match
|
|
870
|
+
* a regular expression.
|
|
871
|
+
*
|
|
872
|
+
* Empty objects pass vacuously.
|
|
873
|
+
*
|
|
874
|
+
* @remarks
|
|
875
|
+
* Only considers own enumerable string keys (equivalent to `Object.keys()`).
|
|
876
|
+
* Symbol keys and non-enumerable keys are not checked.
|
|
877
|
+
* @example
|
|
878
|
+
*
|
|
879
|
+
* ```ts
|
|
880
|
+
* expect({ foo: 1, bar: 2 }, 'to have keys matching', /^[a-z]+$/); // passes
|
|
881
|
+
* expect({ foo: 1, bar: 2 }, 'to have props matching', /^[a-z]+$/); // alias
|
|
882
|
+
* expect({ foo: 1, bar: 2 }, 'to have fields matching', /^[a-z]+$/); // alias
|
|
883
|
+
* expect({ foo: 1, Bar: 2 }, 'to have keys matching', /^[a-z]+$/); // fails
|
|
884
|
+
* expect({}, 'to have keys matching', /anything/); // passes (vacuous)
|
|
885
|
+
* ```
|
|
886
|
+
*
|
|
887
|
+
* @function
|
|
888
|
+
* @group Collection Assertions
|
|
889
|
+
* @bupkisAnchor object-to-have-keys-matching-regexp
|
|
890
|
+
* @bupkisAssertionCategory object
|
|
891
|
+
*/
|
|
892
|
+
export declare const objectKeysMatchAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly ["to have keys matching", "to have props matching", "to have properties matching", "to have fields matching"], z.ZodCustom<RegExp, RegExp>], (subject: Record<PropertyKey, unknown> | ((...args: any[]) => any), pattern: RegExp) => {
|
|
893
|
+
message: string;
|
|
894
|
+
} | undefined, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have keys matching", "to have props matching", "to have properties matching", "to have fields matching"]>, z.ZodCustom<RegExp, RegExp>]>;
|
|
895
|
+
/**
|
|
896
|
+
* Asserts that at least one own enumerable string key of a non-collection
|
|
897
|
+
* object matches a regular expression.
|
|
898
|
+
*
|
|
899
|
+
* Fails on objects with no own enumerable string keys.
|
|
900
|
+
*
|
|
901
|
+
* @remarks
|
|
902
|
+
* Only considers own enumerable string keys (equivalent to `Object.keys()`).
|
|
903
|
+
* Symbol keys and non-enumerable keys are not checked.
|
|
904
|
+
* @example
|
|
905
|
+
*
|
|
906
|
+
* ```ts
|
|
907
|
+
* expect({ foo: 1, BAR: 2 }, 'to have a key matching', /^[a-z]+$/); // passes
|
|
908
|
+
* expect({ foo: 1, BAR: 2 }, 'to have a prop matching', /^[a-z]+$/); // alias
|
|
909
|
+
* expect({ foo: 1, BAR: 2 }, 'to have a field matching', /^[a-z]+$/); // alias
|
|
910
|
+
* expect({ FOO: 1, BAR: 2 }, 'to have a key matching', /^[a-z]+$/); // fails
|
|
911
|
+
* expect({ foo: 1 }, 'to have key matching', /foo/); // passes
|
|
912
|
+
* ```
|
|
913
|
+
*
|
|
914
|
+
* @function
|
|
915
|
+
* @group Collection Assertions
|
|
916
|
+
* @bupkisAnchor object-to-have-a-key-matching-regexp
|
|
917
|
+
* @bupkisAssertionCategory object
|
|
918
|
+
*/
|
|
919
|
+
export declare const objectHasKeyMatchingAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, readonly ["to have a key matching", "to have key matching", "to have a prop matching", "to have prop matching", "to have a property matching", "to have property matching", "to have a field matching", "to have field matching"], z.ZodCustom<RegExp, RegExp>], (subject: Record<PropertyKey, unknown> | ((...args: any[]) => any), pattern: RegExp) => {
|
|
920
|
+
message: string;
|
|
921
|
+
} | undefined, readonly [z.ZodCustom<Record<PropertyKey, unknown> | ((...args: any[]) => any), Record<PropertyKey, unknown> | ((...args: any[]) => any)>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to have a key matching", "to have key matching", "to have a prop matching", "to have prop matching", "to have a property matching", "to have property matching", "to have a field matching", "to have field matching"]>, z.ZodCustom<RegExp, RegExp>]>;
|
|
922
|
+
//# sourceMappingURL=sync-collection.d.ts.map
|