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
package/dist/esm/guards.js
CHANGED
|
@@ -15,32 +15,36 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @packageDocumentation
|
|
17
17
|
*/
|
|
18
|
-
import { z } from 'zod/v4';
|
|
19
18
|
import { kExpectIt } from './constant.js';
|
|
19
|
+
const { isArray } = Array;
|
|
20
20
|
export function isZodType(value, type) {
|
|
21
21
|
const isValid = isObject(value) &&
|
|
22
22
|
'def' in value &&
|
|
23
23
|
!!value.def &&
|
|
24
24
|
typeof value.def === 'object' &&
|
|
25
25
|
'type' in value.def;
|
|
26
|
-
if (!isValid)
|
|
26
|
+
if (!isValid) {
|
|
27
27
|
return false;
|
|
28
|
-
|
|
28
|
+
}
|
|
29
|
+
if (type === undefined) {
|
|
29
30
|
return true;
|
|
31
|
+
}
|
|
30
32
|
return value.def.type === type;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Type guard for a plain object.
|
|
34
36
|
*
|
|
37
|
+
* @function
|
|
35
38
|
* @param value Value to test
|
|
36
39
|
* @returns `true` if the value is a plain object, `false` otherwise
|
|
37
40
|
*/
|
|
38
41
|
export const isObject = (value) => {
|
|
39
|
-
return typeof value === 'object' && value !== null && !
|
|
42
|
+
return typeof value === 'object' && value !== null && !isArray(value);
|
|
40
43
|
};
|
|
41
44
|
/**
|
|
42
45
|
* Returns `true` if the given value is a {@link z.ZodPromise} schema.
|
|
43
46
|
*
|
|
47
|
+
* @function
|
|
44
48
|
* @param value - Value to test
|
|
45
49
|
* @returns `true` if the value is a `ZodPromise` schema; `false` otherwise
|
|
46
50
|
*/
|
|
@@ -48,6 +52,7 @@ export const isZodPromise = (value) => isZodType(value, 'promise');
|
|
|
48
52
|
/**
|
|
49
53
|
* Checks if a value is "promise-like", meaning it is a "thenable" object.
|
|
50
54
|
*
|
|
55
|
+
* @function
|
|
51
56
|
* @param value - Value to test
|
|
52
57
|
* @returns `true` if the value is promise-like, `false` otherwise
|
|
53
58
|
*/
|
|
@@ -67,6 +72,7 @@ export const isPromiseLike = (value) => isObject(value) &&
|
|
|
67
72
|
* This may be the only way we can determine, at runtime, if a function is a
|
|
68
73
|
* constructor without actually calling it. I am unsure if this only works for
|
|
69
74
|
* classes.
|
|
75
|
+
* @function
|
|
70
76
|
* @param fn - Function to test
|
|
71
77
|
* @returns Whether the function is constructable
|
|
72
78
|
*/
|
|
@@ -76,7 +82,7 @@ export const isConstructible = (fn) => {
|
|
|
76
82
|
}
|
|
77
83
|
try {
|
|
78
84
|
// this will throw if there is no `[[construct]]` slot.. or so I've heard.
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, custom/require-function-tag-in-arrow-functions
|
|
80
86
|
new new Proxy(fn, { construct: () => ({}) })();
|
|
81
87
|
return true;
|
|
82
88
|
}
|
|
@@ -87,6 +93,7 @@ export const isConstructible = (fn) => {
|
|
|
87
93
|
/**
|
|
88
94
|
* Type guard for a boolean value
|
|
89
95
|
*
|
|
96
|
+
* @function
|
|
90
97
|
* @param value Value to check
|
|
91
98
|
* @returns `true` if the value is a boolean, `false` otherwise
|
|
92
99
|
*/
|
|
@@ -94,35 +101,15 @@ export const isBoolean = (value) => typeof value === 'boolean';
|
|
|
94
101
|
/**
|
|
95
102
|
* Type guard for a function value
|
|
96
103
|
*
|
|
104
|
+
* @function
|
|
97
105
|
* @param value Value to check
|
|
98
106
|
* @returns `true` if the value is a function, `false` otherwise
|
|
99
107
|
*/
|
|
100
108
|
export const isFunction = (value) => typeof value === 'function';
|
|
101
|
-
const AssertionFailureSchema = z.object({
|
|
102
|
-
actual: z
|
|
103
|
-
.unknown()
|
|
104
|
-
.optional()
|
|
105
|
-
.describe('The actual value or description of what actually occurred'),
|
|
106
|
-
expected: z
|
|
107
|
-
.unknown()
|
|
108
|
-
.optional()
|
|
109
|
-
.describe('The expected value or description of what was expected to occur'),
|
|
110
|
-
message: z
|
|
111
|
-
.string()
|
|
112
|
-
.optional()
|
|
113
|
-
.describe('A human-readable message describing the failure'),
|
|
114
|
-
});
|
|
115
|
-
/**
|
|
116
|
-
* Type guard for a {@link AssertionFailure} object
|
|
117
|
-
*
|
|
118
|
-
* @param value Value to check
|
|
119
|
-
* @returns `true` if the value is an `AssertionFailure`, `false` otherwise
|
|
120
|
-
* @internal
|
|
121
|
-
*/
|
|
122
|
-
export const isAssertionFailure = (value) => AssertionFailureSchema.safeParse(value).success;
|
|
123
109
|
/**
|
|
124
110
|
* Type guard for a string value
|
|
125
111
|
*
|
|
112
|
+
* @function
|
|
126
113
|
* @param value Value to check
|
|
127
114
|
* @returns `true` if the value is a string, `false` otherwise
|
|
128
115
|
*/
|
|
@@ -130,23 +117,18 @@ export const isString = (value) => typeof value === 'string';
|
|
|
130
117
|
/**
|
|
131
118
|
* Type guard for a non-null object value
|
|
132
119
|
*
|
|
120
|
+
* @function
|
|
133
121
|
* @param value Value to check
|
|
134
122
|
* @returns `true` if the value is an object and not null, `false` otherwise
|
|
135
123
|
*/
|
|
136
124
|
export const isNonNullObject = (value) => typeof value === 'object' && value !== null;
|
|
137
|
-
/**
|
|
138
|
-
* Type guard for a null or non-object value
|
|
139
|
-
*
|
|
140
|
-
* @param value Value to check
|
|
141
|
-
* @returns `true` if the value is null or not an object, `false` otherwise
|
|
142
|
-
*/
|
|
143
|
-
export const isNullOrNonObject = (value) => typeof value !== 'object' || value === null;
|
|
144
125
|
/**
|
|
145
126
|
* Type guard for a valid WeakKey (object, function, or symbol).
|
|
146
127
|
*
|
|
147
128
|
* WeakMaps and WeakSets can only use objects (including functions) or symbols
|
|
148
129
|
* as keys, not primitives like strings, numbers, booleans, null, or undefined.
|
|
149
130
|
*
|
|
131
|
+
* @function
|
|
150
132
|
* @param value Value to check
|
|
151
133
|
* @returns `true` if the value is a valid WeakKey (object, function, or
|
|
152
134
|
* symbol), `false` otherwise
|
|
@@ -157,20 +139,31 @@ export const isWeakKey = (value) => (typeof value === 'object' && value !== null
|
|
|
157
139
|
/**
|
|
158
140
|
* Type guard for a {@link PhraseLiteralChoice}, which is a tuple of strings.
|
|
159
141
|
*
|
|
142
|
+
* @function
|
|
160
143
|
* @param value Assertion part to check
|
|
161
144
|
* @returns `true` if the part is a `PhraseLiteralChoice`, `false` otherwise
|
|
162
145
|
* @internal
|
|
163
146
|
*/
|
|
164
|
-
export const isPhraseLiteralChoice = (value) =>
|
|
147
|
+
export const isPhraseLiteralChoice = (value) => isArray(value) && value.every(isPhraseLiteral);
|
|
165
148
|
/**
|
|
166
149
|
* Type guard for a {@link PhraseLiteral}, which is just a string that does not
|
|
167
150
|
* begin with `not `.
|
|
168
151
|
*
|
|
152
|
+
* @function
|
|
169
153
|
* @param value Assertion part to check
|
|
170
154
|
* @returns `true` if the part is a `PhraseLiteral`, `false` otherwise
|
|
171
155
|
* @internal
|
|
172
156
|
*/
|
|
173
|
-
export const isPhraseLiteral = (value) => isString(value) && !value.startsWith('not ');
|
|
157
|
+
export const isPhraseLiteral = (value) => isString(value) && !value.startsWith('not ') && value !== 'and';
|
|
158
|
+
/**
|
|
159
|
+
* Type guard for a {@link PhraseLiteral} or {@link PhraseLiteralChoice}.
|
|
160
|
+
*
|
|
161
|
+
* @function
|
|
162
|
+
* @param value Value to check
|
|
163
|
+
* @returns `true` if the value is a `PhraseLiteral` or `PhraseLiteralChoice`,
|
|
164
|
+
* `false` otherwise
|
|
165
|
+
*/
|
|
166
|
+
export const isPhrase = (value) => isPhraseLiteral(value) || isPhraseLiteralChoice(value);
|
|
174
167
|
/**
|
|
175
168
|
* Generic type guard for instanceof checks.
|
|
176
169
|
*
|
|
@@ -190,6 +183,7 @@ export const isPhraseLiteral = (value) => isString(value) && !value.startsWith('
|
|
|
190
183
|
* ```
|
|
191
184
|
*
|
|
192
185
|
* @template T - The constructor type to check against
|
|
186
|
+
* @function
|
|
193
187
|
* @param value - Value to test
|
|
194
188
|
* @param ctor - Constructor function to check instanceof
|
|
195
189
|
* @returns `true` if the value is an instance of the constructor, `false`
|
|
@@ -218,6 +212,7 @@ export const isA = (value, ctor) => {
|
|
|
218
212
|
* }
|
|
219
213
|
* ```
|
|
220
214
|
*
|
|
215
|
+
* @function
|
|
221
216
|
* @param value - Value to test
|
|
222
217
|
* @returns `true` if the value is an Error instance, `false` otherwise
|
|
223
218
|
*/
|
|
@@ -243,6 +238,7 @@ export const isError = (value) => isA(value, Error);
|
|
|
243
238
|
* ```
|
|
244
239
|
*
|
|
245
240
|
* @template Subject - The subject type that the executor function operates on
|
|
241
|
+
* @function
|
|
246
242
|
* @param value - Value to test
|
|
247
243
|
* @returns `true` if the value is an ExpectItExecutor function, `false`
|
|
248
244
|
* otherwise
|
|
@@ -250,4 +246,24 @@ export const isError = (value) => isA(value, Error);
|
|
|
250
246
|
export const isExpectItExecutor = (value) => {
|
|
251
247
|
return isFunction(value) && kExpectIt in value && value[kExpectIt] === true;
|
|
252
248
|
};
|
|
249
|
+
/**
|
|
250
|
+
* Type guard for an {@link AssertionPart}, which can be a {@link PhraseLiteral},
|
|
251
|
+
* {@link PhraseLiteralChoice}, or a Zod schema.
|
|
252
|
+
*
|
|
253
|
+
* @function
|
|
254
|
+
* @param value Value to check
|
|
255
|
+
* @returns `true` if the value is an `AssertionPart`, `false` otherwise
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
export const isAssertionPart = (value) => isPhraseLiteral(value) || isPhraseLiteralChoice(value) || isZodType(value);
|
|
259
|
+
/**
|
|
260
|
+
* Type guard for {@link AssertionParts}, which is an array of
|
|
261
|
+
* {@link AssertionPart}.
|
|
262
|
+
*
|
|
263
|
+
* @function
|
|
264
|
+
* @param value Value to check
|
|
265
|
+
* @returns `true` if the value is an `AssertionParts`, `false` otherwise
|
|
266
|
+
* @internal
|
|
267
|
+
*/
|
|
268
|
+
export const isAssertionParts = (value) => isArray(value) && !!value.length && value.every(isAssertionPart);
|
|
253
269
|
//# sourceMappingURL=guards.js.map
|
package/dist/esm/guards.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AA6B1B,MAAM,UAAU,SAAS,CACvB,KAAc,EACd,IAAQ;IAER,MAAM,OAAO,GACX,QAAQ,CAAC,KAAK,CAAC;QACf,KAAK,IAAI,KAAK;QACd,CAAC,CAAC,KAAK,CAAC,GAAG;QACX,OAAO,KAAK,CAAC,GAAG,KAA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,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CACjB,KAAc,EACd,IAAO,EACmB,EAAE;IAC5B,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC;AACzD,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAc,EAAkB,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,KAAc,EACsB,EAAE;IACtC,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAC9E,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAc,EAA0B,EAAE,CACxE,eAAe,CAAC,KAAK,CAAC,IAAI,qBAAqB,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAA2B,EAAE,CAC1E,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -182,15 +182,35 @@ use: import("./types.js").UseFn<readonly [import("./types.js").AssertionFunction
|
|
|
182
182
|
}, z.core.$loose>]>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to deep equal", "to deeply equal"]>, z.ZodAny]>, import("./types.js").AssertionFunctionSync<readonly [z.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) => {
|
|
183
183
|
actual: unknown;
|
|
184
184
|
message: string;
|
|
185
|
-
} | undefined, readonly [z.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 [z.ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw a", "to throw an"], z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor) =>
|
|
186
|
-
actual:
|
|
187
|
-
expected:
|
|
185
|
+
} | undefined, readonly [z.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 [z.ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw a", "to throw an"], z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor) => {
|
|
186
|
+
actual: unknown;
|
|
187
|
+
expected: string;
|
|
188
|
+
message: string;
|
|
189
|
+
} | undefined, readonly [z.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"]>, z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>]>, import("./types.js").AssertionFunctionSync<readonly [z.ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw", "to throw error satisfying"], z.ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => {
|
|
190
|
+
actual: unknown;
|
|
191
|
+
expected: string;
|
|
188
192
|
message: string;
|
|
189
|
-
|
|
190
|
-
|
|
193
|
+
schema?: never;
|
|
194
|
+
subject?: never;
|
|
195
|
+
} | {
|
|
196
|
+
schema: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
197
|
+
subject: {} | null;
|
|
198
|
+
actual?: never;
|
|
199
|
+
expected?: never;
|
|
200
|
+
message?: never;
|
|
201
|
+
}, readonly [z.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"]>, z.ZodAny]>, import("./types.js").AssertionFunctionSync<readonly [z.ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to throw a", "to throw an"], z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>, "satisfying", z.ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("./types.js").Constructor, param: any) => {
|
|
202
|
+
actual: unknown;
|
|
191
203
|
expected: string;
|
|
192
204
|
message: string;
|
|
193
|
-
|
|
205
|
+
schema?: never;
|
|
206
|
+
subject?: never;
|
|
207
|
+
} | {
|
|
208
|
+
schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
209
|
+
subject: {} | null;
|
|
210
|
+
actual?: never;
|
|
211
|
+
expected?: never;
|
|
212
|
+
message?: never;
|
|
213
|
+
}, readonly [z.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"]>, z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>, import("./types.js").PhraseLiteralSlot<"satisfying">, z.ZodAny]>, import("./types.js").AssertionFunctionSync<readonly [z.ZodString, readonly ["includes", "contains", "to include", "to contain"], z.ZodString], (subject: string, expected: string) => {
|
|
194
214
|
actual: string;
|
|
195
215
|
expected: string;
|
|
196
216
|
message: string;
|
|
@@ -211,11 +231,7 @@ use: import("./types.js").UseFn<readonly [import("./types.js").AssertionFunction
|
|
|
211
231
|
actual: boolean;
|
|
212
232
|
expected: boolean;
|
|
213
233
|
message: string;
|
|
214
|
-
} | undefined, readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, import("./types.js").PhraseLiteralSlot<"to be an enumerable property of">, z.ZodNonOptional<z.ZodUnknown>]>, import("./types.js").AssertionFunctionSync<readonly [z.ZodNonOptional<z.ZodUnknown>, "to have enumerable property", z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>], (
|
|
215
|
-
actual: boolean;
|
|
216
|
-
expected: boolean;
|
|
217
|
-
message: string;
|
|
218
|
-
} | undefined, readonly [z.ZodNonOptional<z.ZodUnknown>, import("./types.js").PhraseLiteralSlot<"to have enumerable property">, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.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>], readonly [import("./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<{
|
|
234
|
+
} | undefined, readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, import("./types.js").PhraseLiteralSlot<"to be an enumerable property of">, z.ZodNonOptional<z.ZodUnknown>]>, import("./types.js").AssertionFunctionSync<readonly [z.ZodNonOptional<z.ZodUnknown>, "to have enumerable property", z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>], (_subject: unknown, key: string | number | symbol) => z.ZodCustom<unknown, unknown>, readonly [z.ZodNonOptional<z.ZodUnknown>, import("./types.js").PhraseLiteralSlot<"to have enumerable property">, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.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>], readonly [import("./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<{
|
|
219
235
|
actual: string;
|
|
220
236
|
expected: string;
|
|
221
237
|
message: string;
|
|
@@ -231,21 +247,73 @@ use: import("./types.js").UseFn<readonly [import("./types.js").AssertionFunction
|
|
|
231
247
|
actual: string;
|
|
232
248
|
expected: string;
|
|
233
249
|
message: string;
|
|
234
|
-
} | undefined>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralSlot<"to reject">]>, import("./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<
|
|
250
|
+
} | undefined>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralSlot<"to reject">]>, import("./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<{
|
|
235
251
|
actual: string;
|
|
236
252
|
expect: string;
|
|
237
253
|
message: string;
|
|
238
|
-
|
|
254
|
+
expected?: never;
|
|
255
|
+
} | {
|
|
256
|
+
actual: string;
|
|
257
|
+
expected: string;
|
|
258
|
+
message: string;
|
|
259
|
+
expect?: never;
|
|
260
|
+
} | undefined>, readonly [z.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"]>, z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>]>, import("./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<{
|
|
239
261
|
actual: string;
|
|
240
262
|
expect: string;
|
|
241
263
|
message: string;
|
|
242
|
-
|
|
243
|
-
|
|
264
|
+
expected?: never;
|
|
265
|
+
} | {
|
|
266
|
+
actual: string;
|
|
267
|
+
expected: string;
|
|
268
|
+
message: string;
|
|
269
|
+
expect?: never;
|
|
270
|
+
} | undefined>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, z.ZodCustom<import("./types.js").Constructor, import("./types.js").Constructor>]>, import("./types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with error satisfying"], z.ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<{
|
|
271
|
+
actual: string;
|
|
272
|
+
expect: string;
|
|
273
|
+
message: string;
|
|
274
|
+
schema?: never;
|
|
275
|
+
subject?: never;
|
|
276
|
+
} | {
|
|
277
|
+
schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
278
|
+
subject: {} | null;
|
|
279
|
+
actual?: never;
|
|
280
|
+
expect?: never;
|
|
281
|
+
message?: never;
|
|
282
|
+
}>, readonly [z.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"]>, z.ZodAny]>, import("./types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with error satisfying"], z.ZodAny], (subject: PromiseLike<unknown>, param: any) => Promise<{
|
|
283
|
+
actual: string;
|
|
284
|
+
expect: string;
|
|
285
|
+
message: string;
|
|
286
|
+
schema?: never;
|
|
287
|
+
subject?: never;
|
|
288
|
+
} | {
|
|
289
|
+
schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
290
|
+
subject: {} | null;
|
|
291
|
+
actual?: never;
|
|
292
|
+
expect?: never;
|
|
293
|
+
message?: never;
|
|
294
|
+
}>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to reject with error satisfying"]>, z.ZodAny]>, import("./types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (promise: PromiseLike<unknown>, param: any) => Promise<{
|
|
295
|
+
actual: string;
|
|
244
296
|
expect: string;
|
|
245
297
|
message: string;
|
|
246
|
-
|
|
298
|
+
schema?: never;
|
|
299
|
+
subject?: never;
|
|
300
|
+
} | {
|
|
301
|
+
schema: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
302
|
+
subject: unknown;
|
|
303
|
+
actual?: never;
|
|
304
|
+
expect?: never;
|
|
305
|
+
message?: never;
|
|
306
|
+
}>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("./types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, z.ZodAny]>, import("./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.ZodAny], (subject: (...args: import("./types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<{
|
|
247
307
|
actual: string;
|
|
248
308
|
expect: string;
|
|
249
309
|
message: string;
|
|
250
|
-
|
|
310
|
+
schema?: never;
|
|
311
|
+
subject?: never;
|
|
312
|
+
} | {
|
|
313
|
+
schema: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
314
|
+
subject: unknown;
|
|
315
|
+
actual?: never;
|
|
316
|
+
expect?: never;
|
|
317
|
+
message?: never;
|
|
318
|
+
}>, readonly [z.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"]>, z.ZodAny]>]>;
|
|
251
319
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrD,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;;;;;;GASG;AACH,YAAY,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,CAAC;AAEb;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,MAAM,EACN,iBAAiB,EACjB,sBAAsB,EACtB,MAAM,EACN,WAAW,EACX,QAAQ,EACR,aAAa,EACb,MAAM,EACN,OAAO,EACP,KAAK,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAC5D,QAAA;AACE;;;;;;;;;GASG;AACH,eAAe;AACf;;;;;;;;;GASG;AACH,oBAAoB;AACpB;;;;;;GAMG;AACH,IAAI;AACJ;;;;;;GAMG;AACH,GAAG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrD,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC;;;;;;;;;GASG;AACH,YAAY,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,CAAC;AAEb;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,MAAM,EACN,iBAAiB,EACjB,sBAAsB,EACtB,MAAM,EACN,WAAW,EACX,QAAQ,EACR,aAAa,EACb,MAAM,EACN,OAAO,EACP,KAAK,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAC5D,QAAA;AACE;;;;;;;;;GASG;AACH,eAAe;AACf;;;;;;;;;GASG;AACH,oBAAoB;AACpB;;;;;;GAMG;AACH,IAAI;AACJ;;;;;;GAMG;AACH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0TAEgB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal schemas
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import type { AssertionMetadata, AssertionParseRequest } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Schema for internal assertion metadata.
|
|
10
|
+
*
|
|
11
|
+
* Used by documentation tooling.
|
|
12
|
+
*/
|
|
13
|
+
export declare const AssertionMetadataSchema: z.ZodType<AssertionMetadata>;
|
|
14
|
+
/**
|
|
15
|
+
* @function
|
|
16
|
+
*/
|
|
17
|
+
export declare const isAssertionParseRequest: (value: unknown) => value is AssertionParseRequest;
|
|
18
|
+
/**
|
|
19
|
+
* @function
|
|
20
|
+
* @param value
|
|
21
|
+
* @returns
|
|
22
|
+
* @knipignore
|
|
23
|
+
*/
|
|
24
|
+
export declare const isMetadata: (value: unknown) => value is AssertionMetadata;
|
|
25
|
+
//# sourceMappingURL=internal-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-schema.d.ts","sourceRoot":"","sources":["../../src/internal-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAEV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAIpB;;;;GAIG;AAEH,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CA2B9D,CAAC;AA6JJ;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,OAAO,KACb,KAAK,IAAI,qBAEX,CAAC;AAwBF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,iBACH,CAAC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal schemas
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod/v4';
|
|
8
|
+
import { isZodType } from './guards.js';
|
|
9
|
+
/**
|
|
10
|
+
* Schema for internal assertion metadata.
|
|
11
|
+
*
|
|
12
|
+
* Used by documentation tooling.
|
|
13
|
+
*/
|
|
14
|
+
export const AssertionMetadataSchema = z
|
|
15
|
+
.looseObject({
|
|
16
|
+
anchor: z.string().describe('Anchor ID for linking to this assertion.'),
|
|
17
|
+
category: z
|
|
18
|
+
.enum([
|
|
19
|
+
'collections',
|
|
20
|
+
'date',
|
|
21
|
+
'equality',
|
|
22
|
+
'error',
|
|
23
|
+
'function',
|
|
24
|
+
'numeric',
|
|
25
|
+
'object',
|
|
26
|
+
'other',
|
|
27
|
+
'primitives',
|
|
28
|
+
'promise',
|
|
29
|
+
'strings',
|
|
30
|
+
])
|
|
31
|
+
.describe('Category to map to page of logically grouped assertions'),
|
|
32
|
+
redirect: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe('Redirect for assertion to its documentation page, including anchor'),
|
|
36
|
+
})
|
|
37
|
+
.describe('Metadata associated with an assertion, for internal use by documentation tooling.');
|
|
38
|
+
/**
|
|
39
|
+
* Schema for {@link AssertionFailure}.
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
const AssertionFailureSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
actual: z
|
|
46
|
+
.unknown()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('The actual value or description of what actually occurred'),
|
|
49
|
+
expected: z
|
|
50
|
+
.unknown()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('The expected value or description of what was expected to occur'),
|
|
53
|
+
message: z
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('A human-readable message describing the failure'),
|
|
57
|
+
})
|
|
58
|
+
.describe('Potential return type of an assertion implementation function');
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
const ZodTypeSchema = z
|
|
63
|
+
.custom(isZodType, {
|
|
64
|
+
error: 'Must be a Zod schema',
|
|
65
|
+
})
|
|
66
|
+
.describe('A Zod schema within AssertionParts');
|
|
67
|
+
/** @internal */
|
|
68
|
+
const BaseAssertionParseRequestSchema = z.object({
|
|
69
|
+
subject: z.unknown().describe('The subject value to be validated'),
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
const AssertionParseRequestSchema = z.union([
|
|
75
|
+
z.object({
|
|
76
|
+
...BaseAssertionParseRequestSchema.shape,
|
|
77
|
+
schema: ZodTypeSchema.describe('The sync Zod schema to validate against'),
|
|
78
|
+
}),
|
|
79
|
+
z.object({
|
|
80
|
+
...BaseAssertionParseRequestSchema.shape,
|
|
81
|
+
asyncSchema: ZodTypeSchema.describe('The async Zod schema to validate against'),
|
|
82
|
+
}),
|
|
83
|
+
]);
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
const PhraseLiteralSchema = z
|
|
88
|
+
.stringFormat('PhraseLiteral', (value) => !value.startsWith('not '), {
|
|
89
|
+
error: 'Phrase literals may not begin with "not "',
|
|
90
|
+
})
|
|
91
|
+
.min(1, { error: 'Phrase literals must be at least 1 character long' })
|
|
92
|
+
.describe('A phrase literal within AssertionParts');
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
const PhraseLiteralChoiceSchema = z
|
|
97
|
+
.array(PhraseLiteralSchema)
|
|
98
|
+
.min(1, { error: 'Phrase literal choices must have at least one option' })
|
|
99
|
+
.describe('A choice of phrase literals, represented as an array of strings, within AssertionParts');
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
const AssertionImplSchemaSync = z
|
|
104
|
+
.union([
|
|
105
|
+
ZodTypeSchema,
|
|
106
|
+
z.function({
|
|
107
|
+
input: z.tuple([z.unknown()], z.unknown()),
|
|
108
|
+
output: z.union([
|
|
109
|
+
z.void(),
|
|
110
|
+
z.boolean(),
|
|
111
|
+
ZodTypeSchema,
|
|
112
|
+
AssertionFailureSchema,
|
|
113
|
+
AssertionParseRequestSchema,
|
|
114
|
+
]),
|
|
115
|
+
}),
|
|
116
|
+
])
|
|
117
|
+
.describe('A synchronous assertion implementation function');
|
|
118
|
+
const AssertionImplSchemaAsync = z
|
|
119
|
+
.union([
|
|
120
|
+
ZodTypeSchema,
|
|
121
|
+
z.function({
|
|
122
|
+
input: z.tuple([z.unknown()], z.unknown()),
|
|
123
|
+
output: z.union([
|
|
124
|
+
z.void(),
|
|
125
|
+
z.boolean(),
|
|
126
|
+
ZodTypeSchema,
|
|
127
|
+
AssertionFailureSchema,
|
|
128
|
+
AssertionParseRequestSchema,
|
|
129
|
+
z.promise(z.void()),
|
|
130
|
+
z.promise(z.boolean()),
|
|
131
|
+
z.promise(ZodTypeSchema),
|
|
132
|
+
z.promise(AssertionFailureSchema),
|
|
133
|
+
z.promise(AssertionParseRequestSchema),
|
|
134
|
+
]),
|
|
135
|
+
}),
|
|
136
|
+
])
|
|
137
|
+
.describe('An async assertion implementation function');
|
|
138
|
+
/**
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
141
|
+
const AssertionPartsSchema = z
|
|
142
|
+
.array(z.union([PhraseLiteralSchema, PhraseLiteralChoiceSchema, ZodTypeSchema]))
|
|
143
|
+
.min(1, { error: 'At least one part is required for an assertion' })
|
|
144
|
+
.refine((parts) => {
|
|
145
|
+
// Special validation for 'and': it can only appear if followed by a ZodType
|
|
146
|
+
for (let i = 0; i < parts.length; i++) {
|
|
147
|
+
if (parts[i] === 'and') {
|
|
148
|
+
// 'and' must be followed by another part, and that part must be a ZodType
|
|
149
|
+
if (i === parts.length - 1 || !isZodType(parts[i + 1])) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}, { error: '"and" can only appear when followed by a Zod schema' })
|
|
156
|
+
.describe('Assertion "parts" which define the input of an assertion');
|
|
157
|
+
/**
|
|
158
|
+
* Type guard for a {@link AssertionFailure}.
|
|
159
|
+
*
|
|
160
|
+
* This cannot live in `guards.ts` because it would create a cycle.
|
|
161
|
+
*
|
|
162
|
+
* @function
|
|
163
|
+
* @param value Value to check
|
|
164
|
+
* @returns `true` if value is an AssertionFailure
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
export const isAssertionFailure = (value) => {
|
|
168
|
+
return AssertionFailureSchema.safeParse(value).success;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* @function
|
|
172
|
+
*/
|
|
173
|
+
export const isAssertionParseRequest = (value) => {
|
|
174
|
+
return AssertionParseRequestSchema.safeParse(value).success;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* @internal
|
|
178
|
+
*/
|
|
179
|
+
export const CreateAssertionInputSchema = z
|
|
180
|
+
.tuple([
|
|
181
|
+
AssertionPartsSchema,
|
|
182
|
+
AssertionImplSchemaSync,
|
|
183
|
+
z.optional(AssertionMetadataSchema),
|
|
184
|
+
])
|
|
185
|
+
.describe('Parameters for createAssertion()');
|
|
186
|
+
/**
|
|
187
|
+
* @internal
|
|
188
|
+
*/
|
|
189
|
+
export const CreateAssertionInputSchemaAsync = z
|
|
190
|
+
.tuple([
|
|
191
|
+
AssertionPartsSchema,
|
|
192
|
+
AssertionImplSchemaAsync,
|
|
193
|
+
z.optional(AssertionMetadataSchema),
|
|
194
|
+
])
|
|
195
|
+
.describe('Parameters for createAsyncAssertion()');
|
|
196
|
+
/**
|
|
197
|
+
* @function
|
|
198
|
+
* @param value
|
|
199
|
+
* @returns
|
|
200
|
+
* @knipignore
|
|
201
|
+
*/
|
|
202
|
+
export const isMetadata = (value) => AssertionMetadataSchema.safeParse(value).success;
|
|
203
|
+
//# sourceMappingURL=internal-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-schema.js","sourceRoot":"","sources":["../../src/internal-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAQ3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;GAIG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAiC,CAAC;KACnE,WAAW,CAA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