bupkis 0.18.1 → 0.18.2
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 +7 -0
- package/package.json +1 -4
- package/src/assertion/assertion-types.ts +4 -4
- package/src/assertion/impl/sync-parametric.ts +1 -1
- package/src/expect.ts +0 -4
- package/src/guards.ts +24 -24
- package/src/internal-schema.ts +16 -32
- package/src/value-to-schema.ts +1 -1
- package/dist/assertion/assertion-async.cjs +0 -268
- package/dist/assertion/assertion-async.cjs.map +0 -1
- package/dist/assertion/assertion-async.d.cts +0 -40
- package/dist/assertion/assertion-async.d.cts.map +0 -1
- package/dist/assertion/assertion-async.d.ts +0 -40
- package/dist/assertion/assertion-async.d.ts.map +0 -1
- package/dist/assertion/assertion-async.js +0 -259
- package/dist/assertion/assertion-async.js.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.cjs +0 -132
- package/dist/assertion/assertion-standard-schema-async.cjs.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.d.cts +0 -52
- package/dist/assertion/assertion-standard-schema-async.d.cts.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.d.ts +0 -52
- package/dist/assertion/assertion-standard-schema-async.d.ts.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.js +0 -128
- package/dist/assertion/assertion-standard-schema-async.js.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.cjs +0 -141
- package/dist/assertion/assertion-standard-schema-sync.cjs.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.d.cts +0 -52
- package/dist/assertion/assertion-standard-schema-sync.d.cts.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.d.ts +0 -52
- package/dist/assertion/assertion-standard-schema-sync.d.ts.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.js +0 -137
- package/dist/assertion/assertion-standard-schema-sync.js.map +0 -1
- package/dist/assertion/assertion-sync.cjs +0 -284
- package/dist/assertion/assertion-sync.cjs.map +0 -1
- package/dist/assertion/assertion-sync.d.cts +0 -60
- package/dist/assertion/assertion-sync.d.cts.map +0 -1
- package/dist/assertion/assertion-sync.d.ts +0 -60
- package/dist/assertion/assertion-sync.d.ts.map +0 -1
- package/dist/assertion/assertion-sync.js +0 -275
- package/dist/assertion/assertion-sync.js.map +0 -1
- package/dist/assertion/assertion-types.cjs +0 -20
- package/dist/assertion/assertion-types.cjs.map +0 -1
- package/dist/assertion/assertion-types.d.cts +0 -1086
- package/dist/assertion/assertion-types.d.cts.map +0 -1
- package/dist/assertion/assertion-types.d.ts +0 -1086
- package/dist/assertion/assertion-types.d.ts.map +0 -1
- package/dist/assertion/assertion-types.js +0 -19
- package/dist/assertion/assertion-types.js.map +0 -1
- package/dist/assertion/assertion.cjs +0 -382
- package/dist/assertion/assertion.cjs.map +0 -1
- package/dist/assertion/assertion.d.cts +0 -109
- package/dist/assertion/assertion.d.cts.map +0 -1
- package/dist/assertion/assertion.d.ts +0 -109
- package/dist/assertion/assertion.d.ts.map +0 -1
- package/dist/assertion/assertion.js +0 -375
- package/dist/assertion/assertion.js.map +0 -1
- package/dist/assertion/create.cjs +0 -148
- package/dist/assertion/create.cjs.map +0 -1
- package/dist/assertion/create.d.cts +0 -85
- package/dist/assertion/create.d.cts.map +0 -1
- package/dist/assertion/create.d.ts +0 -85
- package/dist/assertion/create.d.ts.map +0 -1
- package/dist/assertion/create.js +0 -143
- package/dist/assertion/create.js.map +0 -1
- package/dist/assertion/format-assertion-failure.cjs +0 -63
- package/dist/assertion/format-assertion-failure.cjs.map +0 -1
- package/dist/assertion/format-assertion-failure.d.cts +0 -21
- package/dist/assertion/format-assertion-failure.d.cts.map +0 -1
- package/dist/assertion/format-assertion-failure.d.ts +0 -21
- package/dist/assertion/format-assertion-failure.d.ts.map +0 -1
- package/dist/assertion/format-assertion-failure.js +0 -59
- package/dist/assertion/format-assertion-failure.js.map +0 -1
- package/dist/assertion/impl/assertion-util.cjs +0 -68
- package/dist/assertion/impl/assertion-util.cjs.map +0 -1
- package/dist/assertion/impl/assertion-util.d.cts +0 -36
- package/dist/assertion/impl/assertion-util.d.cts.map +0 -1
- package/dist/assertion/impl/assertion-util.d.ts +0 -36
- package/dist/assertion/impl/assertion-util.d.ts.map +0 -1
- package/dist/assertion/impl/assertion-util.js +0 -62
- package/dist/assertion/impl/assertion-util.js.map +0 -1
- package/dist/assertion/impl/async-iterable.cjs +0 -627
- package/dist/assertion/impl/async-iterable.cjs.map +0 -1
- package/dist/assertion/impl/async-iterable.d.cts +0 -406
- package/dist/assertion/impl/async-iterable.d.cts.map +0 -1
- package/dist/assertion/impl/async-iterable.d.ts +0 -406
- package/dist/assertion/impl/async-iterable.d.ts.map +0 -1
- package/dist/assertion/impl/async-iterable.js +0 -624
- package/dist/assertion/impl/async-iterable.js.map +0 -1
- package/dist/assertion/impl/async-parametric.cjs +0 -412
- package/dist/assertion/impl/async-parametric.cjs.map +0 -1
- package/dist/assertion/impl/async-parametric.d.cts +0 -278
- package/dist/assertion/impl/async-parametric.d.cts.map +0 -1
- package/dist/assertion/impl/async-parametric.d.ts +0 -278
- package/dist/assertion/impl/async-parametric.d.ts.map +0 -1
- package/dist/assertion/impl/async-parametric.js +0 -409
- package/dist/assertion/impl/async-parametric.js.map +0 -1
- package/dist/assertion/impl/async.cjs +0 -56
- package/dist/assertion/impl/async.cjs.map +0 -1
- package/dist/assertion/impl/async.d.cts +0 -179
- package/dist/assertion/impl/async.d.cts.map +0 -1
- package/dist/assertion/impl/async.d.ts +0 -179
- package/dist/assertion/impl/async.d.ts.map +0 -1
- package/dist/assertion/impl/async.js +0 -39
- package/dist/assertion/impl/async.js.map +0 -1
- package/dist/assertion/impl/index.cjs +0 -37
- package/dist/assertion/impl/index.cjs.map +0 -1
- package/dist/assertion/impl/index.d.cts +0 -21
- package/dist/assertion/impl/index.d.cts.map +0 -1
- package/dist/assertion/impl/index.d.ts +0 -21
- package/dist/assertion/impl/index.d.ts.map +0 -1
- package/dist/assertion/impl/index.js +0 -21
- package/dist/assertion/impl/index.js.map +0 -1
- package/dist/assertion/impl/iteration-util.cjs +0 -297
- package/dist/assertion/impl/iteration-util.cjs.map +0 -1
- package/dist/assertion/impl/iteration-util.d.cts +0 -12
- package/dist/assertion/impl/iteration-util.d.cts.map +0 -1
- package/dist/assertion/impl/iteration-util.d.ts +0 -12
- package/dist/assertion/impl/iteration-util.d.ts.map +0 -1
- package/dist/assertion/impl/iteration-util.js +0 -282
- package/dist/assertion/impl/iteration-util.js.map +0 -1
- package/dist/assertion/impl/snapshot.cjs +0 -276
- package/dist/assertion/impl/snapshot.cjs.map +0 -1
- package/dist/assertion/impl/snapshot.d.cts +0 -278
- package/dist/assertion/impl/snapshot.d.cts.map +0 -1
- package/dist/assertion/impl/snapshot.d.ts +0 -278
- package/dist/assertion/impl/snapshot.d.ts.map +0 -1
- package/dist/assertion/impl/snapshot.js +0 -273
- package/dist/assertion/impl/snapshot.js.map +0 -1
- package/dist/assertion/impl/sync-basic.cjs +0 -553
- package/dist/assertion/impl/sync-basic.cjs.map +0 -1
- package/dist/assertion/impl/sync-basic.d.cts +0 -528
- package/dist/assertion/impl/sync-basic.d.cts.map +0 -1
- package/dist/assertion/impl/sync-basic.d.ts +0 -528
- package/dist/assertion/impl/sync-basic.d.ts.map +0 -1
- package/dist/assertion/impl/sync-basic.js +0 -550
- package/dist/assertion/impl/sync-basic.js.map +0 -1
- package/dist/assertion/impl/sync-collection.cjs +0 -856
- package/dist/assertion/impl/sync-collection.cjs.map +0 -1
- package/dist/assertion/impl/sync-collection.d.cts +0 -607
- package/dist/assertion/impl/sync-collection.d.cts.map +0 -1
- package/dist/assertion/impl/sync-collection.d.ts +0 -607
- package/dist/assertion/impl/sync-collection.d.ts.map +0 -1
- package/dist/assertion/impl/sync-collection.js +0 -850
- package/dist/assertion/impl/sync-collection.js.map +0 -1
- package/dist/assertion/impl/sync-date.cjs +0 -341
- package/dist/assertion/impl/sync-date.cjs.map +0 -1
- package/dist/assertion/impl/sync-date.d.cts +0 -209
- package/dist/assertion/impl/sync-date.d.cts.map +0 -1
- package/dist/assertion/impl/sync-date.d.ts +0 -209
- package/dist/assertion/impl/sync-date.d.ts.map +0 -1
- package/dist/assertion/impl/sync-date.js +0 -338
- package/dist/assertion/impl/sync-date.js.map +0 -1
- package/dist/assertion/impl/sync-esoteric.cjs +0 -214
- package/dist/assertion/impl/sync-esoteric.cjs.map +0 -1
- package/dist/assertion/impl/sync-esoteric.d.cts +0 -191
- package/dist/assertion/impl/sync-esoteric.d.cts.map +0 -1
- package/dist/assertion/impl/sync-esoteric.d.ts +0 -191
- package/dist/assertion/impl/sync-esoteric.d.ts.map +0 -1
- package/dist/assertion/impl/sync-esoteric.js +0 -211
- package/dist/assertion/impl/sync-esoteric.js.map +0 -1
- package/dist/assertion/impl/sync-iterable.cjs +0 -512
- package/dist/assertion/impl/sync-iterable.cjs.map +0 -1
- package/dist/assertion/impl/sync-iterable.d.cts +0 -334
- package/dist/assertion/impl/sync-iterable.d.cts.map +0 -1
- package/dist/assertion/impl/sync-iterable.d.ts +0 -334
- package/dist/assertion/impl/sync-iterable.d.ts.map +0 -1
- package/dist/assertion/impl/sync-iterable.js +0 -509
- package/dist/assertion/impl/sync-iterable.js.map +0 -1
- package/dist/assertion/impl/sync-parametric.cjs +0 -805
- package/dist/assertion/impl/sync-parametric.cjs.map +0 -1
- package/dist/assertion/impl/sync-parametric.d.cts +0 -560
- package/dist/assertion/impl/sync-parametric.d.cts.map +0 -1
- package/dist/assertion/impl/sync-parametric.d.ts +0 -560
- package/dist/assertion/impl/sync-parametric.d.ts.map +0 -1
- package/dist/assertion/impl/sync-parametric.js +0 -802
- package/dist/assertion/impl/sync-parametric.js.map +0 -1
- package/dist/assertion/impl/sync.cjs +0 -214
- package/dist/assertion/impl/sync.cjs.map +0 -1
- package/dist/assertion/impl/sync.d.cts +0 -512
- package/dist/assertion/impl/sync.d.cts.map +0 -1
- package/dist/assertion/impl/sync.d.ts +0 -512
- package/dist/assertion/impl/sync.d.ts.map +0 -1
- package/dist/assertion/impl/sync.js +0 -197
- package/dist/assertion/impl/sync.js.map +0 -1
- package/dist/assertion/index.cjs +0 -38
- package/dist/assertion/index.cjs.map +0 -1
- package/dist/assertion/index.d.cts +0 -18
- package/dist/assertion/index.d.cts.map +0 -1
- package/dist/assertion/index.d.ts +0 -18
- package/dist/assertion/index.d.ts.map +0 -1
- package/dist/assertion/index.js +0 -17
- package/dist/assertion/index.js.map +0 -1
- package/dist/assertion/slotify.cjs +0 -165
- package/dist/assertion/slotify.cjs.map +0 -1
- package/dist/assertion/slotify.d.cts +0 -11
- package/dist/assertion/slotify.d.cts.map +0 -1
- package/dist/assertion/slotify.d.ts +0 -11
- package/dist/assertion/slotify.d.ts.map +0 -1
- package/dist/assertion/slotify.js +0 -161
- package/dist/assertion/slotify.js.map +0 -1
- package/dist/bootstrap.cjs +0 -43
- package/dist/bootstrap.cjs.map +0 -1
- package/dist/bootstrap.d.cts +0 -27
- package/dist/bootstrap.d.cts.map +0 -1
- package/dist/bootstrap.d.ts +0 -27
- package/dist/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap.js +0 -40
- package/dist/bootstrap.js.map +0 -1
- package/dist/constant.cjs +0 -82
- package/dist/constant.cjs.map +0 -1
- package/dist/constant.d.cts +0 -69
- package/dist/constant.d.cts.map +0 -1
- package/dist/constant.d.ts +0 -69
- package/dist/constant.d.ts.map +0 -1
- package/dist/constant.js +0 -79
- package/dist/constant.js.map +0 -1
- package/dist/diff.cjs +0 -340
- package/dist/diff.cjs.map +0 -1
- package/dist/diff.d.cts +0 -51
- package/dist/diff.d.cts.map +0 -1
- package/dist/diff.d.ts +0 -51
- package/dist/diff.d.ts.map +0 -1
- package/dist/diff.js +0 -334
- package/dist/diff.js.map +0 -1
- package/dist/error.cjs +0 -204
- package/dist/error.cjs.map +0 -1
- package/dist/error.d.cts +0 -212
- package/dist/error.d.cts.map +0 -1
- package/dist/error.d.ts +0 -212
- package/dist/error.d.ts.map +0 -1
- package/dist/error.js +0 -191
- package/dist/error.js.map +0 -1
- package/dist/expect.cjs +0 -590
- package/dist/expect.cjs.map +0 -1
- package/dist/expect.d.cts +0 -138
- package/dist/expect.d.cts.map +0 -1
- package/dist/expect.d.ts +0 -138
- package/dist/expect.d.ts.map +0 -1
- package/dist/expect.js +0 -582
- package/dist/expect.js.map +0 -1
- package/dist/guards.cjs +0 -297
- package/dist/guards.cjs.map +0 -1
- package/dist/guards.d.cts +0 -231
- package/dist/guards.d.cts.map +0 -1
- package/dist/guards.d.ts +0 -231
- package/dist/guards.d.ts.map +0 -1
- package/dist/guards.js +0 -277
- package/dist/guards.js.map +0 -1
- package/dist/index.cjs +0 -111
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -448
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts +0 -448
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -71
- package/dist/index.js.map +0 -1
- package/dist/internal-schema.cjs +0 -253
- package/dist/internal-schema.cjs.map +0 -1
- package/dist/internal-schema.d.cts +0 -8
- package/dist/internal-schema.d.cts.map +0 -1
- package/dist/internal-schema.d.ts +0 -8
- package/dist/internal-schema.d.ts.map +0 -1
- package/dist/internal-schema.js +0 -248
- package/dist/internal-schema.js.map +0 -1
- package/dist/metadata.cjs +0 -57
- package/dist/metadata.cjs.map +0 -1
- package/dist/metadata.d.cts +0 -27
- package/dist/metadata.d.cts.map +0 -1
- package/dist/metadata.d.ts +0 -27
- package/dist/metadata.d.ts.map +0 -1
- package/dist/metadata.js +0 -54
- package/dist/metadata.js.map +0 -1
- package/dist/schema.cjs +0 -1522
- package/dist/schema.cjs.map +0 -1
- package/dist/schema.d.cts +0 -1196
- package/dist/schema.d.cts.map +0 -1
- package/dist/schema.d.ts +0 -1196
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -1516
- package/dist/schema.js.map +0 -1
- package/dist/snapshot/adapter.cjs +0 -31
- package/dist/snapshot/adapter.cjs.map +0 -1
- package/dist/snapshot/adapter.d.cts +0 -258
- package/dist/snapshot/adapter.d.cts.map +0 -1
- package/dist/snapshot/adapter.d.ts +0 -258
- package/dist/snapshot/adapter.d.ts.map +0 -1
- package/dist/snapshot/adapter.js +0 -27
- package/dist/snapshot/adapter.js.map +0 -1
- package/dist/snapshot/adapters/fallback.cjs +0 -453
- package/dist/snapshot/adapters/fallback.cjs.map +0 -1
- package/dist/snapshot/adapters/fallback.d.cts +0 -185
- package/dist/snapshot/adapters/fallback.d.cts.map +0 -1
- package/dist/snapshot/adapters/fallback.d.ts +0 -185
- package/dist/snapshot/adapters/fallback.d.ts.map +0 -1
- package/dist/snapshot/adapters/fallback.js +0 -446
- package/dist/snapshot/adapters/fallback.js.map +0 -1
- package/dist/snapshot/adapters/node-test.cjs +0 -301
- package/dist/snapshot/adapters/node-test.cjs.map +0 -1
- package/dist/snapshot/adapters/node-test.d.cts +0 -131
- package/dist/snapshot/adapters/node-test.d.cts.map +0 -1
- package/dist/snapshot/adapters/node-test.d.ts +0 -131
- package/dist/snapshot/adapters/node-test.d.ts.map +0 -1
- package/dist/snapshot/adapters/node-test.js +0 -297
- package/dist/snapshot/adapters/node-test.js.map +0 -1
- package/dist/snapshot/index.cjs +0 -61
- package/dist/snapshot/index.cjs.map +0 -1
- package/dist/snapshot/index.d.cts +0 -40
- package/dist/snapshot/index.d.cts.map +0 -1
- package/dist/snapshot/index.d.ts +0 -40
- package/dist/snapshot/index.d.ts.map +0 -1
- package/dist/snapshot/index.js +0 -44
- package/dist/snapshot/index.js.map +0 -1
- package/dist/snapshot/node-version.cjs +0 -49
- package/dist/snapshot/node-version.cjs.map +0 -1
- package/dist/snapshot/node-version.d.cts +0 -34
- package/dist/snapshot/node-version.d.cts.map +0 -1
- package/dist/snapshot/node-version.d.ts +0 -34
- package/dist/snapshot/node-version.d.ts.map +0 -1
- package/dist/snapshot/node-version.js +0 -44
- package/dist/snapshot/node-version.js.map +0 -1
- package/dist/snapshot/select-adapter.cjs +0 -170
- package/dist/snapshot/select-adapter.cjs.map +0 -1
- package/dist/snapshot/select-adapter.d.cts +0 -128
- package/dist/snapshot/select-adapter.d.cts.map +0 -1
- package/dist/snapshot/select-adapter.d.ts +0 -128
- package/dist/snapshot/select-adapter.d.ts.map +0 -1
- package/dist/snapshot/select-adapter.js +0 -164
- package/dist/snapshot/select-adapter.js.map +0 -1
- package/dist/snapshot/serializer.cjs +0 -246
- package/dist/snapshot/serializer.cjs.map +0 -1
- package/dist/snapshot/serializer.d.cts +0 -126
- package/dist/snapshot/serializer.d.cts.map +0 -1
- package/dist/snapshot/serializer.d.ts +0 -126
- package/dist/snapshot/serializer.d.ts.map +0 -1
- package/dist/snapshot/serializer.js +0 -238
- package/dist/snapshot/serializer.js.map +0 -1
- package/dist/standard-schema.cjs +0 -13
- package/dist/standard-schema.cjs.map +0 -1
- package/dist/standard-schema.d.cts +0 -192
- package/dist/standard-schema.d.cts.map +0 -1
- package/dist/standard-schema.d.ts +0 -192
- package/dist/standard-schema.d.ts.map +0 -1
- package/dist/standard-schema.js +0 -12
- package/dist/standard-schema.js.map +0 -1
- package/dist/types.cjs +0 -22
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts +0 -905
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.ts +0 -905
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -21
- package/dist/types.js.map +0 -1
- package/dist/use.cjs +0 -240
- package/dist/use.cjs.map +0 -1
- package/dist/use.d.cts +0 -8
- package/dist/use.d.cts.map +0 -1
- package/dist/use.d.ts +0 -8
- package/dist/use.d.ts.map +0 -1
- package/dist/use.js +0 -236
- package/dist/use.js.map +0 -1
- package/dist/util.cjs +0 -255
- package/dist/util.cjs.map +0 -1
- package/dist/util.d.cts +0 -141
- package/dist/util.d.cts.map +0 -1
- package/dist/util.d.ts +0 -141
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -234
- package/dist/util.js.map +0 -1
- package/dist/value-to-schema.cjs +0 -537
- package/dist/value-to-schema.cjs.map +0 -1
- package/dist/value-to-schema.d.cts +0 -144
- package/dist/value-to-schema.d.cts.map +0 -1
- package/dist/value-to-schema.d.ts +0 -144
- package/dist/value-to-schema.d.ts.map +0 -1
- package/dist/value-to-schema.js +0 -533
- package/dist/value-to-schema.js.map +0 -1
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides {@link slotify}, which converts {@link AssertionParts} (phrases, Zod
|
|
3
|
-
* schemas) into {@link AssertionSlots} (Zod schemas only).
|
|
4
|
-
*
|
|
5
|
-
* `AssertionSlots` are used to match assertions against arguments to
|
|
6
|
-
* `expect()`.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import { inspect } from 'util';
|
|
11
|
-
import { z } from 'zod';
|
|
12
|
-
import { kStringLiteral } from "../constant.js";
|
|
13
|
-
import { AssertionImplementationError } from "../error.js";
|
|
14
|
-
import { isPhrase, isPhraseLiteral, isPhraseLiteralChoice, isStandardSchema, isZodType, } from "../guards.js";
|
|
15
|
-
import { BupkisRegistry } from "../metadata.js";
|
|
16
|
-
/**
|
|
17
|
-
* This cache saves previously-computed _slotifications_ to speed up
|
|
18
|
-
* `createAssertion`/`createAsyncAssertion`. While these are unlikely to be
|
|
19
|
-
* called repeatedly with the same values, it's still extra work that doesn't
|
|
20
|
-
* need to be done more than once.
|
|
21
|
-
*/
|
|
22
|
-
const slotifyCache = new WeakMap();
|
|
23
|
-
/**
|
|
24
|
-
* Cache for phrase literal schemas to avoid recreating identical Zod schemas.
|
|
25
|
-
* This significantly reduces the "Definition (core.js)" overhead seen in flame
|
|
26
|
-
* graphs since phrase literals like 'to be a string' are reused across many
|
|
27
|
-
* assertions.
|
|
28
|
-
*/
|
|
29
|
-
const phraseLiteralSchemaCache = new Map();
|
|
30
|
-
/**
|
|
31
|
-
* Cache for phrase literal choice schemas to avoid recreating identical Zod
|
|
32
|
-
* schemas. This optimizes cases where multiple phrase options like ['to be a',
|
|
33
|
-
* 'to be an'] are reused across different assertions.
|
|
34
|
-
*/
|
|
35
|
-
const phraseLiteralChoiceSchemaCache = new Map();
|
|
36
|
-
/**
|
|
37
|
-
* Builds slots out of assertion parts.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* This function converts {@link AssertionParts} into {@link AssertionSlots} by
|
|
41
|
-
* processing string literals and Zod schemas, registering metadata for runtime
|
|
42
|
-
* introspection, and handling validation constraints such as preventing "not "
|
|
43
|
-
* prefixes in string literal parts.
|
|
44
|
-
* @function
|
|
45
|
-
* @param parts Assertion parts
|
|
46
|
-
* @returns Slots
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
export const slotify = (parts) => {
|
|
50
|
-
if (slotifyCache.has(parts)) {
|
|
51
|
-
// Safe cast: cache key is the exact same `parts` reference
|
|
52
|
-
return slotifyCache.get(parts);
|
|
53
|
-
}
|
|
54
|
-
const slots = parts.flatMap((part, index) => {
|
|
55
|
-
const result = [];
|
|
56
|
-
if (index === 0 && isPhrase(part)) {
|
|
57
|
-
result.push(z.unknown().meta({ description: 'subject' }));
|
|
58
|
-
}
|
|
59
|
-
if (isPhraseLiteralChoice(part)) {
|
|
60
|
-
if (part.some((p) => p.startsWith('not '))) {
|
|
61
|
-
throw new AssertionImplementationError(`PhraseLiteralChoice at parts[${index}] must not include phrases starting with "not "; refactor to be a positive assertion: ${inspect(part)}`);
|
|
62
|
-
}
|
|
63
|
-
result.push(createPhraseLiteralChoiceSchema(part));
|
|
64
|
-
}
|
|
65
|
-
else if (isPhraseLiteral(part)) {
|
|
66
|
-
if (part.startsWith('not ')) {
|
|
67
|
-
throw new AssertionImplementationError(`PhraseLiteral at parts[${index}] must not start with "not "; refactor to be a positive assertion: ${inspect(part)}`);
|
|
68
|
-
}
|
|
69
|
-
result.push(createPhraseLiteralSchema(part));
|
|
70
|
-
}
|
|
71
|
-
else if (typeof part === 'string' && part === 'and') {
|
|
72
|
-
// Special case: "and" is allowed when followed by a schema (Zod or Standard Schema)
|
|
73
|
-
const nextPart = parts[index + 1];
|
|
74
|
-
if (index + 1 >= parts.length ||
|
|
75
|
-
!(isZodType(nextPart) || isStandardSchema(nextPart))) {
|
|
76
|
-
throw new AssertionImplementationError(`"and" at parts[${index}] must be followed by a schema but was followed by ${index + 1 >= parts.length
|
|
77
|
-
? 'nothing'
|
|
78
|
-
: `${inspect(nextPart)} (${typeof nextPart})`}`);
|
|
79
|
-
}
|
|
80
|
-
result.push(createPhraseLiteralSchema(part));
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
// Schema parts: either Zod or Standard Schema
|
|
84
|
-
if (isZodType(part)) {
|
|
85
|
-
result.push(part);
|
|
86
|
-
}
|
|
87
|
-
else if (isStandardSchema(part)) {
|
|
88
|
-
// Convert Standard Schema to Zod schema for slotification
|
|
89
|
-
// Slots use Zod's safeParse, so we need a Zod wrapper
|
|
90
|
-
const zodWrapper = z.custom((value) => {
|
|
91
|
-
const validationResult = part['~standard'].validate(value);
|
|
92
|
-
// Must be synchronous for slots
|
|
93
|
-
if (validationResult instanceof Promise) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
return !validationResult.issues;
|
|
97
|
-
}, { error: `Failed Standard Schema validation` });
|
|
98
|
-
result.push(zodWrapper);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
throw new AssertionImplementationError(`Expected schema, phrase literal, or phrase literal choice at parts[${index}] but received ${inspect(part)} (${typeof part})`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return result;
|
|
105
|
-
});
|
|
106
|
-
slotifyCache.set(parts, slots);
|
|
107
|
-
return slots;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Creates a schema for a choice of phrase literals
|
|
111
|
-
*
|
|
112
|
-
* This schema is a branded literal schema to differentiate regular strings from
|
|
113
|
-
* phrases.
|
|
114
|
-
*
|
|
115
|
-
* @function
|
|
116
|
-
* @param part Phrase literal choice (tuple of strings)
|
|
117
|
-
* @returns Schema
|
|
118
|
-
*/
|
|
119
|
-
const createPhraseLiteralChoiceSchema = (part) => {
|
|
120
|
-
// Check cache first to avoid recreating identical schemas
|
|
121
|
-
if (phraseLiteralChoiceSchemaCache.has(part)) {
|
|
122
|
-
return phraseLiteralChoiceSchemaCache.get(part);
|
|
123
|
-
}
|
|
124
|
-
const schema = z
|
|
125
|
-
.literal(part)
|
|
126
|
-
.brand('string-literal')
|
|
127
|
-
.register(BupkisRegistry, {
|
|
128
|
-
[kStringLiteral]: true,
|
|
129
|
-
values: part,
|
|
130
|
-
});
|
|
131
|
-
// Cache the schema for future use
|
|
132
|
-
phraseLiteralChoiceSchemaCache.set(part, schema);
|
|
133
|
-
return schema;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Creates a schema for a single phrase literal
|
|
137
|
-
*
|
|
138
|
-
* This schema is a branded literal schema to differentiate regular strings from
|
|
139
|
-
* phrases.
|
|
140
|
-
*
|
|
141
|
-
* @function
|
|
142
|
-
* @param part Phrase literal (string)
|
|
143
|
-
* @returns Schema
|
|
144
|
-
*/
|
|
145
|
-
const createPhraseLiteralSchema = (part) => {
|
|
146
|
-
// Check cache first to avoid recreating identical schemas
|
|
147
|
-
if (phraseLiteralSchemaCache.has(part)) {
|
|
148
|
-
return phraseLiteralSchemaCache.get(part);
|
|
149
|
-
}
|
|
150
|
-
const schema = z
|
|
151
|
-
.literal(part)
|
|
152
|
-
.brand('string-literal')
|
|
153
|
-
.register(BupkisRegistry, {
|
|
154
|
-
[kStringLiteral]: true,
|
|
155
|
-
value: part,
|
|
156
|
-
});
|
|
157
|
-
// Cache the schema for future use
|
|
158
|
-
phraseLiteralSchemaCache.set(part, schema);
|
|
159
|
-
return schema;
|
|
160
|
-
};
|
|
161
|
-
//# sourceMappingURL=slotify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slotify.js","sourceRoot":"","sources":["../../src/assertion/slotify.ts"],"names":[],"mappings":"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"}
|
package/dist/bootstrap.cjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Factory function for creating the main assertion functions.
|
|
4
|
-
*
|
|
5
|
-
* This module provides the {@link bootstrap} function that creates both
|
|
6
|
-
* synchronous and asynchronous assertion engines.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.expectAsync = exports.expect = void 0;
|
|
12
|
-
const index_js_1 = require("./assertion/index.cjs");
|
|
13
|
-
const use_js_1 = require("./use.cjs");
|
|
14
|
-
/**
|
|
15
|
-
* Factory function that creates both synchronous and asynchronous assertion
|
|
16
|
-
* engines.
|
|
17
|
-
*
|
|
18
|
-
* @function
|
|
19
|
-
* @returns Object containing {@link expect} and {@link expectAsync} functions
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
const bootstrap = () => {
|
|
23
|
-
const { expect, expectAsync } = (0, use_js_1.createUse)(index_js_1.SyncAssertions, index_js_1.AsyncAssertions)([...index_js_1.SyncAssertions, ...index_js_1.AsyncAssertions]);
|
|
24
|
-
return { expect, expectAsync };
|
|
25
|
-
};
|
|
26
|
-
const api = bootstrap();
|
|
27
|
-
/**
|
|
28
|
-
* The main synchronous assertion function which can execute only built-in
|
|
29
|
-
* assertions.
|
|
30
|
-
*
|
|
31
|
-
* @function
|
|
32
|
-
* @group Core API
|
|
33
|
-
*/
|
|
34
|
-
exports.expect = api.expect;
|
|
35
|
-
/**
|
|
36
|
-
* The main asynchronous assertion function which can execute only built-in
|
|
37
|
-
* assertions.
|
|
38
|
-
*
|
|
39
|
-
* @function
|
|
40
|
-
* @group Core API
|
|
41
|
-
*/
|
|
42
|
-
exports.expectAsync = api.expectAsync;
|
|
43
|
-
//# sourceMappingURL=bootstrap.js.map
|
package/dist/bootstrap.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,oDAAuE;AAEvE,sCAAqC;AAErC;;;;;;;GAOG;AACH,MAAM,SAAS,GAAG,GAGhB,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAS,EACvC,yBAAc,EACd,0BAAe,CAChB,CAAC,CAAC,GAAG,yBAAc,EAAE,GAAG,0BAAe,CAAC,CAAC,CAAC;IAE3C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;AAExB;;;;;;GAMG;AACU,QAAA,MAAM,GAAkC,GAAG,CAAC,MAAM,CAAC;AAEhE;;;;;;GAMG;AACU,QAAA,WAAW,GAAwC,GAAG,CAAC,WAAW,CAAC"}
|
package/dist/bootstrap.d.cts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory function for creating the main assertion functions.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the {@link bootstrap} function that creates both
|
|
5
|
-
* synchronous and asynchronous assertion engines.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import { AsyncAssertions, SyncAssertions } from "./assertion/index.cjs";
|
|
10
|
-
import { type Expect, type ExpectAsync } from "./types.cjs";
|
|
11
|
-
/**
|
|
12
|
-
* The main synchronous assertion function which can execute only built-in
|
|
13
|
-
* assertions.
|
|
14
|
-
*
|
|
15
|
-
* @function
|
|
16
|
-
* @group Core API
|
|
17
|
-
*/
|
|
18
|
-
export declare const expect: Expect<typeof SyncAssertions>;
|
|
19
|
-
/**
|
|
20
|
-
* The main asynchronous assertion function which can execute only built-in
|
|
21
|
-
* assertions.
|
|
22
|
-
*
|
|
23
|
-
* @function
|
|
24
|
-
* @group Core API
|
|
25
|
-
*/
|
|
26
|
-
export declare const expectAsync: ExpectAsync<typeof AsyncAssertions>;
|
|
27
|
-
//# sourceMappingURL=bootstrap.d.ts.map
|
package/dist/bootstrap.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,8BAA6B;AACvE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,oBAAmB;AAyB3D;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,OAAO,cAAc,CAAc,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,OAAO,eAAe,CAAmB,CAAC"}
|
package/dist/bootstrap.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory function for creating the main assertion functions.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the {@link bootstrap} function that creates both
|
|
5
|
-
* synchronous and asynchronous assertion engines.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import { AsyncAssertions, SyncAssertions } from "./assertion/index.js";
|
|
10
|
-
import { type Expect, type ExpectAsync } from "./types.js";
|
|
11
|
-
/**
|
|
12
|
-
* The main synchronous assertion function which can execute only built-in
|
|
13
|
-
* assertions.
|
|
14
|
-
*
|
|
15
|
-
* @function
|
|
16
|
-
* @group Core API
|
|
17
|
-
*/
|
|
18
|
-
export declare const expect: Expect<typeof SyncAssertions>;
|
|
19
|
-
/**
|
|
20
|
-
* The main asynchronous assertion function which can execute only built-in
|
|
21
|
-
* assertions.
|
|
22
|
-
*
|
|
23
|
-
* @function
|
|
24
|
-
* @group Core API
|
|
25
|
-
*/
|
|
26
|
-
export declare const expectAsync: ExpectAsync<typeof AsyncAssertions>;
|
|
27
|
-
//# sourceMappingURL=bootstrap.d.ts.map
|
package/dist/bootstrap.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,6BAA6B;AACvE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,mBAAmB;AAyB3D;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,OAAO,cAAc,CAAc,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,OAAO,eAAe,CAAmB,CAAC"}
|
package/dist/bootstrap.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory function for creating the main assertion functions.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the {@link bootstrap} function that creates both
|
|
5
|
-
* synchronous and asynchronous assertion engines.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import { AsyncAssertions, SyncAssertions } from "./assertion/index.js";
|
|
10
|
-
import { createUse } from "./use.js";
|
|
11
|
-
/**
|
|
12
|
-
* Factory function that creates both synchronous and asynchronous assertion
|
|
13
|
-
* engines.
|
|
14
|
-
*
|
|
15
|
-
* @function
|
|
16
|
-
* @returns Object containing {@link expect} and {@link expectAsync} functions
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
const bootstrap = () => {
|
|
20
|
-
const { expect, expectAsync } = createUse(SyncAssertions, AsyncAssertions)([...SyncAssertions, ...AsyncAssertions]);
|
|
21
|
-
return { expect, expectAsync };
|
|
22
|
-
};
|
|
23
|
-
const api = bootstrap();
|
|
24
|
-
/**
|
|
25
|
-
* The main synchronous assertion function which can execute only built-in
|
|
26
|
-
* assertions.
|
|
27
|
-
*
|
|
28
|
-
* @function
|
|
29
|
-
* @group Core API
|
|
30
|
-
*/
|
|
31
|
-
export const expect = api.expect;
|
|
32
|
-
/**
|
|
33
|
-
* The main asynchronous assertion function which can execute only built-in
|
|
34
|
-
* assertions.
|
|
35
|
-
*
|
|
36
|
-
* @function
|
|
37
|
-
* @group Core API
|
|
38
|
-
*/
|
|
39
|
-
export const expectAsync = api.expectAsync;
|
|
40
|
-
//# sourceMappingURL=bootstrap.js.map
|
package/dist/bootstrap.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,6BAA6B;AAEvE,OAAO,EAAE,SAAS,EAAE,iBAAiB;AAErC;;;;;;;GAOG;AACH,MAAM,SAAS,GAAG,GAGhB,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CACvC,cAAc,EACd,eAAe,CAChB,CAAC,CAAC,GAAG,cAAc,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC;IAE3C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAkC,GAAG,CAAC,MAAM,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAwC,GAAG,CAAC,WAAW,CAAC"}
|
package/dist/constant.cjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Shared constants and symbols used throughout the library.
|
|
4
|
-
*
|
|
5
|
-
* This module defines unique symbols and constants that are used internally for
|
|
6
|
-
* marking and identifying special values and types within the assertion
|
|
7
|
-
* system.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.DAY_NAMES = exports.FAIL = exports.kBupkisError = exports.KEYPATH_REGEX = exports.kExpectIt = exports.kBupkisNegatedAssertionError = exports.kBupkisFailAssertionError = exports.kBupkisAssertionError = exports.kStringLiteral = void 0;
|
|
14
|
-
const { freeze } = Object;
|
|
15
|
-
const { for: symbolFor } = Symbol;
|
|
16
|
-
/**
|
|
17
|
-
* Symbol flagging the value as a Bupkis-created string literal, which will be
|
|
18
|
-
* omitted from the parameters to an `AssertionImpl`.
|
|
19
|
-
*/
|
|
20
|
-
exports.kStringLiteral = symbolFor('bupkis-string-literal');
|
|
21
|
-
/**
|
|
22
|
-
* Symbol used to flag an `AssertionError` as our own.
|
|
23
|
-
*
|
|
24
|
-
* Uses `symbolFor()` to ensure the symbol is shared across module instances,
|
|
25
|
-
* which is important in monorepo setups where the same package may be loaded
|
|
26
|
-
* from different paths.
|
|
27
|
-
*/
|
|
28
|
-
exports.kBupkisAssertionError = symbolFor('bupkis-assertion-error');
|
|
29
|
-
/**
|
|
30
|
-
* Symbol used to flag a `FailAssertionError`
|
|
31
|
-
*/
|
|
32
|
-
exports.kBupkisFailAssertionError = symbolFor('bupkis-fail-assertion-error');
|
|
33
|
-
/**
|
|
34
|
-
* Symbol used to flag a `NegatedAssertionError`
|
|
35
|
-
*/
|
|
36
|
-
exports.kBupkisNegatedAssertionError = symbolFor('bupkis-negated-assertion-error');
|
|
37
|
-
/**
|
|
38
|
-
* Symbol used to flag a function as an `expect.it` executor.
|
|
39
|
-
*/
|
|
40
|
-
exports.kExpectIt = symbolFor('bupkis-expect-it');
|
|
41
|
-
/**
|
|
42
|
-
* Regular expression that matches valid keypath syntax.
|
|
43
|
-
*
|
|
44
|
-
* Matches patterns like:
|
|
45
|
-
*
|
|
46
|
-
* - Simple identifiers: `foo`
|
|
47
|
-
* - Dot notation: `foo.bar`, `foo.bar.baz`
|
|
48
|
-
* - Bracket notation with numbers: `foo[0]`, `bar[123]`
|
|
49
|
-
* - Bracket notation with quoted strings: `foo["key"]`, `bar['prop']`
|
|
50
|
-
* - Mixed notation: `foo.bar[0].baz`, `obj[0]["key"].prop`
|
|
51
|
-
*
|
|
52
|
-
* The regex breaks down as:
|
|
53
|
-
*
|
|
54
|
-
* - `^[a-zA-Z_$][a-zA-Z0-9_$]*` - Valid identifier start
|
|
55
|
-
* - `(?:` - Non-capturing group for additional segments
|
|
56
|
-
*
|
|
57
|
-
* - `\.` - Dot followed by identifier
|
|
58
|
-
* - `|` - OR
|
|
59
|
-
* - `\[(?:\d+|"[^"]*"|'[^']*')\]` - Bracket notation (number or quoted string)
|
|
60
|
-
* - `)*$` - Zero or more additional segments, end of string
|
|
61
|
-
*
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
exports.KEYPATH_REGEX = /^[a-zA-Z_$][-a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][-a-zA-Z0-9_$]*)|(?:\[(?:\d+|"[^"]*"|'[^']*')\]))*$/;
|
|
65
|
-
/**
|
|
66
|
-
* Symbol used to flag a function as a Bupkis-thrown error.
|
|
67
|
-
*/
|
|
68
|
-
exports.kBupkisError = symbolFor('bupkis-error');
|
|
69
|
-
/**
|
|
70
|
-
* Assertion ID of a `FailAssertionError`.
|
|
71
|
-
*/
|
|
72
|
-
exports.FAIL = 'FAIL';
|
|
73
|
-
exports.DAY_NAMES = freeze([
|
|
74
|
-
'Sunday',
|
|
75
|
-
'Monday',
|
|
76
|
-
'Tuesday',
|
|
77
|
-
'Wednesday',
|
|
78
|
-
'Thursday',
|
|
79
|
-
'Friday',
|
|
80
|
-
'Saturday',
|
|
81
|
-
]);
|
|
82
|
-
//# sourceMappingURL=constant.js.map
|
package/dist/constant.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAC1B,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;AAElC;;;GAGG;AAEU,QAAA,cAAc,GAAW,SAAS,CAAC,uBAAuB,CAAC,CAAC;AAEzE;;;;;;GAMG;AAEU,QAAA,qBAAqB,GAAW,SAAS,CACpD,wBAAwB,CACzB,CAAC;AAEF;;GAEG;AACU,QAAA,yBAAyB,GAAW,SAAS,CACxD,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AAEU,QAAA,4BAA4B,GAAW,SAAS,CAC3D,gCAAgC,CACjC,CAAC;AAEF;;GAEG;AACU,QAAA,SAAS,GAAW,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEU,QAAA,aAAa,GACxB,iGAAiG,CAAC;AAEpG;;GAEG;AACU,QAAA,YAAY,GAAW,SAAS,CAAC,cAAc,CAAC,CAAC;AAE9D;;GAEG;AACU,QAAA,IAAI,GAAG,MAAe,CAAC;AAEvB,QAAA,SAAS,GAAG,MAAM,CAAC;IAC9B,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACF,CAAC,CAAC"}
|
package/dist/constant.d.cts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared constants and symbols used throughout the library.
|
|
3
|
-
*
|
|
4
|
-
* This module defines unique symbols and constants that are used internally for
|
|
5
|
-
* marking and identifying special values and types within the assertion
|
|
6
|
-
* system.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Symbol flagging the value as a Bupkis-created string literal, which will be
|
|
13
|
-
* omitted from the parameters to an `AssertionImpl`.
|
|
14
|
-
*/
|
|
15
|
-
export declare const kStringLiteral: symbol;
|
|
16
|
-
/**
|
|
17
|
-
* Symbol used to flag an `AssertionError` as our own.
|
|
18
|
-
*
|
|
19
|
-
* Uses `symbolFor()` to ensure the symbol is shared across module instances,
|
|
20
|
-
* which is important in monorepo setups where the same package may be loaded
|
|
21
|
-
* from different paths.
|
|
22
|
-
*/
|
|
23
|
-
export declare const kBupkisAssertionError: symbol;
|
|
24
|
-
/**
|
|
25
|
-
* Symbol used to flag a `FailAssertionError`
|
|
26
|
-
*/
|
|
27
|
-
export declare const kBupkisFailAssertionError: symbol;
|
|
28
|
-
/**
|
|
29
|
-
* Symbol used to flag a `NegatedAssertionError`
|
|
30
|
-
*/
|
|
31
|
-
export declare const kBupkisNegatedAssertionError: symbol;
|
|
32
|
-
/**
|
|
33
|
-
* Symbol used to flag a function as an `expect.it` executor.
|
|
34
|
-
*/
|
|
35
|
-
export declare const kExpectIt: symbol;
|
|
36
|
-
/**
|
|
37
|
-
* Regular expression that matches valid keypath syntax.
|
|
38
|
-
*
|
|
39
|
-
* Matches patterns like:
|
|
40
|
-
*
|
|
41
|
-
* - Simple identifiers: `foo`
|
|
42
|
-
* - Dot notation: `foo.bar`, `foo.bar.baz`
|
|
43
|
-
* - Bracket notation with numbers: `foo[0]`, `bar[123]`
|
|
44
|
-
* - Bracket notation with quoted strings: `foo["key"]`, `bar['prop']`
|
|
45
|
-
* - Mixed notation: `foo.bar[0].baz`, `obj[0]["key"].prop`
|
|
46
|
-
*
|
|
47
|
-
* The regex breaks down as:
|
|
48
|
-
*
|
|
49
|
-
* - `^[a-zA-Z_$][a-zA-Z0-9_$]*` - Valid identifier start
|
|
50
|
-
* - `(?:` - Non-capturing group for additional segments
|
|
51
|
-
*
|
|
52
|
-
* - `\.` - Dot followed by identifier
|
|
53
|
-
* - `|` - OR
|
|
54
|
-
* - `\[(?:\d+|"[^"]*"|'[^']*')\]` - Bracket notation (number or quoted string)
|
|
55
|
-
* - `)*$` - Zero or more additional segments, end of string
|
|
56
|
-
*
|
|
57
|
-
* @public
|
|
58
|
-
*/
|
|
59
|
-
export declare const KEYPATH_REGEX: RegExp;
|
|
60
|
-
/**
|
|
61
|
-
* Symbol used to flag a function as a Bupkis-thrown error.
|
|
62
|
-
*/
|
|
63
|
-
export declare const kBupkisError: symbol;
|
|
64
|
-
/**
|
|
65
|
-
* Assertion ID of a `FailAssertionError`.
|
|
66
|
-
*/
|
|
67
|
-
export declare const FAIL: "FAIL";
|
|
68
|
-
export declare const DAY_NAMES: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
69
|
-
//# sourceMappingURL=constant.d.ts.map
|
package/dist/constant.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH;;;GAGG;AAEH,eAAO,MAAM,cAAc,EAAE,MAA2C,CAAC;AAEzE;;;;;;GAMG;AAEH,eAAO,MAAM,qBAAqB,EAAE,MAEnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,4BAA4B,EAAE,MAE1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,eAAO,MAAM,aAAa,QACyE,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAkC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,SAAS,yFAQX,CAAC"}
|
package/dist/constant.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared constants and symbols used throughout the library.
|
|
3
|
-
*
|
|
4
|
-
* This module defines unique symbols and constants that are used internally for
|
|
5
|
-
* marking and identifying special values and types within the assertion
|
|
6
|
-
* system.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Symbol flagging the value as a Bupkis-created string literal, which will be
|
|
13
|
-
* omitted from the parameters to an `AssertionImpl`.
|
|
14
|
-
*/
|
|
15
|
-
export declare const kStringLiteral: symbol;
|
|
16
|
-
/**
|
|
17
|
-
* Symbol used to flag an `AssertionError` as our own.
|
|
18
|
-
*
|
|
19
|
-
* Uses `symbolFor()` to ensure the symbol is shared across module instances,
|
|
20
|
-
* which is important in monorepo setups where the same package may be loaded
|
|
21
|
-
* from different paths.
|
|
22
|
-
*/
|
|
23
|
-
export declare const kBupkisAssertionError: symbol;
|
|
24
|
-
/**
|
|
25
|
-
* Symbol used to flag a `FailAssertionError`
|
|
26
|
-
*/
|
|
27
|
-
export declare const kBupkisFailAssertionError: symbol;
|
|
28
|
-
/**
|
|
29
|
-
* Symbol used to flag a `NegatedAssertionError`
|
|
30
|
-
*/
|
|
31
|
-
export declare const kBupkisNegatedAssertionError: symbol;
|
|
32
|
-
/**
|
|
33
|
-
* Symbol used to flag a function as an `expect.it` executor.
|
|
34
|
-
*/
|
|
35
|
-
export declare const kExpectIt: symbol;
|
|
36
|
-
/**
|
|
37
|
-
* Regular expression that matches valid keypath syntax.
|
|
38
|
-
*
|
|
39
|
-
* Matches patterns like:
|
|
40
|
-
*
|
|
41
|
-
* - Simple identifiers: `foo`
|
|
42
|
-
* - Dot notation: `foo.bar`, `foo.bar.baz`
|
|
43
|
-
* - Bracket notation with numbers: `foo[0]`, `bar[123]`
|
|
44
|
-
* - Bracket notation with quoted strings: `foo["key"]`, `bar['prop']`
|
|
45
|
-
* - Mixed notation: `foo.bar[0].baz`, `obj[0]["key"].prop`
|
|
46
|
-
*
|
|
47
|
-
* The regex breaks down as:
|
|
48
|
-
*
|
|
49
|
-
* - `^[a-zA-Z_$][a-zA-Z0-9_$]*` - Valid identifier start
|
|
50
|
-
* - `(?:` - Non-capturing group for additional segments
|
|
51
|
-
*
|
|
52
|
-
* - `\.` - Dot followed by identifier
|
|
53
|
-
* - `|` - OR
|
|
54
|
-
* - `\[(?:\d+|"[^"]*"|'[^']*')\]` - Bracket notation (number or quoted string)
|
|
55
|
-
* - `)*$` - Zero or more additional segments, end of string
|
|
56
|
-
*
|
|
57
|
-
* @public
|
|
58
|
-
*/
|
|
59
|
-
export declare const KEYPATH_REGEX: RegExp;
|
|
60
|
-
/**
|
|
61
|
-
* Symbol used to flag a function as a Bupkis-thrown error.
|
|
62
|
-
*/
|
|
63
|
-
export declare const kBupkisError: symbol;
|
|
64
|
-
/**
|
|
65
|
-
* Assertion ID of a `FailAssertionError`.
|
|
66
|
-
*/
|
|
67
|
-
export declare const FAIL: "FAIL";
|
|
68
|
-
export declare const DAY_NAMES: readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
69
|
-
//# sourceMappingURL=constant.d.ts.map
|
package/dist/constant.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH;;;GAGG;AAEH,eAAO,MAAM,cAAc,EAAE,MAA2C,CAAC;AAEzE;;;;;;GAMG;AAEH,eAAO,MAAM,qBAAqB,EAAE,MAEnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,4BAA4B,EAAE,MAE1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,eAAO,MAAM,aAAa,QACyE,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAkC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,SAAS,yFAQX,CAAC"}
|
package/dist/constant.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared constants and symbols used throughout the library.
|
|
3
|
-
*
|
|
4
|
-
* This module defines unique symbols and constants that are used internally for
|
|
5
|
-
* marking and identifying special values and types within the assertion
|
|
6
|
-
* system.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
const { freeze } = Object;
|
|
12
|
-
const { for: symbolFor } = Symbol;
|
|
13
|
-
/**
|
|
14
|
-
* Symbol flagging the value as a Bupkis-created string literal, which will be
|
|
15
|
-
* omitted from the parameters to an `AssertionImpl`.
|
|
16
|
-
*/
|
|
17
|
-
export const kStringLiteral = symbolFor('bupkis-string-literal');
|
|
18
|
-
/**
|
|
19
|
-
* Symbol used to flag an `AssertionError` as our own.
|
|
20
|
-
*
|
|
21
|
-
* Uses `symbolFor()` to ensure the symbol is shared across module instances,
|
|
22
|
-
* which is important in monorepo setups where the same package may be loaded
|
|
23
|
-
* from different paths.
|
|
24
|
-
*/
|
|
25
|
-
export const kBupkisAssertionError = symbolFor('bupkis-assertion-error');
|
|
26
|
-
/**
|
|
27
|
-
* Symbol used to flag a `FailAssertionError`
|
|
28
|
-
*/
|
|
29
|
-
export const kBupkisFailAssertionError = symbolFor('bupkis-fail-assertion-error');
|
|
30
|
-
/**
|
|
31
|
-
* Symbol used to flag a `NegatedAssertionError`
|
|
32
|
-
*/
|
|
33
|
-
export const kBupkisNegatedAssertionError = symbolFor('bupkis-negated-assertion-error');
|
|
34
|
-
/**
|
|
35
|
-
* Symbol used to flag a function as an `expect.it` executor.
|
|
36
|
-
*/
|
|
37
|
-
export const kExpectIt = symbolFor('bupkis-expect-it');
|
|
38
|
-
/**
|
|
39
|
-
* Regular expression that matches valid keypath syntax.
|
|
40
|
-
*
|
|
41
|
-
* Matches patterns like:
|
|
42
|
-
*
|
|
43
|
-
* - Simple identifiers: `foo`
|
|
44
|
-
* - Dot notation: `foo.bar`, `foo.bar.baz`
|
|
45
|
-
* - Bracket notation with numbers: `foo[0]`, `bar[123]`
|
|
46
|
-
* - Bracket notation with quoted strings: `foo["key"]`, `bar['prop']`
|
|
47
|
-
* - Mixed notation: `foo.bar[0].baz`, `obj[0]["key"].prop`
|
|
48
|
-
*
|
|
49
|
-
* The regex breaks down as:
|
|
50
|
-
*
|
|
51
|
-
* - `^[a-zA-Z_$][a-zA-Z0-9_$]*` - Valid identifier start
|
|
52
|
-
* - `(?:` - Non-capturing group for additional segments
|
|
53
|
-
*
|
|
54
|
-
* - `\.` - Dot followed by identifier
|
|
55
|
-
* - `|` - OR
|
|
56
|
-
* - `\[(?:\d+|"[^"]*"|'[^']*')\]` - Bracket notation (number or quoted string)
|
|
57
|
-
* - `)*$` - Zero or more additional segments, end of string
|
|
58
|
-
*
|
|
59
|
-
* @public
|
|
60
|
-
*/
|
|
61
|
-
export const KEYPATH_REGEX = /^[a-zA-Z_$][-a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][-a-zA-Z0-9_$]*)|(?:\[(?:\d+|"[^"]*"|'[^']*')\]))*$/;
|
|
62
|
-
/**
|
|
63
|
-
* Symbol used to flag a function as a Bupkis-thrown error.
|
|
64
|
-
*/
|
|
65
|
-
export const kBupkisError = symbolFor('bupkis-error');
|
|
66
|
-
/**
|
|
67
|
-
* Assertion ID of a `FailAssertionError`.
|
|
68
|
-
*/
|
|
69
|
-
export const FAIL = 'FAIL';
|
|
70
|
-
export const DAY_NAMES = freeze([
|
|
71
|
-
'Sunday',
|
|
72
|
-
'Monday',
|
|
73
|
-
'Tuesday',
|
|
74
|
-
'Wednesday',
|
|
75
|
-
'Thursday',
|
|
76
|
-
'Friday',
|
|
77
|
-
'Saturday',
|
|
78
|
-
]);
|
|
79
|
-
//# sourceMappingURL=constant.js.map
|
package/dist/constant.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAC1B,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;AAElC;;;GAGG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAW,SAAS,CAAC,uBAAuB,CAAC,CAAC;AAEzE;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAW,SAAS,CACpD,wBAAwB,CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAW,SAAS,CACxD,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAW,SAAS,CAC3D,gCAAgC,CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,CAAC,MAAM,aAAa,GACxB,iGAAiG,CAAC;AAEpG;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,SAAS,CAAC,cAAc,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAe,CAAC;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;IAC9B,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACF,CAAC,CAAC"}
|