bupkis 0.7.2 → 0.9.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 +15 -0
- package/README.md +19 -2
- package/dist/commonjs/assertion/assertion-async.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-async.js +37 -7
- package/dist/commonjs/assertion/assertion-async.js.map +1 -1
- package/dist/commonjs/assertion/assertion-sync.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-sync.js +32 -8
- package/dist/commonjs/assertion/assertion-sync.js.map +1 -1
- package/dist/commonjs/assertion/assertion-types.d.ts +37 -31
- package/dist/commonjs/assertion/assertion-types.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-types.js +0 -32
- package/dist/commonjs/assertion/assertion-types.js.map +1 -1
- package/dist/commonjs/assertion/assertion.d.ts +3 -21
- package/dist/commonjs/assertion/assertion.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion.js +42 -27
- package/dist/commonjs/assertion/assertion.js.map +1 -1
- package/dist/commonjs/assertion/create.d.ts +2 -0
- package/dist/commonjs/assertion/create.d.ts.map +1 -1
- package/dist/commonjs/assertion/create.js +38 -42
- package/dist/commonjs/assertion/create.js.map +1 -1
- package/dist/commonjs/assertion/impl/assertion-util.d.ts +16 -4
- package/dist/commonjs/assertion/impl/assertion-util.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/assertion-util.js +20 -15
- package/dist/commonjs/assertion/impl/assertion-util.js.map +1 -1
- package/dist/commonjs/assertion/impl/async-parametric.d.ts +63 -11
- package/dist/commonjs/assertion/impl/async-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/async-parametric.js +89 -52
- package/dist/commonjs/assertion/impl/async-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/async.d.ts +116 -12
- package/dist/commonjs/assertion/impl/async.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/async.js +1 -1
- package/dist/commonjs/assertion/impl/sync-basic.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-basic.js +6 -4
- package/dist/commonjs/assertion/impl/sync-basic.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-collection.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-collection.js +24 -14
- package/dist/commonjs/assertion/impl/sync-collection.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-esoteric.d.ts +1 -5
- package/dist/commonjs/assertion/impl/sync-esoteric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-esoteric.js +11 -13
- package/dist/commonjs/assertion/impl/sync-esoteric.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts +27 -7
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.js +75 -51
- package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync.d.ts +54 -22
- package/dist/commonjs/assertion/impl/sync.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync.js +1 -1
- package/dist/commonjs/assertion/impl/sync.js.map +1 -1
- package/dist/commonjs/assertion/index.d.ts +1 -1
- package/dist/commonjs/assertion/index.d.ts.map +1 -1
- package/dist/commonjs/assertion/index.js +0 -1
- package/dist/commonjs/assertion/index.js.map +1 -1
- package/dist/commonjs/assertion/slotify.d.ts +1 -13
- package/dist/commonjs/assertion/slotify.d.ts.map +1 -1
- package/dist/commonjs/assertion/slotify.js +49 -16
- package/dist/commonjs/assertion/slotify.js.map +1 -1
- package/dist/commonjs/bootstrap.d.ts +85 -17
- package/dist/commonjs/bootstrap.d.ts.map +1 -1
- package/dist/commonjs/bootstrap.js +1 -0
- package/dist/commonjs/bootstrap.js.map +1 -1
- package/dist/commonjs/diff.d.ts +51 -0
- package/dist/commonjs/diff.d.ts.map +1 -0
- package/dist/commonjs/diff.js +279 -0
- package/dist/commonjs/diff.js.map +1 -0
- package/dist/commonjs/error.d.ts +37 -18
- package/dist/commonjs/error.d.ts.map +1 -1
- package/dist/commonjs/error.js +44 -30
- package/dist/commonjs/error.js.map +1 -1
- package/dist/commonjs/expect.d.ts.map +1 -1
- package/dist/commonjs/expect.js +131 -78
- package/dist/commonjs/expect.js.map +1 -1
- package/dist/commonjs/guards.d.ts +24 -10
- package/dist/commonjs/guards.d.ts.map +1 -1
- package/dist/commonjs/guards.js +56 -39
- package/dist/commonjs/guards.js.map +1 -1
- package/dist/commonjs/index.d.ts +85 -17
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/internal-schema.d.ts +25 -0
- package/dist/commonjs/internal-schema.d.ts.map +1 -0
- package/dist/commonjs/internal-schema.js +209 -0
- package/dist/commonjs/internal-schema.js.map +1 -0
- package/dist/commonjs/schema.d.ts.map +1 -1
- package/dist/commonjs/schema.js +3 -2
- package/dist/commonjs/schema.js.map +1 -1
- package/dist/commonjs/use.js +22 -8
- package/dist/commonjs/use.js.map +1 -1
- package/dist/commonjs/util.d.ts +1 -0
- package/dist/commonjs/util.d.ts.map +1 -1
- package/dist/commonjs/util.js +14 -10
- package/dist/commonjs/util.js.map +1 -1
- package/dist/commonjs/value-to-schema.d.ts +1 -0
- package/dist/commonjs/value-to-schema.d.ts.map +1 -1
- package/dist/commonjs/value-to-schema.js +19 -12
- package/dist/commonjs/value-to-schema.js.map +1 -1
- package/dist/esm/assertion/assertion-async.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-async.js +37 -7
- package/dist/esm/assertion/assertion-async.js.map +1 -1
- package/dist/esm/assertion/assertion-sync.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-sync.js +32 -8
- package/dist/esm/assertion/assertion-sync.js.map +1 -1
- package/dist/esm/assertion/assertion-types.d.ts +37 -31
- package/dist/esm/assertion/assertion-types.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-types.js +1 -31
- package/dist/esm/assertion/assertion-types.js.map +1 -1
- package/dist/esm/assertion/assertion.d.ts +3 -21
- package/dist/esm/assertion/assertion.d.ts.map +1 -1
- package/dist/esm/assertion/assertion.js +42 -27
- package/dist/esm/assertion/assertion.js.map +1 -1
- package/dist/esm/assertion/create.d.ts +2 -0
- package/dist/esm/assertion/create.d.ts.map +1 -1
- package/dist/esm/assertion/create.js +37 -41
- package/dist/esm/assertion/create.js.map +1 -1
- package/dist/esm/assertion/impl/assertion-util.d.ts +16 -4
- package/dist/esm/assertion/impl/assertion-util.d.ts.map +1 -1
- package/dist/esm/assertion/impl/assertion-util.js +20 -15
- package/dist/esm/assertion/impl/assertion-util.js.map +1 -1
- package/dist/esm/assertion/impl/async-parametric.d.ts +63 -11
- package/dist/esm/assertion/impl/async-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/async-parametric.js +89 -52
- package/dist/esm/assertion/impl/async-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/async.d.ts +116 -12
- 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-basic.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-basic.js +6 -4
- package/dist/esm/assertion/impl/sync-basic.js.map +1 -1
- package/dist/esm/assertion/impl/sync-collection.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-collection.js +24 -14
- package/dist/esm/assertion/impl/sync-collection.js.map +1 -1
- package/dist/esm/assertion/impl/sync-esoteric.d.ts +1 -5
- package/dist/esm/assertion/impl/sync-esoteric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-esoteric.js +11 -13
- package/dist/esm/assertion/impl/sync-esoteric.js.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.d.ts +27 -7
- package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.js +75 -51
- package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/sync.d.ts +54 -22
- package/dist/esm/assertion/impl/sync.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync.js +2 -2
- package/dist/esm/assertion/impl/sync.js.map +1 -1
- package/dist/esm/assertion/index.d.ts +1 -1
- package/dist/esm/assertion/index.d.ts.map +1 -1
- package/dist/esm/assertion/index.js +0 -1
- package/dist/esm/assertion/index.js.map +1 -1
- package/dist/esm/assertion/slotify.d.ts +1 -13
- package/dist/esm/assertion/slotify.d.ts.map +1 -1
- package/dist/esm/assertion/slotify.js +50 -17
- package/dist/esm/assertion/slotify.js.map +1 -1
- package/dist/esm/bootstrap.d.ts +85 -17
- package/dist/esm/bootstrap.d.ts.map +1 -1
- package/dist/esm/bootstrap.js +1 -0
- package/dist/esm/bootstrap.js.map +1 -1
- package/dist/esm/diff.d.ts +51 -0
- package/dist/esm/diff.d.ts.map +1 -0
- package/dist/esm/diff.js +273 -0
- package/dist/esm/diff.js.map +1 -0
- package/dist/esm/error.d.ts +37 -18
- package/dist/esm/error.d.ts.map +1 -1
- package/dist/esm/error.js +41 -27
- package/dist/esm/error.js.map +1 -1
- package/dist/esm/expect.d.ts.map +1 -1
- package/dist/esm/expect.js +133 -80
- package/dist/esm/expect.js.map +1 -1
- package/dist/esm/guards.d.ts +24 -10
- package/dist/esm/guards.d.ts.map +1 -1
- package/dist/esm/guards.js +52 -36
- package/dist/esm/guards.js.map +1 -1
- package/dist/esm/index.d.ts +85 -17
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/internal-schema.d.ts +25 -0
- package/dist/esm/internal-schema.d.ts.map +1 -0
- package/dist/esm/internal-schema.js +203 -0
- package/dist/esm/internal-schema.js.map +1 -0
- package/dist/esm/schema.d.ts.map +1 -1
- package/dist/esm/schema.js +3 -2
- package/dist/esm/schema.js.map +1 -1
- package/dist/esm/use.js +19 -6
- package/dist/esm/use.js.map +1 -1
- package/dist/esm/util.d.ts +1 -0
- package/dist/esm/util.d.ts.map +1 -1
- package/dist/esm/util.js +14 -10
- package/dist/esm/util.js.map +1 -1
- package/dist/esm/value-to-schema.d.ts +1 -0
- package/dist/esm/value-to-schema.d.ts.map +1 -1
- package/dist/esm/value-to-schema.js +20 -13
- package/dist/esm/value-to-schema.js.map +1 -1
- package/package.json +29 -11
- package/src/assertion/assertion-async.ts +42 -14
- package/src/assertion/assertion-sync.ts +40 -17
- package/src/assertion/assertion-types.ts +55 -45
- package/src/assertion/assertion.ts +49 -32
- package/src/assertion/create.ts +46 -65
- package/src/assertion/impl/assertion-util.ts +31 -18
- package/src/assertion/impl/async-parametric.ts +93 -52
- package/src/assertion/impl/async.ts +2 -2
- package/src/assertion/impl/sync-basic.ts +7 -4
- package/src/assertion/impl/sync-collection.ts +34 -14
- package/src/assertion/impl/sync-esoteric.ts +17 -13
- package/src/assertion/impl/sync-parametric.ts +79 -52
- package/src/assertion/impl/sync.ts +2 -2
- package/src/assertion/index.ts +1 -1
- package/src/assertion/slotify.ts +67 -21
- package/src/bootstrap.ts +1 -0
- package/src/diff.ts +343 -0
- package/src/error.ts +66 -31
- package/src/expect.ts +195 -129
- package/src/guards.ts +74 -48
- package/src/internal-schema.ts +246 -0
- package/src/schema.ts +4 -2
- package/src/use.ts +21 -7
- package/src/util.ts +15 -12
- package/src/value-to-schema.ts +21 -13
|
@@ -7,17 +7,5 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Builds slots out of assertion parts.
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* This function converts {@link AssertionParts} into {@link AssertionSlots} by
|
|
16
|
-
* processing string literals and Zod schemas, registering metadata for runtime
|
|
17
|
-
* introspection, and handling validation constraints such as preventing "not "
|
|
18
|
-
* prefixes in string literal parts.
|
|
19
|
-
* @param parts Assertion parts
|
|
20
|
-
* @returns Slots
|
|
21
|
-
*/
|
|
22
|
-
export declare const slotify: <const Parts extends AssertionParts>(parts: Parts) => AssertionSlots<Parts>;
|
|
10
|
+
export {};
|
|
23
11
|
//# sourceMappingURL=slotify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotify.d.ts","sourceRoot":"","sources":["../../../src/assertion/slotify.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG
|
|
1
|
+
{"version":3,"file":"slotify.d.ts","sourceRoot":"","sources":["../../../src/assertion/slotify.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -11,7 +11,7 @@ import { inspect } from 'util';
|
|
|
11
11
|
import { z } from 'zod/v4';
|
|
12
12
|
import { kStringLiteral } from '../constant.js';
|
|
13
13
|
import { AssertionImplementationError } from '../error.js';
|
|
14
|
-
import { isPhraseLiteral, isPhraseLiteralChoice, isZodType, } from '../guards.js';
|
|
14
|
+
import { isPhrase, isPhraseLiteral, isPhraseLiteralChoice, isZodType, } from '../guards.js';
|
|
15
15
|
import { BupkisRegistry } from '../metadata.js';
|
|
16
16
|
/**
|
|
17
17
|
* Builds slots out of assertion parts.
|
|
@@ -21,37 +21,36 @@ import { BupkisRegistry } from '../metadata.js';
|
|
|
21
21
|
* processing string literals and Zod schemas, registering metadata for runtime
|
|
22
22
|
* introspection, and handling validation constraints such as preventing "not "
|
|
23
23
|
* prefixes in string literal parts.
|
|
24
|
+
* @function
|
|
24
25
|
* @param parts Assertion parts
|
|
25
26
|
* @returns Slots
|
|
27
|
+
* @internal
|
|
26
28
|
*/
|
|
27
29
|
export const slotify = (parts) => parts.flatMap((part, index) => {
|
|
28
30
|
const result = [];
|
|
29
|
-
if (index === 0 && (
|
|
31
|
+
if (index === 0 && isPhrase(part)) {
|
|
30
32
|
result.push(z.unknown().describe('subject'));
|
|
31
33
|
}
|
|
32
34
|
if (isPhraseLiteralChoice(part)) {
|
|
33
35
|
if (part.some((p) => p.startsWith('not '))) {
|
|
34
|
-
throw new AssertionImplementationError(`PhraseLiteralChoice at parts[${index}] must not include phrases starting with "not ": ${inspect(part)}`);
|
|
36
|
+
throw new AssertionImplementationError(`PhraseLiteralChoice at parts[${index}] must not include phrases starting with "not "; refactor to be a positive assertion: ${inspect(part)}`);
|
|
35
37
|
}
|
|
36
|
-
result.push(
|
|
37
|
-
.literal(part)
|
|
38
|
-
.brand('string-literal')
|
|
39
|
-
.register(BupkisRegistry, {
|
|
40
|
-
[kStringLiteral]: true,
|
|
41
|
-
values: part,
|
|
42
|
-
}));
|
|
38
|
+
result.push(createPhraseLiteralChoiceSchema(part));
|
|
43
39
|
}
|
|
44
40
|
else if (isPhraseLiteral(part)) {
|
|
45
41
|
if (part.startsWith('not ')) {
|
|
46
42
|
throw new AssertionImplementationError(`PhraseLiteral at parts[${index}] must not start with "not ": ${inspect(part)}`);
|
|
47
43
|
}
|
|
48
|
-
result.push(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
result.push(createPhraseLiteralSchema(part));
|
|
45
|
+
}
|
|
46
|
+
else if (typeof part === 'string' && part === 'and') {
|
|
47
|
+
// Special case: "and" is allowed when followed by a ZodType (for conjunctify)
|
|
48
|
+
if (index + 1 >= parts.length || !isZodType(parts[index + 1])) {
|
|
49
|
+
throw new AssertionImplementationError(`"and" at parts[${index}] must be followed by a Zod schema but was followed by ${index + 1 >= parts.length
|
|
50
|
+
? 'nothing'
|
|
51
|
+
: `${inspect(parts[index + 1])} (${typeof parts[index + 1]})`}`);
|
|
52
|
+
}
|
|
53
|
+
result.push(createPhraseLiteralSchema(part));
|
|
55
54
|
}
|
|
56
55
|
else {
|
|
57
56
|
if (!isZodType(part)) {
|
|
@@ -61,4 +60,38 @@ export const slotify = (parts) => parts.flatMap((part, index) => {
|
|
|
61
60
|
}
|
|
62
61
|
return result;
|
|
63
62
|
});
|
|
63
|
+
/**
|
|
64
|
+
* Creates a schema for a choice of phrase literals
|
|
65
|
+
*
|
|
66
|
+
* This schema is a branded literal schema to differentiate regular strings from
|
|
67
|
+
* phrases.
|
|
68
|
+
*
|
|
69
|
+
* @function
|
|
70
|
+
* @param part Phrase literal choice (tuple of strings)
|
|
71
|
+
* @returns Schema
|
|
72
|
+
*/
|
|
73
|
+
const createPhraseLiteralChoiceSchema = (part) => z
|
|
74
|
+
.literal(part)
|
|
75
|
+
.brand('string-literal')
|
|
76
|
+
.register(BupkisRegistry, {
|
|
77
|
+
[kStringLiteral]: true,
|
|
78
|
+
values: part,
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Creates a schema for a single phrase literal
|
|
82
|
+
*
|
|
83
|
+
* This schema is a branded literal schema to differentiate regular strings from
|
|
84
|
+
* phrases.
|
|
85
|
+
*
|
|
86
|
+
* @function
|
|
87
|
+
* @param part Phrase literal (string)
|
|
88
|
+
* @returns Schema
|
|
89
|
+
*/
|
|
90
|
+
const createPhraseLiteralSchema = (part) => z
|
|
91
|
+
.literal(part)
|
|
92
|
+
.brand('string-literal')
|
|
93
|
+
.register(BupkisRegistry, {
|
|
94
|
+
[kStringLiteral]: true,
|
|
95
|
+
value: part,
|
|
96
|
+
});
|
|
64
97
|
//# sourceMappingURL=slotify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotify.js","sourceRoot":"","sources":["../../../src/assertion/slotify.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"slotify.js","sourceRoot":"","sources":["../../../src/assertion/slotify.ts"],"names":[],"mappings":"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"}
|
package/dist/esm/bootstrap.d.ts
CHANGED
|
@@ -120,15 +120,35 @@ expect: Expect<readonly [import("./types.js").AssertionFunctionSync<readonly [im
|
|
|
120
120
|
}, import("zod/v4/core").$loose>]>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to deep equal", "to deeply equal"]>, import("zod/v4").ZodAny]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, "to throw"], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown) => {
|
|
121
121
|
actual: unknown;
|
|
122
122
|
message: string;
|
|
123
|
-
} | undefined, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralSlot<"to throw">]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw a", "to throw an"], import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor) =>
|
|
124
|
-
actual:
|
|
125
|
-
expected:
|
|
123
|
+
} | undefined, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralSlot<"to throw">]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw a", "to throw an"], import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor) => {
|
|
124
|
+
actual: unknown;
|
|
125
|
+
expected: string;
|
|
126
|
+
message: string;
|
|
127
|
+
} | undefined, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to throw a", "to throw an"]>, import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw", "to throw error satisfying"], import("zod/v4").ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => {
|
|
128
|
+
actual: unknown;
|
|
129
|
+
expected: string;
|
|
126
130
|
message: string;
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
schema?: never;
|
|
132
|
+
subject?: never;
|
|
133
|
+
} | {
|
|
134
|
+
schema: import("zod/v4").ZodType<any, unknown, import("zod/v4/core").$ZodTypeInternals<any, unknown>>;
|
|
135
|
+
subject: {} | null;
|
|
136
|
+
actual?: never;
|
|
137
|
+
expected?: never;
|
|
138
|
+
message?: never;
|
|
139
|
+
}, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to throw", "to throw error satisfying"]>, import("zod/v4").ZodAny]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw a", "to throw an"], import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>, "satisfying", import("zod/v4").ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor, param: any) => {
|
|
140
|
+
actual: unknown;
|
|
129
141
|
expected: string;
|
|
130
142
|
message: string;
|
|
131
|
-
|
|
143
|
+
schema?: never;
|
|
144
|
+
subject?: never;
|
|
145
|
+
} | {
|
|
146
|
+
schema: import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
147
|
+
subject: {} | null;
|
|
148
|
+
actual?: never;
|
|
149
|
+
expected?: never;
|
|
150
|
+
message?: never;
|
|
151
|
+
}, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to throw a", "to throw an"]>, import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>, import("./types.js").PhraseLiteralSlot<"satisfying">, import("zod/v4").ZodAny]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodString, readonly ["includes", "contains", "to include", "to contain"], import("zod/v4").ZodString], (subject: string, expected: string) => {
|
|
132
152
|
actual: string;
|
|
133
153
|
expected: string;
|
|
134
154
|
message: string;
|
|
@@ -149,11 +169,7 @@ expect: Expect<readonly [import("./types.js").AssertionFunctionSync<readonly [im
|
|
|
149
169
|
actual: boolean;
|
|
150
170
|
expected: boolean;
|
|
151
171
|
message: string;
|
|
152
|
-
} | undefined, readonly [import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodNumber, import("zod/v4").ZodSymbol]>, import("./types.js").PhraseLiteralSlot<"to be an enumerable property of">, import("zod/v4").ZodNonOptional<import("zod/v4").ZodUnknown>]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodNonOptional<import("zod/v4").ZodUnknown>, "to have enumerable property", import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodNumber, import("zod/v4").ZodSymbol]>], (
|
|
153
|
-
actual: boolean;
|
|
154
|
-
expected: boolean;
|
|
155
|
-
message: string;
|
|
156
|
-
} | undefined, readonly [import("zod/v4").ZodNonOptional<import("zod/v4").ZodUnknown>, import("./types.js").PhraseLiteralSlot<"to have enumerable property">, import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodNumber, import("zod/v4").ZodSymbol]>]>, import("./types.js").AssertionSchemaSync<readonly ["to be sealed"], import("./types.js").AssertionImplSchemaSync<readonly ["to be sealed"]>, never>, import("./types.js").AssertionSchemaSync<readonly ["to be extensible"], import("./types.js").AssertionImplSchemaSync<readonly ["to be extensible"]>, never>]>,
|
|
172
|
+
} | undefined, readonly [import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodNumber, import("zod/v4").ZodSymbol]>, import("./types.js").PhraseLiteralSlot<"to be an enumerable property of">, import("zod/v4").ZodNonOptional<import("zod/v4").ZodUnknown>]>, import("./types.js").AssertionFunctionSync<readonly [import("zod/v4").ZodNonOptional<import("zod/v4").ZodUnknown>, "to have enumerable property", import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodNumber, import("zod/v4").ZodSymbol]>], (_subject: unknown, key: string | number | symbol) => import("zod/v4").ZodCustom<unknown, unknown>, readonly [import("zod/v4").ZodNonOptional<import("zod/v4").ZodUnknown>, import("./types.js").PhraseLiteralSlot<"to have enumerable property">, import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodNumber, import("zod/v4").ZodSymbol]>]>, import("./types.js").AssertionSchemaSync<readonly ["to be sealed"], import("./types.js").AssertionImplSchemaSync<readonly ["to be sealed"]>, never>, import("./types.js").AssertionSchemaSync<readonly ["to be extensible"], import("./types.js").AssertionImplSchemaSync<readonly ["to be extensible"]>, never>]>,
|
|
157
173
|
/**
|
|
158
174
|
* The main asynchronous assertion function which can execute only built-in
|
|
159
175
|
* assertions.
|
|
@@ -177,22 +193,74 @@ expectAsync: ExpectAsync<readonly [import("./types.js").AssertionFunctionAsync<r
|
|
|
177
193
|
actual: string;
|
|
178
194
|
expected: string;
|
|
179
195
|
message: string;
|
|
180
|
-
} | undefined>, readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralSlot<"to reject">]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with a", "to reject with an"], import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor) => Promise<
|
|
196
|
+
} | undefined>, readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralSlot<"to reject">]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with a", "to reject with an"], import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor) => Promise<{
|
|
181
197
|
actual: string;
|
|
182
198
|
expect: string;
|
|
183
199
|
message: string;
|
|
184
|
-
|
|
200
|
+
expected?: never;
|
|
201
|
+
} | {
|
|
202
|
+
actual: string;
|
|
203
|
+
expected: string;
|
|
204
|
+
message: string;
|
|
205
|
+
expect?: never;
|
|
206
|
+
} | undefined>, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with a", "to reject with an"], import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: PromiseLike<unknown>, ctor: import("./types.js").Constructor) => Promise<{
|
|
185
207
|
actual: string;
|
|
186
208
|
expect: string;
|
|
187
209
|
message: string;
|
|
188
|
-
|
|
189
|
-
|
|
210
|
+
expected?: never;
|
|
211
|
+
} | {
|
|
212
|
+
actual: string;
|
|
213
|
+
expected: string;
|
|
214
|
+
message: string;
|
|
215
|
+
expect?: never;
|
|
216
|
+
} | undefined>, readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, import("zod/v4").ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with error satisfying"], import("zod/v4").ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<{
|
|
217
|
+
actual: string;
|
|
218
|
+
expect: string;
|
|
219
|
+
message: string;
|
|
220
|
+
schema?: never;
|
|
221
|
+
subject?: never;
|
|
222
|
+
} | {
|
|
223
|
+
schema: import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
224
|
+
subject: {} | null;
|
|
225
|
+
actual?: never;
|
|
226
|
+
expect?: never;
|
|
227
|
+
message?: never;
|
|
228
|
+
}>, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to reject with error satisfying"]>, import("zod/v4").ZodAny]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with error satisfying"], import("zod/v4").ZodAny], (subject: PromiseLike<unknown>, param: any) => Promise<{
|
|
229
|
+
actual: string;
|
|
230
|
+
expect: string;
|
|
231
|
+
message: string;
|
|
232
|
+
schema?: never;
|
|
233
|
+
subject?: never;
|
|
234
|
+
} | {
|
|
235
|
+
schema: import("zod/v4").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
236
|
+
subject: {} | null;
|
|
237
|
+
actual?: never;
|
|
238
|
+
expect?: never;
|
|
239
|
+
message?: never;
|
|
240
|
+
}>, readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to reject with error satisfying"]>, import("zod/v4").ZodAny]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], import("zod/v4").ZodAny], (promise: PromiseLike<unknown>, param: any) => Promise<{
|
|
241
|
+
actual: string;
|
|
190
242
|
expect: string;
|
|
191
243
|
message: string;
|
|
192
|
-
|
|
244
|
+
schema?: never;
|
|
245
|
+
subject?: never;
|
|
246
|
+
} | {
|
|
247
|
+
schema: import("zod/v4").ZodType<any, unknown, import("zod/v4/core").$ZodTypeInternals<any, unknown>>;
|
|
248
|
+
subject: unknown;
|
|
249
|
+
actual?: never;
|
|
250
|
+
expect?: never;
|
|
251
|
+
message?: never;
|
|
252
|
+
}>, readonly [import("zod/v4").ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, import("zod/v4").ZodAny]>, import("./types.js").AssertionFunctionAsync<readonly [import("zod/v4").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"], import("zod/v4").ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<{
|
|
193
253
|
actual: string;
|
|
194
254
|
expect: string;
|
|
195
255
|
message: string;
|
|
196
|
-
|
|
256
|
+
schema?: never;
|
|
257
|
+
subject?: never;
|
|
258
|
+
} | {
|
|
259
|
+
schema: import("zod/v4").ZodType<any, unknown, import("zod/v4/core").$ZodTypeInternals<any, unknown>>;
|
|
260
|
+
subject: unknown;
|
|
261
|
+
actual?: never;
|
|
262
|
+
expect?: never;
|
|
263
|
+
message?: never;
|
|
264
|
+
}>, readonly [import("zod/v4").ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, import("zod/v4").ZodAny]>]>;
|
|
197
265
|
export { expect, expectAsync };
|
|
198
266
|
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAyB3D,QAAA;AACE;;;;;;GAMG;AACH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACN;;;;;;GAMG;AACH,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wVACN,CAAC;AAER,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/esm/bootstrap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;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,MAAM;AACJ;;;;;;GAMG;AACH,MAAM;AACN;;;;;;GAMG;AACH,WAAW,GACZ,GAAG,GAAG,CAAC;AAER,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff utilities for generating rich assertion failure output.
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for extracting meaningful actual/expected
|
|
5
|
+
* values from Zod validation errors and generating high-quality diff output
|
|
6
|
+
* using `jest-diff` for assertion failures.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
* @see {@link https://npm.im/jest-diff | jest-diff}
|
|
10
|
+
*/
|
|
11
|
+
import type { DiffOptions } from 'jest-diff';
|
|
12
|
+
import type { z } from 'zod/v4';
|
|
13
|
+
export type { DiffOptions };
|
|
14
|
+
/**
|
|
15
|
+
* Result of extracting diff values from a `ZodError`
|
|
16
|
+
*/
|
|
17
|
+
export interface DiffValues {
|
|
18
|
+
/** The actual value that was validated */
|
|
19
|
+
actual: unknown;
|
|
20
|
+
/** The expected value (corrected version) */
|
|
21
|
+
expected: unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extracts actual and expected values from a `ZodError` for meaningful diffs.
|
|
25
|
+
*
|
|
26
|
+
* @function
|
|
27
|
+
* @param zodError The `ZodError` to extract values from
|
|
28
|
+
* @param subject The original subject that failed validation
|
|
29
|
+
* @returns Object with actual and expected values for diff
|
|
30
|
+
*/
|
|
31
|
+
export declare const extractDiffValues: (zodError: z.ZodError, subject: unknown) => DiffValues;
|
|
32
|
+
/**
|
|
33
|
+
* Generates a rich diff string using jest-diff for assertion failures.
|
|
34
|
+
*
|
|
35
|
+
* @function
|
|
36
|
+
* @param expected The expected value
|
|
37
|
+
* @param actual The actual value
|
|
38
|
+
* @param options Configuration options for diff generation
|
|
39
|
+
* @returns A formatted diff string, or null if values are identical
|
|
40
|
+
*/
|
|
41
|
+
export declare const generateDiff: (expected: unknown, actual: unknown, options?: DiffOptions) => null | string;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if two values should generate a meaningful diff.
|
|
44
|
+
*
|
|
45
|
+
* @function
|
|
46
|
+
* @param actual The actual value
|
|
47
|
+
* @param expected The expected value
|
|
48
|
+
* @returns True if a diff should be generated, false otherwise
|
|
49
|
+
*/
|
|
50
|
+
export declare const shouldGenerateDiff: (actual: unknown, expected: unknown) => boolean;
|
|
51
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAGhC,YAAY,EAAE,WAAW,EAAE,CAAC;AAO5B;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,CAAC,CAAC,QAAQ,EACpB,SAAS,OAAO,KACf,UA4GF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,OAAO,EACjB,QAAQ,OAAO,EACf,UAAS,WAAgB,KACxB,IAAI,GAAG,MAYT,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,OAAO,EACf,UAAU,OAAO,KAChB,OACoE,CAAC"}
|