bupkis 0.1.1 → 0.2.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 +20 -0
- package/README.md +8 -8
- package/dist/commonjs/assertion/assertion-types.d.ts +33 -82
- package/dist/commonjs/assertion/assertion-types.d.ts.map +1 -1
- package/dist/commonjs/assertion/create.d.ts +5 -33
- package/dist/commonjs/assertion/create.d.ts.map +1 -1
- package/dist/commonjs/assertion/create.js +17 -6
- package/dist/commonjs/assertion/create.js.map +1 -1
- package/dist/commonjs/assertion/impl/async.d.ts +5 -5
- package/dist/commonjs/assertion/impl/async.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/async.js +2 -2
- package/dist/commonjs/assertion/impl/async.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts +25 -24
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.js +5 -3
- package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync.d.ts +50 -50
- package/dist/commonjs/assertion/impl/sync.d.ts.map +1 -1
- package/dist/commonjs/bootstrap.d.ts +71 -61
- package/dist/commonjs/bootstrap.d.ts.map +1 -1
- package/dist/commonjs/bootstrap.js +21 -12
- package/dist/commonjs/bootstrap.js.map +1 -1
- package/dist/commonjs/error.d.ts +12 -5
- package/dist/commonjs/error.d.ts.map +1 -1
- package/dist/commonjs/error.js +19 -4
- package/dist/commonjs/error.js.map +1 -1
- package/dist/commonjs/expect.d.ts +130 -3
- package/dist/commonjs/expect.d.ts.map +1 -1
- package/dist/commonjs/expect.js +115 -0
- package/dist/commonjs/expect.js.map +1 -1
- package/dist/commonjs/guards.d.ts +23 -16
- package/dist/commonjs/guards.d.ts.map +1 -1
- package/dist/commonjs/guards.js +37 -20
- package/dist/commonjs/guards.js.map +1 -1
- package/dist/commonjs/index.d.ts +113 -62
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +44 -42
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/metadata.d.ts +1 -27
- package/dist/commonjs/metadata.d.ts.map +1 -1
- package/dist/commonjs/metadata.js +16 -15
- package/dist/commonjs/metadata.js.map +1 -1
- package/dist/commonjs/schema.d.ts +59 -26
- package/dist/commonjs/schema.d.ts.map +1 -1
- package/dist/commonjs/schema.js +57 -24
- package/dist/commonjs/schema.js.map +1 -1
- package/dist/commonjs/types.d.ts +449 -39
- package/dist/commonjs/types.d.ts.map +1 -1
- package/dist/commonjs/types.js +12 -2
- package/dist/commonjs/types.js.map +1 -1
- package/dist/commonjs/use.d.ts.map +1 -1
- package/dist/commonjs/use.js +4 -2
- package/dist/commonjs/use.js.map +1 -1
- package/dist/commonjs/util.d.ts +7 -0
- package/dist/commonjs/util.d.ts.map +1 -1
- package/dist/commonjs/util.js +7 -0
- package/dist/commonjs/util.js.map +1 -1
- package/dist/esm/assertion/assertion-types.d.ts +33 -82
- package/dist/esm/assertion/assertion-types.d.ts.map +1 -1
- package/dist/esm/assertion/create.d.ts +5 -33
- package/dist/esm/assertion/create.d.ts.map +1 -1
- package/dist/esm/assertion/create.js +14 -4
- package/dist/esm/assertion/create.js.map +1 -1
- package/dist/esm/assertion/impl/async.d.ts +5 -5
- package/dist/esm/assertion/impl/async.d.ts.map +1 -1
- package/dist/esm/assertion/impl/async.js +2 -2
- package/dist/esm/assertion/impl/async.js.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.d.ts +25 -24
- package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.js +5 -3
- package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/sync.d.ts +50 -50
- package/dist/esm/assertion/impl/sync.d.ts.map +1 -1
- package/dist/esm/bootstrap.d.ts +71 -61
- package/dist/esm/bootstrap.d.ts.map +1 -1
- package/dist/esm/bootstrap.js +21 -12
- package/dist/esm/bootstrap.js.map +1 -1
- package/dist/esm/error.d.ts +12 -5
- package/dist/esm/error.d.ts.map +1 -1
- package/dist/esm/error.js +19 -4
- package/dist/esm/error.js.map +1 -1
- package/dist/esm/expect.d.ts +130 -3
- package/dist/esm/expect.d.ts.map +1 -1
- package/dist/esm/expect.js +115 -0
- package/dist/esm/expect.js.map +1 -1
- package/dist/esm/guards.d.ts +23 -16
- package/dist/esm/guards.d.ts.map +1 -1
- package/dist/esm/guards.js +32 -13
- package/dist/esm/guards.js.map +1 -1
- package/dist/esm/index.d.ts +113 -62
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +46 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/metadata.d.ts +1 -27
- package/dist/esm/metadata.d.ts.map +1 -1
- package/dist/esm/metadata.js +2 -1
- package/dist/esm/metadata.js.map +1 -1
- package/dist/esm/schema.d.ts +59 -26
- package/dist/esm/schema.d.ts.map +1 -1
- package/dist/esm/schema.js +57 -24
- package/dist/esm/schema.js.map +1 -1
- package/dist/esm/types.d.ts +449 -39
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +12 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/use.d.ts.map +1 -1
- package/dist/esm/use.js +4 -2
- package/dist/esm/use.js.map +1 -1
- package/dist/esm/util.d.ts +7 -0
- package/dist/esm/util.d.ts.map +1 -1
- package/dist/esm/util.js +7 -0
- package/dist/esm/util.js.map +1 -1
- package/package.json +93 -16
- package/src/assertion/assertion-types.ts +38 -41
- package/src/assertion/create.ts +16 -65
- package/src/assertion/impl/async.ts +2 -2
- package/src/assertion/impl/sync-parametric.ts +6 -3
- package/src/bootstrap.ts +26 -28
- package/src/error.ts +21 -4
- package/src/expect.ts +269 -18
- package/src/guards.ts +34 -53
- package/src/index.ts +71 -11
- package/src/metadata.ts +3 -4
- package/src/schema.ts +59 -26
- package/src/types.ts +593 -72
- package/src/use.ts +6 -4
- package/src/util.ts +7 -0
- package/dist/commonjs/api.d.ts +0 -93
- package/dist/commonjs/api.d.ts.map +0 -1
- package/dist/commonjs/api.js +0 -8
- package/dist/commonjs/api.js.map +0 -1
- package/dist/esm/api.d.ts +0 -93
- package/dist/esm/api.d.ts.map +0 -1
- package/dist/esm/api.js +0 -7
- package/dist/esm/api.js.map +0 -1
- package/src/api.ts +0 -149
- package/src/schema.md +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.0](https://github.com/boneskull/bupkis/compare/bupkis-v0.1.2...bupkis-v0.2.0) (2025-09-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add "assertions" subpath export ([692421b](https://github.com/boneskull/bupkis/commit/692421b5831a440fce0d0e9fe191a4aeba61a808))
|
|
9
|
+
* **assertion:** add alias "to be between" for "to be within" ([6e20646](https://github.com/boneskull/bupkis/commit/6e2064671b0b8e4ca35db55fd8ec90211956f303))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* rename "to resolve to value satisfying" async assertions to "resolve with value satisfying" ([3a39a3e](https://github.com/boneskull/bupkis/commit/3a39a3e18ea2899f8c8ec8cbabdff9475dfbe41d))
|
|
15
|
+
|
|
16
|
+
## [0.1.2](https://github.com/boneskull/bupkis/compare/bupkis-v0.1.1...bupkis-v0.1.2) (2025-09-09)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **util:** isConstructable handles Symbol and BigInt properly ([c13747a](https://github.com/boneskull/bupkis/commit/c13747aa57b5806c38389c1d8347a2966cb17f22))
|
|
22
|
+
|
|
3
23
|
## [0.1.1](https://github.com/boneskull/bupkis/compare/bupkis-v0.1.0...bupkis-v0.1.1) (2025-09-09)
|
|
4
24
|
|
|
5
25
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="./
|
|
3
|
-
<h1 align="center"><span class="
|
|
2
|
+
<img src="./site/media/bupkis-logo-512.png" width="512px" align="center" alt="BUPKIS logo"/>
|
|
3
|
+
<h1 align="center"><span class="bupkis">⁓ BUPKIS ⁓<span></h1>
|
|
4
4
|
<p align="center">
|
|
5
5
|
Uncommonly extensible assertions for the beautiful people
|
|
6
6
|
<br/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- [BUPKIS' Homepage][docs] (<https://bupkis.zip>)
|
|
14
14
|
- [Assertion Reference][assertion-reference]
|
|
15
15
|
- [Guide: Basic Usage][basic-usage]
|
|
16
|
-
- [Guide:
|
|
16
|
+
- [Guide: Creating a Custom Assertion][create-a-custom-assertion]
|
|
17
17
|
|
|
18
18
|
## Motivation
|
|
19
19
|
|
|
@@ -215,12 +215,12 @@ Copyright © 2025 Christopher Hiller. Licensed under [BlueOak-1.0.0](https://blu
|
|
|
215
215
|
|
|
216
216
|
[zod]: https://zod.dev
|
|
217
217
|
[docs]: https://bupkis.zip
|
|
218
|
-
[basic-usage]: https://bupkis.zip/
|
|
218
|
+
[basic-usage]: https://bupkis.zip/usage
|
|
219
219
|
[unexpected]: https://unexpected.js.org
|
|
220
220
|
[fast-check]: https://fast-check.dev
|
|
221
|
-
[parametric]: https://bupkis.zip/
|
|
222
|
-
[custom-assertion-function]: https://bupkis.zip/
|
|
223
|
-
[create-a-custom-assertion]: https://bupkis.zip/
|
|
224
|
-
[assertion-reference]: https://bupkis.zip/
|
|
221
|
+
[parametric]: https://bupkis.zip/glossary#parametric-assertion
|
|
222
|
+
[custom-assertion-function]: https://bupkis.zip/custom-assertions#static-assertions-function-style
|
|
223
|
+
[create-a-custom-assertion]: https://bupkis.zip/custom-assertions
|
|
224
|
+
[assertion-reference]: https://bupkis.zip/assertions
|
|
225
225
|
[tshy]: https://github.com/isaacs/tshy
|
|
226
226
|
[typedoc]: https://typedoc.org
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
|
-
import { type
|
|
11
|
+
import { type NonEmptyTuple } from 'type-fest';
|
|
12
12
|
import { type z } from 'zod/v4';
|
|
13
|
-
import type { AsyncAssertions, SyncAssertions } from './impl/index.js';
|
|
14
13
|
/**
|
|
15
14
|
* Union type representing any assertion, either synchronous or asynchronous.
|
|
16
15
|
*
|
|
@@ -152,7 +151,7 @@ export type AssertionImpl<Parts extends AssertionParts> = AssertionImplAsync<Par
|
|
|
152
151
|
* asynchronous assertions, providing a type-safe way to handle async assertion
|
|
153
152
|
* logic.
|
|
154
153
|
*
|
|
155
|
-
* @
|
|
154
|
+
* @template Parts - The assertion parts defining the structure
|
|
156
155
|
* @see {@link AssertionImplFnAsync} for function-based async implementations
|
|
157
156
|
* @see {@link AssertionImplSchemaAsync} for schema-based async implementations
|
|
158
157
|
*/
|
|
@@ -165,7 +164,7 @@ export type AssertionImplAsync<Parts extends AssertionParts> = AssertionImplFnAs
|
|
|
165
164
|
* parsed values from the assertion parts and can return various types
|
|
166
165
|
* indicating validation success or failure.
|
|
167
166
|
*
|
|
168
|
-
* @
|
|
167
|
+
* @template Parts - The assertion parts defining the structure
|
|
169
168
|
* @param values - The parsed values corresponding to assertion parts
|
|
170
169
|
* @returns Promise resolving to boolean indicating pass/fail, void for success,
|
|
171
170
|
* ZodType for dynamic validation, or AssertionFailure object for detailed
|
|
@@ -182,7 +181,7 @@ export type AssertionImplFnAsync<Parts extends AssertionParts> = (...values: Par
|
|
|
182
181
|
* assertion parts and can return various types indicating validation success or
|
|
183
182
|
* failure.
|
|
184
183
|
*
|
|
185
|
-
* @
|
|
184
|
+
* @template Parts - The assertion parts defining the structure
|
|
186
185
|
* @param values - The parsed values corresponding to assertion parts
|
|
187
186
|
* @returns Boolean indicating pass/fail, void for success, ZodType for dynamic
|
|
188
187
|
* validation, or AssertionFailure object for detailed error information
|
|
@@ -194,14 +193,10 @@ export type AssertionImplFnSync<Parts extends AssertionParts> = (...values: Pars
|
|
|
194
193
|
* Maps an {@link AssertionPart} to a parameter to an {@link AssertionImpl}.
|
|
195
194
|
*
|
|
196
195
|
* This omits {@link Phrase} parts, which are not received by the implementation.
|
|
197
|
-
*
|
|
198
|
-
* @knipignore
|
|
199
196
|
*/
|
|
200
197
|
export type AssertionImplPart<Part extends AssertionPart> = Part extends PhraseLiteral | PhraseLiteralChoice ? never : Part extends z.ZodPromise ? Promise<z.infer<Part>> : z.infer<Part>;
|
|
201
198
|
/**
|
|
202
199
|
* Maps {@link AssertionParts} to their corresponding {@link AssertionImplPart}.
|
|
203
|
-
*
|
|
204
|
-
* @knipignore
|
|
205
200
|
*/
|
|
206
201
|
export type AssertionImplParts<Parts extends readonly AssertionPart[]> = Parts extends readonly [
|
|
207
202
|
infer First extends AssertionPart,
|
|
@@ -219,7 +214,7 @@ export type AssertionImplParts<Parts extends readonly AssertionPart[]> = Parts e
|
|
|
219
214
|
* the assertion parts and is branded with 'async-schema' for compile-time type
|
|
220
215
|
* safety.
|
|
221
216
|
*
|
|
222
|
-
* @
|
|
217
|
+
* @template Parts - The assertion parts tuple defining the assertion structure
|
|
223
218
|
* @see {@link AssertionImplSchemaSync} for synchronous schema implementations
|
|
224
219
|
* @see {@link AssertionImplFnAsync} for function-based async implementations
|
|
225
220
|
* @see {@link ParsedSubject} for subject type derivation
|
|
@@ -233,7 +228,7 @@ export type AssertionImplSchemaAsync<Parts extends AssertionParts> = z.core.$Zod
|
|
|
233
228
|
* assertion parts and is branded with 'sync-schema' for compile-time type
|
|
234
229
|
* safety.
|
|
235
230
|
*
|
|
236
|
-
* @
|
|
231
|
+
* @template Parts - The assertion parts tuple defining the assertion structure
|
|
237
232
|
* @see {@link AssertionImplSchemaAsync} for asynchronous schema implementations
|
|
238
233
|
* @see {@link AssertionImplFnSync} for function-based sync implementations
|
|
239
234
|
* @see {@link ParsedSubject} for subject type derivation
|
|
@@ -246,7 +241,7 @@ export type AssertionImplSchemaSync<Parts extends AssertionParts> = z.core.$ZodB
|
|
|
246
241
|
* synchronous assertions. Function implementations provide custom validation
|
|
247
242
|
* logic, while schema implementations use Zod schemas for validation.
|
|
248
243
|
*
|
|
249
|
-
* @
|
|
244
|
+
* @template Parts - The assertion parts tuple defining the assertion structure
|
|
250
245
|
* @see {@link AssertionImplFnSync} for function-based implementations
|
|
251
246
|
* @see {@link AssertionImplSchemaSync} for schema-based implementations
|
|
252
247
|
* @see {@link AssertionImplAsync} for async implementation unions
|
|
@@ -258,7 +253,7 @@ export type AssertionImplSchemaSync<Parts extends AssertionParts> = z.core.$ZodB
|
|
|
258
253
|
* synchronous assertions. Function implementations provide custom validation
|
|
259
254
|
* logic, while schema implementations use Zod schemas for validation.
|
|
260
255
|
*
|
|
261
|
-
* @
|
|
256
|
+
* @template Parts - The assertion parts tuple defining the assertion structure
|
|
262
257
|
* @see {@link AssertionImplFnSync} for function-based implementations
|
|
263
258
|
* @see {@link AssertionImplSchemaSync} for schema-based implementations
|
|
264
259
|
* @see {@link AssertionImplAsync} for async implementation unions
|
|
@@ -310,11 +305,10 @@ export type AssertionPart = Phrase | z.ZodType;
|
|
|
310
305
|
* type ChoiceAssertion = [z.any(), ['to be', 'to equal'], z.any()];
|
|
311
306
|
* ```
|
|
312
307
|
*
|
|
313
|
-
* @
|
|
314
|
-
* constraints
|
|
308
|
+
* @template Parts - Extends the base AssertionPart array with tuple constraints
|
|
315
309
|
* @see {@link AssertionPart} for individual part types
|
|
316
310
|
* @see {@link AssertionSlots} for compiled slot representation
|
|
317
|
-
* @see {@link
|
|
311
|
+
* @see {@link createAssertion} for assertion creation from parts
|
|
318
312
|
*/
|
|
319
313
|
export type AssertionParts = NonEmptyTuple<AssertionPart>;
|
|
320
314
|
/**
|
|
@@ -336,7 +330,7 @@ export type AssertionParts = NonEmptyTuple<AssertionPart>;
|
|
|
336
330
|
* type Slots = [PhraseLiteralSlot<'to be a string'>, z.ZodNumber];
|
|
337
331
|
* ```
|
|
338
332
|
*
|
|
339
|
-
* @
|
|
333
|
+
* @template Parts - The readonly array of assertion parts to process
|
|
340
334
|
* @see {@link AssertionSlot} for individual slot type mapping
|
|
341
335
|
* @see {@link AssertionSlots} for filtered and properly typed slot tuples
|
|
342
336
|
* @see {@link NoNeverTuple} for filtering never entries
|
|
@@ -376,7 +370,7 @@ export interface AssertionSchemaSync<Parts extends AssertionParts, Impl extends
|
|
|
376
370
|
* type Slot3 = AssertionSlot<z.ZodString>; // z.ZodString
|
|
377
371
|
* ```
|
|
378
372
|
*
|
|
379
|
-
* @
|
|
373
|
+
* @template Part - The assertion part to convert to a slot
|
|
380
374
|
* @see {@link PhraseLiteralSlot} for string literal slots
|
|
381
375
|
* @see {@link PhraseLiteralChoiceSlot} for choice-based slots
|
|
382
376
|
* @see {@link AssertionSlots} for complete slot tuples
|
|
@@ -393,8 +387,12 @@ export type AssertionSlot<Part extends AssertionPart> = Part extends string ? Ph
|
|
|
393
387
|
* The resulting tuple:
|
|
394
388
|
*
|
|
395
389
|
* 1. Has `never` entries filtered out to maintain proper tuple structure
|
|
396
|
-
* 2.
|
|
397
|
-
*
|
|
390
|
+
* 2. Will include an implicit subject slot {@link AssertionParts} with a
|
|
391
|
+
* {@link PhraseLiteral}/{@link PhraseLiteralChoice} in the first position.
|
|
392
|
+
* 3. Contains branded slots for
|
|
393
|
+
* {@link PhraseLiteral PhraseLiterals}/{@link PhraseLiteralChoice PhraseLiteralChoices}
|
|
394
|
+
* to enable phrase matching; differentiates from a user-created
|
|
395
|
+
* {@link z.ZodLiteral ZodLiteral}.
|
|
398
396
|
*
|
|
399
397
|
* @example
|
|
400
398
|
*
|
|
@@ -408,7 +406,7 @@ export type AssertionSlot<Part extends AssertionPart> = Part extends string ? Ph
|
|
|
408
406
|
* // Result: [z.ZodString, PhraseLiteralSlot<'to match'>, z.ZodRegExp]
|
|
409
407
|
* ```
|
|
410
408
|
*
|
|
411
|
-
* @
|
|
409
|
+
* @template Parts - The assertion parts to convert to slots
|
|
412
410
|
* @see {@link AssertionSlot} for individual slot mapping
|
|
413
411
|
* @see {@link AssertionPartsToSlots} for the underlying mapping logic
|
|
414
412
|
* @see {@link NoNeverTuple} for never filtering
|
|
@@ -438,8 +436,6 @@ export interface AssertionSync<Parts extends AssertionParts = AssertionParts, Im
|
|
|
438
436
|
}
|
|
439
437
|
/**
|
|
440
438
|
* The base structure for parsed assertion results.
|
|
441
|
-
*
|
|
442
|
-
* @knipignore
|
|
443
439
|
*/
|
|
444
440
|
export interface BaseParsedResult<Parts extends AssertionParts> {
|
|
445
441
|
/**
|
|
@@ -449,58 +445,15 @@ export interface BaseParsedResult<Parts extends AssertionParts> {
|
|
|
449
445
|
exactMatch?: boolean;
|
|
450
446
|
/**
|
|
451
447
|
* Present only if `success` is `true`. The parsed values mapped to the slots
|
|
452
|
-
* of {@link
|
|
448
|
+
* of an {@link Assertion}.
|
|
453
449
|
*/
|
|
454
450
|
parsedValues?: ParsedValues<Parts>;
|
|
455
451
|
/**
|
|
456
|
-
* Whether the args were successfully parsed against the slots of
|
|
457
|
-
* {@link
|
|
452
|
+
* Whether the args were successfully parsed against the slots of an
|
|
453
|
+
* {@link Assertion}.
|
|
458
454
|
*/
|
|
459
455
|
success: boolean;
|
|
460
456
|
}
|
|
461
|
-
/**
|
|
462
|
-
* Type for extracting individual builtin async assertion types.
|
|
463
|
-
*
|
|
464
|
-
* This type extracts the element types from the builtin async assertions array,
|
|
465
|
-
* providing a union of all available async assertion types in the framework.
|
|
466
|
-
*
|
|
467
|
-
* @see {@link BuiltinAsyncAssertions} for the full array type
|
|
468
|
-
* @see {@link AsyncAssertions} for the actual assertion implementations
|
|
469
|
-
*/
|
|
470
|
-
export type BuiltinAsyncAssertion = ArrayValues<BuiltinAsyncAssertions>;
|
|
471
|
-
/**
|
|
472
|
-
* Type representing the collection of all builtin async assertions.
|
|
473
|
-
*
|
|
474
|
-
* This type represents the compile-time type of the `AsyncAssertions` constant,
|
|
475
|
-
* providing type information for all async assertion implementations included
|
|
476
|
-
* in the framework by default.
|
|
477
|
-
*
|
|
478
|
-
* @see {@link AsyncAssertions} for the actual assertion implementations
|
|
479
|
-
* @see {@link BuiltinAsyncAssertion} for individual assertion types
|
|
480
|
-
*/
|
|
481
|
-
export type BuiltinAsyncAssertions = typeof AsyncAssertions;
|
|
482
|
-
/**
|
|
483
|
-
* Type for extracting individual builtin sync assertion types.
|
|
484
|
-
*
|
|
485
|
-
* This type extracts the element types from the builtin sync assertions array,
|
|
486
|
-
* providing a union of all available synchronous assertion types in the
|
|
487
|
-
* framework.
|
|
488
|
-
*
|
|
489
|
-
* @see {@link BuiltinSyncAssertions} for the full array type
|
|
490
|
-
* @see {@link SyncAssertions} for the actual assertion implementations
|
|
491
|
-
*/
|
|
492
|
-
export type BuiltinSyncAssertion = ArrayValues<BuiltinSyncAssertions>;
|
|
493
|
-
/**
|
|
494
|
-
* Type representing the collection of all builtin sync assertions.
|
|
495
|
-
*
|
|
496
|
-
* This type represents the compile-time type of the `SyncAssertions` constant,
|
|
497
|
-
* providing type information for all synchronous assertion implementations
|
|
498
|
-
* included in the framework by default.
|
|
499
|
-
*
|
|
500
|
-
* @see {@link SyncAssertions} for the actual assertion implementations
|
|
501
|
-
* @see {@link BuiltinSyncAssertion} for individual assertion types
|
|
502
|
-
*/
|
|
503
|
-
export type BuiltinSyncAssertions = typeof SyncAssertions;
|
|
504
457
|
/**
|
|
505
458
|
* Utility type for parsed values that may be empty.
|
|
506
459
|
*
|
|
@@ -509,7 +462,7 @@ export type BuiltinSyncAssertions = typeof SyncAssertions;
|
|
|
509
462
|
* tuple). It uses `NoNeverTuple` to filter out `never` types that may arise
|
|
510
463
|
* during the recursive processing.
|
|
511
464
|
*
|
|
512
|
-
* @
|
|
465
|
+
* @template Parts - The assertion parts to process
|
|
513
466
|
* @see {@link ParsedValues} for the standard parsed values type
|
|
514
467
|
* @see {@link NoNeverTuple} for never-type filtering
|
|
515
468
|
*/
|
|
@@ -539,7 +492,7 @@ export type MaybeEmptyParsedValues<Parts extends readonly AssertionPart[]> = NoN
|
|
|
539
492
|
* type Mixed = NoNeverTuple<readonly [boolean, never, string]>; // readonly [boolean, string]
|
|
540
493
|
* ```
|
|
541
494
|
*
|
|
542
|
-
* @
|
|
495
|
+
* @template T - The readonly tuple type to filter
|
|
543
496
|
* @see {@link AssertionPartsToSlots} for usage in slot processing
|
|
544
497
|
* @see {@link AssertionSlots} for filtered slot tuples
|
|
545
498
|
*/
|
|
@@ -571,7 +524,7 @@ export type NoNeverTuple<T extends readonly unknown[]> = T extends readonly [
|
|
|
571
524
|
* };
|
|
572
525
|
* ```
|
|
573
526
|
*
|
|
574
|
-
* @
|
|
527
|
+
* @template Parts - The assertion parts tuple defining expected structure
|
|
575
528
|
* @see {@link ParsedResultSuccess} for successful parse results
|
|
576
529
|
* @see {@link ParsedResultFailure} for failed parse results
|
|
577
530
|
* @see {@link AssertionSync.parseValues} and {@link AssertionAsync.parseValuesAsync} for usage context
|
|
@@ -600,7 +553,7 @@ export interface ParsedResultFailure extends BaseParsedResult<never> {
|
|
|
600
553
|
* interface contains the validated arguments and metadata about the match
|
|
601
554
|
* quality. The assertion can be executed using the `parsedValues`.
|
|
602
555
|
*
|
|
603
|
-
* @
|
|
556
|
+
* @template Parts - The assertion parts tuple defining the expected structure
|
|
604
557
|
* @see {@link ParsedResultFailure} for failed parsing results
|
|
605
558
|
* @see {@link BaseParsedResult} for shared result properties
|
|
606
559
|
*/
|
|
@@ -638,7 +591,7 @@ export interface ParsedResultSuccess<Parts extends AssertionParts> extends BaseP
|
|
|
638
591
|
* type NumericSubject = ParsedSubject<NumericParts>; // number
|
|
639
592
|
* ```
|
|
640
593
|
*
|
|
641
|
-
* @
|
|
594
|
+
* @template Parts - The assertion parts tuple defining the assertion structure
|
|
642
595
|
* @see {@link ParsedValues} for the complete parsed values tuple
|
|
643
596
|
* @see {@link AssertionImpl} for how subjects are used in implementations
|
|
644
597
|
*/
|
|
@@ -661,7 +614,7 @@ export type ParsedSubject<Parts extends AssertionParts> = ParsedValues<Parts> ex
|
|
|
661
614
|
* // ParsedValues = [typeof obj, typeof shape]
|
|
662
615
|
* ```
|
|
663
616
|
*
|
|
664
|
-
* @
|
|
617
|
+
* @template Parts - The assertion parts tuple defining the expected structure
|
|
665
618
|
* @see {@link ParsedSubject} for extracting just the subject
|
|
666
619
|
* @see {@link MaybeEmptyParsedValues} for the underlying value processing
|
|
667
620
|
* @see {@link AssertionImpl} for how these values are consumed
|
|
@@ -757,7 +710,7 @@ export type PhraseLiteralChoice = NonEmptyTuple<string>;
|
|
|
757
710
|
* The `__values` property might be redundant since values should be derivable
|
|
758
711
|
* from the ZodLiteral metadata, but it provides type-level access to the
|
|
759
712
|
* choices.
|
|
760
|
-
* @
|
|
713
|
+
* @template H - The readonly tuple of string choices
|
|
761
714
|
* @see {@link PhraseLiteralChoice} for the source type
|
|
762
715
|
* @see {@link PhraseLiteralSlot} for single phrase slots
|
|
763
716
|
* @see {@link AssertionSlot} for slot type mapping
|
|
@@ -776,15 +729,12 @@ export type PhraseLiteralChoiceSlot<H extends readonly [string, ...string[]]> =
|
|
|
776
729
|
* This type might be redundant since the value should be derivable from the
|
|
777
730
|
* ZodLiteral's value property, but it provides type-level access to the
|
|
778
731
|
* literal.
|
|
779
|
-
* @
|
|
732
|
+
* @template T - The string literal type
|
|
780
733
|
* @see {@link PhraseLiteral} for the source type
|
|
781
734
|
* @see {@link PhraseLiteralChoiceSlot} for choice phrase slots
|
|
782
735
|
* @see {@link AssertionSlot} for slot type mapping
|
|
783
736
|
*/
|
|
784
|
-
export type PhraseLiteralSlot<T extends string> = z.core.$ZodBranded<z.ZodLiteral<T>, 'string-literal'>;
|
|
785
|
-
* Object which can returned by assertion implementation functions to provide
|
|
786
|
-
* contextual information to an `AssertionError`
|
|
787
|
-
*/
|
|
737
|
+
export type PhraseLiteralSlot<T extends string> = z.core.$ZodBranded<z.ZodLiteral<T>, 'string-literal'>;
|
|
788
738
|
/**
|
|
789
739
|
* Type for a raw (unbranded) synchronous schema assertion implementation.
|
|
790
740
|
*
|
|
@@ -793,7 +743,8 @@ export type PhraseLiteralSlot<T extends string> = z.core.$ZodBranded<z.ZodLitera
|
|
|
793
743
|
* type is not branded and represents the underlying schema before it is
|
|
794
744
|
* processed by the assertion creation system.
|
|
795
745
|
*
|
|
796
|
-
* @
|
|
746
|
+
* @template Parts The tuple defining the assertion structure
|
|
747
|
+
* @useDeclaredType
|
|
797
748
|
* @see {@link AssertionImplSchemaSync} for the branded version
|
|
798
749
|
* @see {@link ParsedSubject} for subject type derivation
|
|
799
750
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-types.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"assertion-types.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC;AAIhC;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GACzB,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GACrC,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,CAAC,GAAG,EAAE,GA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;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,IAC1E,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,gBAAgB,CAAC,GAAG;IAChD,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;CACtB,CAAC;AACJ;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAClE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EACf,gBAAgB,CACjB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,0BAA0B,CAAC,KAAK,SAAS,cAAc,IACjE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -65,45 +65,17 @@
|
|
|
65
65
|
* @see {@link AssertionImplSync} for synchronous implementation types
|
|
66
66
|
* @see {@link AssertionImplAsync} for asynchronous implementation types
|
|
67
67
|
*/
|
|
68
|
-
import
|
|
68
|
+
import { type CreateAssertionFn, type CreateAsyncAssertionFn } from '../types.js';
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
* {@link z.ZodType Zod schema}.
|
|
70
|
+
* {@inheritDoc CreateAssertionFn}
|
|
72
71
|
*
|
|
73
|
-
* @param parts Assertion parts defining the shape of the assertion
|
|
74
|
-
* @param impl Implementation as a Zod schema
|
|
75
|
-
* @returns New `SchemaAssertion` instance
|
|
76
72
|
* @throws {TypeError} Invalid assertion implementation type
|
|
77
73
|
*/
|
|
78
|
-
export declare
|
|
74
|
+
export declare const createAssertion: CreateAssertionFn;
|
|
79
75
|
/**
|
|
80
|
-
*
|
|
81
|
-
* implementation function.
|
|
76
|
+
* {@inheritDoc CreateAsyncAssertionFn}
|
|
82
77
|
*
|
|
83
|
-
* @param parts Assertion parts defining the shape of the assertion
|
|
84
|
-
* @param impl Implementation as a function
|
|
85
|
-
* @returns New `FunctionAssertion` instance
|
|
86
78
|
* @throws {TypeError} Invalid assertion implementation type
|
|
87
79
|
*/
|
|
88
|
-
export declare
|
|
89
|
-
/**
|
|
90
|
-
* Create an async `Assertion` from {@link AssertionParts parts} and an async
|
|
91
|
-
* {@link z.ZodType Zod schema}.
|
|
92
|
-
*
|
|
93
|
-
* @param parts Assertion parts defining the shape of the assertion
|
|
94
|
-
* @param impl Implementation as a Zod schema (potentially async)
|
|
95
|
-
* @returns New `BupkisAssertionSchemaAsync` instance
|
|
96
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
97
|
-
*/
|
|
98
|
-
export declare function createAsyncAssertion<const Parts extends AssertionParts, Impl extends AssertionImplSchemaAsync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionSchemaAsync<Parts, Impl, Slots>;
|
|
99
|
-
/**
|
|
100
|
-
* Create an async `Assertion` from {@link AssertionParts parts} and an
|
|
101
|
-
* implementation function.
|
|
102
|
-
*
|
|
103
|
-
* @param parts Assertion parts defining the shape of the assertion
|
|
104
|
-
* @param impl Implementation as a function (potentially async)
|
|
105
|
-
* @returns New `FunctionAssertion` instance
|
|
106
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
107
|
-
*/
|
|
108
|
-
export declare function createAsyncAssertion<const Parts extends AssertionParts, Impl extends AssertionImplFnAsync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionFunctionAsync<Parts, Impl, Slots>;
|
|
80
|
+
export declare const createAsyncAssertion: CreateAsyncAssertionFn;
|
|
109
81
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAWH,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAWrB;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,iBAwC7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,sBAiClC,CAAC"}
|
|
@@ -67,14 +67,18 @@
|
|
|
67
67
|
* @see {@link AssertionImplAsync} for asynchronous implementation types
|
|
68
68
|
*/
|
|
69
69
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
-
exports.createAssertion =
|
|
71
|
-
exports.createAsyncAssertion = createAsyncAssertion;
|
|
70
|
+
exports.createAsyncAssertion = exports.createAssertion = void 0;
|
|
72
71
|
const v4_1 = require("zod/v4");
|
|
73
72
|
const guards_js_1 = require("../guards.js");
|
|
74
73
|
const assertion_async_js_1 = require("./assertion-async.js");
|
|
75
74
|
const assertion_sync_js_1 = require("./assertion-sync.js");
|
|
76
75
|
const slotify_js_1 = require("./slotify.js");
|
|
77
|
-
|
|
76
|
+
/**
|
|
77
|
+
* {@inheritDoc CreateAssertionFn}
|
|
78
|
+
*
|
|
79
|
+
* @throws {TypeError} Invalid assertion implementation type
|
|
80
|
+
*/
|
|
81
|
+
const createAssertion = (parts, impl) => {
|
|
78
82
|
if (!Array.isArray(parts)) {
|
|
79
83
|
throw new TypeError('First parameter must be an array');
|
|
80
84
|
}
|
|
@@ -103,8 +107,14 @@ function createAssertion(parts, impl) {
|
|
|
103
107
|
throw err;
|
|
104
108
|
}
|
|
105
109
|
throw new TypeError('Assertion implementation must be a function, Zod schema or Zod schema factory');
|
|
106
|
-
}
|
|
107
|
-
|
|
110
|
+
};
|
|
111
|
+
exports.createAssertion = createAssertion;
|
|
112
|
+
/**
|
|
113
|
+
* {@inheritDoc CreateAsyncAssertionFn}
|
|
114
|
+
*
|
|
115
|
+
* @throws {TypeError} Invalid assertion implementation type
|
|
116
|
+
*/
|
|
117
|
+
const createAsyncAssertion = (parts, impl) => {
|
|
108
118
|
if (!Array.isArray(parts)) {
|
|
109
119
|
throw new TypeError('First parameter must be an array');
|
|
110
120
|
}
|
|
@@ -125,5 +135,6 @@ function createAsyncAssertion(parts, impl) {
|
|
|
125
135
|
return new assertion_async_js_1.BupkisAssertionFunctionAsync(parts, slots, impl);
|
|
126
136
|
}
|
|
127
137
|
throw new TypeError('Assertion implementation must be a function, Zod schema or Zod schema factory');
|
|
128
|
-
}
|
|
138
|
+
};
|
|
139
|
+
exports.createAsyncAssertion = createAsyncAssertion;
|
|
129
140
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;;;AAEH,+BAA2B;AAQ3B,4CAA+D;AAK/D,6DAG8B;AAC9B,2DAG6B;AAC7B,6CAAuC;AAEvC;;;;GAIG;AACI,MAAM,eAAe,GAAsB,CAIhD,KAAY,EACZ,IAAU,EACV,EAAE;IACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,C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
|
|
12
|
-
export declare const AsyncAssertions: readonly [import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args:
|
|
12
|
+
export declare const AsyncAssertions: readonly [import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to resolve", "to fulfill"]], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown) => Promise<boolean>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to resolve", "to fulfill"]>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to resolve", "to fulfill"]], (subject: PromiseLike<unknown>) => Promise<boolean>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to resolve", "to fulfill"]>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, "to reject"], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown) => Promise<boolean>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralSlot<"to reject">]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, "to reject"], (subject: PromiseLike<unknown>) => Promise<boolean>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralSlot<"to reject">]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with a", "to reject with an"], z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("../../types.js").Constructor) => Promise<boolean>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with a", "to reject with an"], z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>], (subject: PromiseLike<unknown>, ctor: import("../../types.js").Constructor) => Promise<boolean>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with"], z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: string | RegExp | {
|
|
13
13
|
[x: string]: unknown;
|
|
14
|
-
}) => Promise<boolean>, readonly [z.ZodCustom<(...args:
|
|
14
|
+
}) => Promise<boolean>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with"]>, z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with"], z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>], (subject: PromiseLike<unknown>, param: string | RegExp | {
|
|
15
15
|
[x: string]: unknown;
|
|
16
|
-
}) => Promise<boolean>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with"]>, z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve
|
|
16
|
+
}) => Promise<boolean>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with"]>, z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>], (promise: PromiseLike<unknown>, param: string | RegExp | {
|
|
17
17
|
[x: string]: unknown;
|
|
18
18
|
}) => Promise<boolean | {
|
|
19
19
|
actual: unknown;
|
|
@@ -27,7 +27,7 @@ export declare const AsyncAssertions: readonly [import("../assertion-types.js").
|
|
|
27
27
|
};
|
|
28
28
|
message: string;
|
|
29
29
|
expect?: never;
|
|
30
|
-
}>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve
|
|
30
|
+
}>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>]>, import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: string | RegExp | {
|
|
31
31
|
[x: string]: unknown;
|
|
32
32
|
}) => Promise<boolean | {
|
|
33
33
|
actual: unknown;
|
|
@@ -41,5 +41,5 @@ export declare const AsyncAssertions: readonly [import("../assertion-types.js").
|
|
|
41
41
|
};
|
|
42
42
|
message: string;
|
|
43
43
|
expect?: never;
|
|
44
|
-
}>, readonly [z.ZodCustom<(...args:
|
|
44
|
+
}>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, z.ZodUnion<readonly [z.ZodString, z.ZodCustom<RegExp, RegExp>, z.ZodObject<{}, z.core.$loose>]>]>];
|
|
45
45
|
//# sourceMappingURL=async.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/assertion/impl/async.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AA2B3B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/assertion/impl/async.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AA2B3B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;maAoPlB,CAAC"}
|
|
@@ -159,7 +159,7 @@ exports.AsyncAssertions = [
|
|
|
159
159
|
}),
|
|
160
160
|
(0, create_js_1.createAsyncAssertion)([
|
|
161
161
|
schema_js_1.WrappedPromiseLikeSchema,
|
|
162
|
-
['to fulfill with value satisfying', 'to resolve
|
|
162
|
+
['to fulfill with value satisfying', 'to resolve with value satisfying'],
|
|
163
163
|
v4_1.z.union([v4_1.z.string(), v4_1.z.instanceof(RegExp), v4_1.z.looseObject({})]),
|
|
164
164
|
], async (promise, param) => {
|
|
165
165
|
let value;
|
|
@@ -207,7 +207,7 @@ exports.AsyncAssertions = [
|
|
|
207
207
|
}),
|
|
208
208
|
(0, create_js_1.createAsyncAssertion)([
|
|
209
209
|
schema_js_1.FunctionSchema,
|
|
210
|
-
['to fulfill with value satisfying', 'to resolve
|
|
210
|
+
['to fulfill with value satisfying', 'to resolve with value satisfying'],
|
|
211
211
|
v4_1.z.union([v4_1.z.string(), v4_1.z.instanceof(RegExp), v4_1.z.looseObject({})]),
|
|
212
212
|
], async (subject, param) => {
|
|
213
213
|
let value;
|