bupkis 0.18.0 → 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 +14 -0
- package/package.json +1 -4
- package/src/assertion/assertion-types.ts +4 -4
- package/src/assertion/impl/async-parametric.ts +4 -21
- package/src/assertion/impl/sync-parametric.ts +5 -17
- 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 -423
- 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 -420
- 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 -812
- 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 -809
- 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,553 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Basic type and primitive value assertions.
|
|
4
|
-
*
|
|
5
|
-
* These are the fundamental building blocks for type checking including
|
|
6
|
-
* strings, numbers, booleans, arrays, objects, functions, and other primitive
|
|
7
|
-
* JavaScript types.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
* @groupDescription Basic Assertions
|
|
11
|
-
* Fundamental type checking and primitive value validation.
|
|
12
|
-
*
|
|
13
|
-
* @showGroups
|
|
14
|
-
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.weakSetAssertion = exports.weakMapAssertion = exports.setAssertion = exports.definedAssertion = exports.nonEmptyStringAssertion = exports.emptyStringAssertion = exports.errorAssertion = exports.emptyObjectAssertion = exports.emptyArrayAssertion = exports.recordAssertion = exports.objectAssertion = exports.falsyAssertion = exports.truthyAssertion = exports.regexpAssertion = exports.primitiveAssertion = exports.classAssertion = exports.dateAssertion = exports.arrayAssertion = exports.undefinedAssertion = exports.nullAssertion = exports.integerAssertion = exports.nanAssertion = exports.asyncFunctionAssertion = exports.functionAssertion = exports.symbolAssertion = exports.bigintAssertion = exports.falseAssertion = exports.trueAssertion = exports.negativeIntegerAssertion = exports.negativeAssertion = exports.positiveIntegerAssertion = exports.positiveAssertion = exports.booleanAssertion = exports.negativeInfinityAssertion = exports.positiveInfinityAssertion = exports.infiniteAssertion = exports.numberAssertion = exports.stringAssertion = void 0;
|
|
17
|
-
const zod_1 = require("zod");
|
|
18
|
-
const metadata_js_1 = require("../../metadata.cjs");
|
|
19
|
-
const schema_js_1 = require("../../schema.cjs");
|
|
20
|
-
const create_js_1 = require("../create.cjs");
|
|
21
|
-
const { ownKeys } = Reflect;
|
|
22
|
-
/**
|
|
23
|
-
* Asserts that the subject is a string value.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
*
|
|
27
|
-
* ```ts
|
|
28
|
-
* expect('hello', 'to be a string'); // passes
|
|
29
|
-
* expect(42, 'to be a string'); // fails
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @group Basic Assertions
|
|
33
|
-
* @bupkisAnchor unknown-to-be-a-string
|
|
34
|
-
* @bupkisAssertionCategory primitives
|
|
35
|
-
*/
|
|
36
|
-
exports.stringAssertion = (0, create_js_1.createAssertion)(['to be a string'], schema_js_1.StringSchema);
|
|
37
|
-
/**
|
|
38
|
-
* Asserts that the subject is a finite number value.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
*
|
|
42
|
-
* ```ts
|
|
43
|
-
* expect(42, 'to be a number'); // passes
|
|
44
|
-
* expect(Infinity, 'to be a number'); // fails
|
|
45
|
-
* expect('42', 'to be a number'); // fails
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @group Basic Assertions
|
|
49
|
-
*/
|
|
50
|
-
exports.numberAssertion = (0, create_js_1.createAssertion)([['to be a number', 'to be finite']], schema_js_1.NumberSchema);
|
|
51
|
-
/**
|
|
52
|
-
* Asserts that the subject is either positive or negative infinity.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
*
|
|
56
|
-
* ```ts
|
|
57
|
-
* expect(Infinity, 'to be infinite'); // passes
|
|
58
|
-
* expect(-Infinity, 'to be infinite'); // passes
|
|
59
|
-
* expect(42, 'to be infinite'); // fails
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @group Basic Assertions
|
|
63
|
-
*/
|
|
64
|
-
exports.infiniteAssertion = (0, create_js_1.createAssertion)(['to be infinite'], schema_js_1.InfinitySchema.or(schema_js_1.NegativeInfinitySchema));
|
|
65
|
-
/**
|
|
66
|
-
* Asserts that the subject is positive infinity.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
*
|
|
70
|
-
* ```ts
|
|
71
|
-
* expect(Infinity, 'to be Infinity'); // passes
|
|
72
|
-
* expect(-Infinity, 'to be Infinity'); // fails
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @group Basic Assertions
|
|
76
|
-
*/
|
|
77
|
-
exports.positiveInfinityAssertion = (0, create_js_1.createAssertion)(['to be Infinity'], schema_js_1.InfinitySchema);
|
|
78
|
-
/**
|
|
79
|
-
* Asserts that the subject is negative infinity.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
*
|
|
83
|
-
* ```ts
|
|
84
|
-
* expect(-Infinity, 'to be -Infinity'); // passes
|
|
85
|
-
* expect(Infinity, 'to be -Infinity'); // fails
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* @group Basic Assertions
|
|
89
|
-
*/
|
|
90
|
-
exports.negativeInfinityAssertion = (0, create_js_1.createAssertion)(['to be -Infinity'], schema_js_1.NegativeInfinitySchema);
|
|
91
|
-
/**
|
|
92
|
-
* Asserts that the subject is a boolean value.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
*
|
|
96
|
-
* ```ts
|
|
97
|
-
* expect(true, 'to be a boolean'); // passes
|
|
98
|
-
* expect('true', 'to be a boolean'); // fails
|
|
99
|
-
* ```
|
|
100
|
-
*
|
|
101
|
-
* @group Basic Assertions
|
|
102
|
-
*/
|
|
103
|
-
exports.booleanAssertion = (0, create_js_1.createAssertion)([['to be a boolean', 'to be boolean', 'to be a bool']], schema_js_1.BooleanSchema);
|
|
104
|
-
/**
|
|
105
|
-
* Asserts that the subject is a positive number.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
*
|
|
109
|
-
* ```ts
|
|
110
|
-
* expect(42, 'to be positive'); // passes
|
|
111
|
-
* expect(-1, 'to be positive'); // fails
|
|
112
|
-
* expect(0, 'to be positive'); // fails
|
|
113
|
-
* ```
|
|
114
|
-
*
|
|
115
|
-
* @group Basic Assertions
|
|
116
|
-
*/
|
|
117
|
-
exports.positiveAssertion = (0, create_js_1.createAssertion)([['to be positive', 'to be a positive number']], schema_js_1.PositiveNumberSchema);
|
|
118
|
-
/**
|
|
119
|
-
* Asserts that the subject is a positive integer.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
*
|
|
123
|
-
* ```ts
|
|
124
|
-
* expect(42, 'to be a positive integer'); // passes
|
|
125
|
-
* expect(-1, 'to be a positive integer'); // fails
|
|
126
|
-
* expect(42.5, 'to be a positive integer'); // fails
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* @group Basic Assertions
|
|
130
|
-
*/
|
|
131
|
-
exports.positiveIntegerAssertion = (0, create_js_1.createAssertion)([['to be a positive integer', 'to be a positive int']], schema_js_1.PositiveNumberSchema.int());
|
|
132
|
-
/**
|
|
133
|
-
* Asserts that the subject is a negative number.
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
*
|
|
137
|
-
* ```ts
|
|
138
|
-
* expect(-42, 'to be negative'); // passes
|
|
139
|
-
* expect(1, 'to be negative'); // fails
|
|
140
|
-
* expect(0, 'to be negative'); // fails
|
|
141
|
-
* ```
|
|
142
|
-
*
|
|
143
|
-
* @group Basic Assertions
|
|
144
|
-
*/
|
|
145
|
-
exports.negativeAssertion = (0, create_js_1.createAssertion)([['to be negative', 'to be a negative number']], schema_js_1.NegativeNumberSchema);
|
|
146
|
-
/**
|
|
147
|
-
* Asserts that the subject is a negative integer.
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
*
|
|
151
|
-
* ```ts
|
|
152
|
-
* expect(-42, 'to be a negative integer'); // passes
|
|
153
|
-
* expect(1, 'to be a negative integer'); // fails
|
|
154
|
-
* expect(-42.5, 'to be a negative integer'); // fails
|
|
155
|
-
* ```
|
|
156
|
-
*
|
|
157
|
-
* @group Basic Assertions
|
|
158
|
-
*/
|
|
159
|
-
exports.negativeIntegerAssertion = (0, create_js_1.createAssertion)([['to be a negative integer', 'to be a negative int']], schema_js_1.NegativeNumberSchema.int());
|
|
160
|
-
/**
|
|
161
|
-
* Asserts that the subject is exactly the boolean value true.
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
*
|
|
165
|
-
* ```ts
|
|
166
|
-
* expect(true, 'to be true'); // passes
|
|
167
|
-
* expect(false, 'to be true'); // fails
|
|
168
|
-
* expect(1, 'to be true'); // fails
|
|
169
|
-
* ```
|
|
170
|
-
*
|
|
171
|
-
* @group Basic Assertions
|
|
172
|
-
*/
|
|
173
|
-
exports.trueAssertion = (0, create_js_1.createAssertion)(['to be true'], zod_1.z.literal(true));
|
|
174
|
-
/**
|
|
175
|
-
* Asserts that the subject is exactly the boolean value false.
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
*
|
|
179
|
-
* ```ts
|
|
180
|
-
* expect(false, 'to be false'); // passes
|
|
181
|
-
* expect(true, 'to be false'); // fails
|
|
182
|
-
* expect(0, 'to be false'); // fails
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* @group Basic Assertions
|
|
186
|
-
*/
|
|
187
|
-
exports.falseAssertion = (0, create_js_1.createAssertion)(['to be false'], zod_1.z.literal(false));
|
|
188
|
-
/**
|
|
189
|
-
* Asserts that the subject is a BigInt value.
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
*
|
|
193
|
-
* ```ts
|
|
194
|
-
* expect(123n, 'to be a bigint'); // passes
|
|
195
|
-
* expect(123, 'to be a bigint'); // fails
|
|
196
|
-
* ```
|
|
197
|
-
*
|
|
198
|
-
* @group Basic Assertions
|
|
199
|
-
*/
|
|
200
|
-
exports.bigintAssertion = (0, create_js_1.createAssertion)([['to be a bigint', 'to be a BigInt']], schema_js_1.BigintSchema);
|
|
201
|
-
/**
|
|
202
|
-
* Asserts that the subject is a Symbol.
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
*
|
|
206
|
-
* ```ts
|
|
207
|
-
* expect(Symbol('test'), 'to be a symbol'); // passes
|
|
208
|
-
* expect('symbol', 'to be a symbol'); // fails
|
|
209
|
-
* ```
|
|
210
|
-
*
|
|
211
|
-
* @group Basic Assertions
|
|
212
|
-
*/
|
|
213
|
-
exports.symbolAssertion = (0, create_js_1.createAssertion)([['to be a symbol', 'to be a Symbol']], schema_js_1.SymbolSchema);
|
|
214
|
-
/**
|
|
215
|
-
* Asserts that the subject is a function.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
*
|
|
219
|
-
* ```ts
|
|
220
|
-
* expect(() => {}, 'to be a function'); // passes
|
|
221
|
-
* expect('function', 'to be a function'); // fails
|
|
222
|
-
* ```
|
|
223
|
-
*
|
|
224
|
-
* @group Basic Assertions
|
|
225
|
-
*/
|
|
226
|
-
exports.functionAssertion = (0, create_js_1.createAssertion)(['to be a function'], schema_js_1.FunctionSchema);
|
|
227
|
-
/**
|
|
228
|
-
* Asserts that the subject is an async function.
|
|
229
|
-
*
|
|
230
|
-
* @example
|
|
231
|
-
*
|
|
232
|
-
* ```ts
|
|
233
|
-
* expect(async () => {}, 'to be an async function'); // passes
|
|
234
|
-
* expect(() => {}, 'to be an async function'); // fails
|
|
235
|
-
* ```
|
|
236
|
-
*
|
|
237
|
-
* @group Basic Assertions
|
|
238
|
-
*/
|
|
239
|
-
exports.asyncFunctionAssertion = (0, create_js_1.createAssertion)(['to be an async function'], schema_js_1.AsyncFunctionSchema);
|
|
240
|
-
/**
|
|
241
|
-
* Asserts that the subject is NaN (Not a Number).
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
*
|
|
245
|
-
* ```ts
|
|
246
|
-
* expect(NaN, 'to be NaN'); // passes
|
|
247
|
-
* expect(42, 'to be NaN'); // fails
|
|
248
|
-
* expect('not a number', 'to be NaN'); // fails
|
|
249
|
-
* ```
|
|
250
|
-
*
|
|
251
|
-
* @group Basic Assertions
|
|
252
|
-
*/
|
|
253
|
-
exports.nanAssertion = (0, create_js_1.createAssertion)(['to be NaN'], zod_1.z.nan());
|
|
254
|
-
/**
|
|
255
|
-
* Asserts that the subject is an integer (safe integer).
|
|
256
|
-
*
|
|
257
|
-
* @example
|
|
258
|
-
*
|
|
259
|
-
* ```ts
|
|
260
|
-
* expect(42, 'to be an integer'); // passes
|
|
261
|
-
* expect(42.5, 'to be an integer'); // fails
|
|
262
|
-
* ```
|
|
263
|
-
*
|
|
264
|
-
* @group Basic Assertions
|
|
265
|
-
*/
|
|
266
|
-
exports.integerAssertion = (0, create_js_1.createAssertion)([
|
|
267
|
-
[
|
|
268
|
-
'to be an integer',
|
|
269
|
-
'to be a safe integer',
|
|
270
|
-
'to be an int',
|
|
271
|
-
'to be a safe int',
|
|
272
|
-
],
|
|
273
|
-
], schema_js_1.NumberSchema.int());
|
|
274
|
-
/**
|
|
275
|
-
* Asserts that the subject is null.
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
*
|
|
279
|
-
* ```ts
|
|
280
|
-
* expect(null, 'to be null'); // passes
|
|
281
|
-
* expect(undefined, 'to be null'); // fails
|
|
282
|
-
* ```
|
|
283
|
-
*
|
|
284
|
-
* @group Basic Assertions
|
|
285
|
-
*/
|
|
286
|
-
exports.nullAssertion = (0, create_js_1.createAssertion)(['to be null'], zod_1.z.null());
|
|
287
|
-
/**
|
|
288
|
-
* Asserts that the subject is undefined.
|
|
289
|
-
*
|
|
290
|
-
* @example
|
|
291
|
-
*
|
|
292
|
-
* ```ts
|
|
293
|
-
* expect(undefined, 'to be undefined'); // passes
|
|
294
|
-
* expect(null, 'to be undefined'); // fails
|
|
295
|
-
* ```
|
|
296
|
-
*
|
|
297
|
-
* @group Basic Assertions
|
|
298
|
-
*/
|
|
299
|
-
exports.undefinedAssertion = (0, create_js_1.createAssertion)(['to be undefined'], zod_1.z.undefined());
|
|
300
|
-
/**
|
|
301
|
-
* Asserts that the subject is an array.
|
|
302
|
-
*
|
|
303
|
-
* @example
|
|
304
|
-
*
|
|
305
|
-
* ```ts
|
|
306
|
-
* expect([1, 2, 3], 'to be an array'); // passes
|
|
307
|
-
* expect('array', 'to be an array'); // fails
|
|
308
|
-
* ```
|
|
309
|
-
*
|
|
310
|
-
* @group Basic Assertions
|
|
311
|
-
*/
|
|
312
|
-
exports.arrayAssertion = (0, create_js_1.createAssertion)([['to be an array', 'to be array']], schema_js_1.UnknownArraySchema);
|
|
313
|
-
/**
|
|
314
|
-
* Asserts that the subject is a Date object.
|
|
315
|
-
*
|
|
316
|
-
* @example
|
|
317
|
-
*
|
|
318
|
-
* ```ts
|
|
319
|
-
* expect(new Date(), 'to be a date'); // passes
|
|
320
|
-
* expect('2023-01-01', 'to be a date'); // fails
|
|
321
|
-
* ```
|
|
322
|
-
*
|
|
323
|
-
* @group Basic Assertions
|
|
324
|
-
*/
|
|
325
|
-
exports.dateAssertion = (0, create_js_1.createAssertion)([['to be a date', 'to be a Date']], schema_js_1.DateSchema);
|
|
326
|
-
/**
|
|
327
|
-
* Asserts that the subject is a class constructor (constructible function).
|
|
328
|
-
*
|
|
329
|
-
* @example
|
|
330
|
-
*
|
|
331
|
-
* ```ts
|
|
332
|
-
* expect(Date, 'to be a class'); // passes
|
|
333
|
-
* expect(() => {}, 'to be a class'); // fails
|
|
334
|
-
* ```
|
|
335
|
-
*
|
|
336
|
-
* @group Basic Assertions
|
|
337
|
-
*/
|
|
338
|
-
exports.classAssertion = (0, create_js_1.createAssertion)([['to be a class', 'to be a constructor', 'to be constructible']], schema_js_1.ConstructibleSchema);
|
|
339
|
-
/**
|
|
340
|
-
* Asserts that the subject is a primitive value (string, number, boolean, null,
|
|
341
|
-
* undefined, symbol, or bigint).
|
|
342
|
-
*
|
|
343
|
-
* @example
|
|
344
|
-
*
|
|
345
|
-
* ```ts
|
|
346
|
-
* expect('hello', 'to be a primitive'); // passes
|
|
347
|
-
* expect({}, 'to be a primitive'); // fails
|
|
348
|
-
* ```
|
|
349
|
-
*
|
|
350
|
-
* @group Basic Assertions
|
|
351
|
-
*/
|
|
352
|
-
exports.primitiveAssertion = (0, create_js_1.createAssertion)(['to be a primitive'], schema_js_1.PrimitiveSchema);
|
|
353
|
-
/**
|
|
354
|
-
* Asserts that the subject is a regular expression.
|
|
355
|
-
*
|
|
356
|
-
* @example
|
|
357
|
-
*
|
|
358
|
-
* ```ts
|
|
359
|
-
* expect(/test/, 'to be a RegExp'); // passes
|
|
360
|
-
* expect('test', 'to be a RegExp'); // fails
|
|
361
|
-
* ```
|
|
362
|
-
*
|
|
363
|
-
* @group Basic Assertions
|
|
364
|
-
*/
|
|
365
|
-
exports.regexpAssertion = (0, create_js_1.createAssertion)([['to be a RegExp', 'to be a regex', 'to be a regexp']], zod_1.z.instanceof(RegExp));
|
|
366
|
-
/**
|
|
367
|
-
* Asserts that the subject is truthy (not false, 0, '', null, undefined, or
|
|
368
|
-
* NaN).
|
|
369
|
-
*
|
|
370
|
-
* @example
|
|
371
|
-
*
|
|
372
|
-
* ```ts
|
|
373
|
-
* expect('hello', 'to be truthy'); // passes
|
|
374
|
-
* expect('', 'to be truthy'); // fails
|
|
375
|
-
* ```
|
|
376
|
-
*
|
|
377
|
-
* @group Basic Assertions
|
|
378
|
-
*/
|
|
379
|
-
exports.truthyAssertion = (0, create_js_1.createAssertion)([['to be truthy', 'to exist', 'to be ok']], schema_js_1.TruthySchema);
|
|
380
|
-
/**
|
|
381
|
-
* Asserts that the subject is falsy (false, 0, '', null, undefined, or NaN).
|
|
382
|
-
*
|
|
383
|
-
* @example
|
|
384
|
-
*
|
|
385
|
-
* ```ts
|
|
386
|
-
* expect('', 'to be falsy'); // passes
|
|
387
|
-
* expect('hello', 'to be falsy'); // fails
|
|
388
|
-
* ```
|
|
389
|
-
*
|
|
390
|
-
* @group Basic Assertions
|
|
391
|
-
*/
|
|
392
|
-
exports.falsyAssertion = (0, create_js_1.createAssertion)(['to be falsy'], schema_js_1.FalsySchema);
|
|
393
|
-
/**
|
|
394
|
-
* Asserts that the subject is an object (non-null object type).
|
|
395
|
-
*
|
|
396
|
-
* @example
|
|
397
|
-
*
|
|
398
|
-
* ```ts
|
|
399
|
-
* expect({}, 'to be an object'); // passes
|
|
400
|
-
* expect(null, 'to be an object'); // fails
|
|
401
|
-
* expect('string', 'to be an object'); // fails
|
|
402
|
-
* ```
|
|
403
|
-
*
|
|
404
|
-
* @group Basic Assertions
|
|
405
|
-
*/
|
|
406
|
-
exports.objectAssertion = (0, create_js_1.createAssertion)(['to be an object'], zod_1.z
|
|
407
|
-
.unknown()
|
|
408
|
-
.nonoptional()
|
|
409
|
-
.refine((value) => typeof value == 'object' && value !== null)
|
|
410
|
-
.register(metadata_js_1.BupkisRegistry, { name: 'Object' })
|
|
411
|
-
.meta({
|
|
412
|
-
description: 'Returns true for any non-null value where `typeof value` is `object`',
|
|
413
|
-
}));
|
|
414
|
-
/**
|
|
415
|
-
* Asserts that the subject is a record (plain object with string/symbol/number
|
|
416
|
-
* keys).
|
|
417
|
-
*
|
|
418
|
-
* @example
|
|
419
|
-
*
|
|
420
|
-
* ```ts
|
|
421
|
-
* expect({ key: 'value' }, 'to be a record'); // passes
|
|
422
|
-
* expect([], 'to be a record'); // fails
|
|
423
|
-
* ```
|
|
424
|
-
*
|
|
425
|
-
* @group Basic Assertions
|
|
426
|
-
*/
|
|
427
|
-
exports.recordAssertion = (0, create_js_1.createAssertion)([['to be a record', 'to be a plain object']], schema_js_1.UnknownRecordSchema);
|
|
428
|
-
/**
|
|
429
|
-
* Asserts that an array is empty.
|
|
430
|
-
*
|
|
431
|
-
* @example
|
|
432
|
-
*
|
|
433
|
-
* ```ts
|
|
434
|
-
* expect([], 'to be empty'); // passes
|
|
435
|
-
* expect([1, 2], 'to be empty'); // fails
|
|
436
|
-
* ```
|
|
437
|
-
*
|
|
438
|
-
* @group Basic Assertions
|
|
439
|
-
*/
|
|
440
|
-
exports.emptyArrayAssertion = (0, create_js_1.createAssertion)([schema_js_1.ArrayLikeSchema, 'to be empty'], (subject) => {
|
|
441
|
-
if (subject.length !== 0) {
|
|
442
|
-
return {
|
|
443
|
-
actual: subject.length,
|
|
444
|
-
expected: 0,
|
|
445
|
-
message: `Expected array-like to have length 0, but had length ${subject.length}`,
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
/**
|
|
450
|
-
* Asserts that an object is empty (has no own properties).
|
|
451
|
-
*
|
|
452
|
-
* @example
|
|
453
|
-
*
|
|
454
|
-
* ```ts
|
|
455
|
-
* expect({}, 'to be empty'); // passes
|
|
456
|
-
* expect({ key: 'value' }, 'to be empty'); // fails
|
|
457
|
-
* ```
|
|
458
|
-
*
|
|
459
|
-
* @group Basic Assertions
|
|
460
|
-
*/
|
|
461
|
-
exports.emptyObjectAssertion = (0, create_js_1.createAssertion)([schema_js_1.UnknownRecordSchema, 'to be empty'], schema_js_1.UnknownRecordSchema.refine((obj) => ownKeys(obj).length === 0));
|
|
462
|
-
/**
|
|
463
|
-
* Asserts that the subject is an Error instance.
|
|
464
|
-
*
|
|
465
|
-
* @example
|
|
466
|
-
*
|
|
467
|
-
* ```ts
|
|
468
|
-
* expect(new Error('test'), 'to be an Error'); // passes
|
|
469
|
-
* expect('error', 'to be an Error'); // fails
|
|
470
|
-
* ```
|
|
471
|
-
*
|
|
472
|
-
* @group Basic Assertions
|
|
473
|
-
*/
|
|
474
|
-
exports.errorAssertion = (0, create_js_1.createAssertion)([['to be an Error', 'to be a Error']], schema_js_1.ErrorSchema);
|
|
475
|
-
/**
|
|
476
|
-
* Asserts that a string is empty.
|
|
477
|
-
*
|
|
478
|
-
* @example
|
|
479
|
-
*
|
|
480
|
-
* ```ts
|
|
481
|
-
* expect('', 'to be empty'); // passes
|
|
482
|
-
* expect('hello', 'to be empty'); // fails
|
|
483
|
-
* ```
|
|
484
|
-
*
|
|
485
|
-
* @group Basic Assertions
|
|
486
|
-
*/
|
|
487
|
-
exports.emptyStringAssertion = (0, create_js_1.createAssertion)([schema_js_1.StringSchema, 'to be empty'], schema_js_1.StringSchema.max(0));
|
|
488
|
-
/**
|
|
489
|
-
* Asserts that a string is non-empty.
|
|
490
|
-
*
|
|
491
|
-
* @example
|
|
492
|
-
*
|
|
493
|
-
* ```ts
|
|
494
|
-
* expect('hello', 'to be non-empty'); // passes
|
|
495
|
-
* expect('', 'to be non-empty'); // fails
|
|
496
|
-
* ```
|
|
497
|
-
*
|
|
498
|
-
* @group Basic Assertions
|
|
499
|
-
*/
|
|
500
|
-
exports.nonEmptyStringAssertion = (0, create_js_1.createAssertion)([schema_js_1.StringSchema, 'to be non-empty'], schema_js_1.StringSchema.min(1));
|
|
501
|
-
/**
|
|
502
|
-
* Asserts that the subject is defined (not undefined).
|
|
503
|
-
*
|
|
504
|
-
* @example
|
|
505
|
-
*
|
|
506
|
-
* ```ts
|
|
507
|
-
* expect(null, 'to be defined'); // passes
|
|
508
|
-
* expect(undefined, 'to be defined'); // fails
|
|
509
|
-
* ```
|
|
510
|
-
*
|
|
511
|
-
* @group Basic Assertions
|
|
512
|
-
*/
|
|
513
|
-
exports.definedAssertion = (0, create_js_1.createAssertion)(['to be defined'], schema_js_1.UnknownSchema.nonoptional());
|
|
514
|
-
/**
|
|
515
|
-
* Asserts that the subject is a Set instance.
|
|
516
|
-
*
|
|
517
|
-
* @example
|
|
518
|
-
*
|
|
519
|
-
* ```ts
|
|
520
|
-
* expect(new Set(), 'to be a Set'); // passes
|
|
521
|
-
* expect([], 'to be a Set'); // fails
|
|
522
|
-
* ```
|
|
523
|
-
*
|
|
524
|
-
* @group Basic Assertions
|
|
525
|
-
*/
|
|
526
|
-
exports.setAssertion = (0, create_js_1.createAssertion)(['to be a Set'], schema_js_1.SetSchema);
|
|
527
|
-
/**
|
|
528
|
-
* Asserts that the subject is a WeakMap instance.
|
|
529
|
-
*
|
|
530
|
-
* @example
|
|
531
|
-
*
|
|
532
|
-
* ```ts
|
|
533
|
-
* expect(new WeakMap(), 'to be a WeakMap'); // passes
|
|
534
|
-
* expect(new Map(), 'to be a WeakMap'); // fails
|
|
535
|
-
* ```
|
|
536
|
-
*
|
|
537
|
-
* @group Basic Assertions
|
|
538
|
-
*/
|
|
539
|
-
exports.weakMapAssertion = (0, create_js_1.createAssertion)(['to be a WeakMap'], schema_js_1.WeakMapSchema);
|
|
540
|
-
/**
|
|
541
|
-
* Asserts that the subject is a WeakSet instance.
|
|
542
|
-
*
|
|
543
|
-
* @example
|
|
544
|
-
*
|
|
545
|
-
* ```ts
|
|
546
|
-
* expect(new WeakSet(), 'to be a WeakSet'); // passes
|
|
547
|
-
* expect(new Set(), 'to be a WeakSet'); // fails
|
|
548
|
-
* ```
|
|
549
|
-
*
|
|
550
|
-
* @group Basic Assertions
|
|
551
|
-
*/
|
|
552
|
-
exports.weakSetAssertion = (0, create_js_1.createAssertion)(['to be a WeakSet'], schema_js_1.WeakSetSchema);
|
|
553
|
-
//# sourceMappingURL=sync-basic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-basic.js","sourceRoot":"","sources":["../../../src/assertion/impl/sync-basic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,6BAAwB;AAExB,oDAAmD;AACnD,gDAyByB;AACzB,6CAA+C;AAE/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AAE5B;;;;;;;;;;;;;GAaG;AACU,QAAA,eAAe,GAAG,IAAA,2BAAe,EAC5C,CAAC,gBAAgB,CAAC,EAClB,wBAAY,CACb,CAAC;AAEF;;;;;;;;;;;;GAYG;AACU,QAAA,eAAe,GAAG,IAAA,2BAAe,EAC5C,CAAC,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC,EACpC,wBAAY,CACb,CAAC;AAEF;;;;;;;;;;;;GAYG;AACU,QAAA,iBAAiB,GAAG,IAAA,2BAAe,EAC9C,CAAC,gBAAgB,CAAC,EAClB,0BAAc,CAAC,EAAE,CAAC,kCAAs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