bupkis 0.1.2 → 0.3.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.
Files changed (198) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +16 -16
  3. package/dist/commonjs/assertion/assertion-async.d.ts +2 -1
  4. package/dist/commonjs/assertion/assertion-async.d.ts.map +1 -1
  5. package/dist/commonjs/assertion/assertion-async.js +84 -2
  6. package/dist/commonjs/assertion/assertion-async.js.map +1 -1
  7. package/dist/commonjs/assertion/assertion-sync.d.ts +1 -1
  8. package/dist/commonjs/assertion/assertion-sync.d.ts.map +1 -1
  9. package/dist/commonjs/assertion/assertion-sync.js +5 -1
  10. package/dist/commonjs/assertion/assertion-sync.js.map +1 -1
  11. package/dist/commonjs/assertion/assertion-types.d.ts +39 -84
  12. package/dist/commonjs/assertion/assertion-types.d.ts.map +1 -1
  13. package/dist/commonjs/assertion/assertion.d.ts +1 -1
  14. package/dist/commonjs/assertion/assertion.d.ts.map +1 -1
  15. package/dist/commonjs/assertion/assertion.js +1 -14
  16. package/dist/commonjs/assertion/assertion.js.map +1 -1
  17. package/dist/commonjs/assertion/create.d.ts +5 -33
  18. package/dist/commonjs/assertion/create.d.ts.map +1 -1
  19. package/dist/commonjs/assertion/create.js +17 -6
  20. package/dist/commonjs/assertion/create.js.map +1 -1
  21. package/dist/commonjs/assertion/impl/async.d.ts +122 -21
  22. package/dist/commonjs/assertion/impl/async.d.ts.map +1 -1
  23. package/dist/commonjs/assertion/impl/async.js +114 -90
  24. package/dist/commonjs/assertion/impl/async.js.map +1 -1
  25. package/dist/commonjs/assertion/impl/callback.d.ts +104 -0
  26. package/dist/commonjs/assertion/impl/callback.d.ts.map +1 -0
  27. package/dist/commonjs/assertion/impl/callback.js +694 -0
  28. package/dist/commonjs/assertion/impl/callback.js.map +1 -0
  29. package/dist/commonjs/assertion/impl/index.d.ts +1 -1
  30. package/dist/commonjs/assertion/impl/index.d.ts.map +1 -1
  31. package/dist/commonjs/assertion/impl/index.js.map +1 -1
  32. package/dist/commonjs/assertion/impl/sync-esoteric.js +1 -1
  33. package/dist/commonjs/assertion/impl/sync-esoteric.js.map +1 -1
  34. package/dist/commonjs/assertion/impl/sync-parametric.d.ts +37 -34
  35. package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
  36. package/dist/commonjs/assertion/impl/sync-parametric.js +32 -47
  37. package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
  38. package/dist/commonjs/assertion/impl/sync.d.ts +105 -58
  39. package/dist/commonjs/assertion/impl/sync.d.ts.map +1 -1
  40. package/dist/commonjs/assertion/impl/sync.js +4 -1
  41. package/dist/commonjs/assertion/impl/sync.js.map +1 -1
  42. package/dist/commonjs/bootstrap.d.ts +199 -85
  43. package/dist/commonjs/bootstrap.d.ts.map +1 -1
  44. package/dist/commonjs/bootstrap.js +19 -10
  45. package/dist/commonjs/bootstrap.js.map +1 -1
  46. package/dist/commonjs/constant.js +7 -1
  47. package/dist/commonjs/constant.js.map +1 -1
  48. package/dist/commonjs/error.d.ts +32 -5
  49. package/dist/commonjs/error.d.ts.map +1 -1
  50. package/dist/commonjs/error.js +60 -5
  51. package/dist/commonjs/error.js.map +1 -1
  52. package/dist/commonjs/expect.d.ts +130 -3
  53. package/dist/commonjs/expect.d.ts.map +1 -1
  54. package/dist/commonjs/expect.js +116 -1
  55. package/dist/commonjs/expect.js.map +1 -1
  56. package/dist/commonjs/guards.d.ts +45 -20
  57. package/dist/commonjs/guards.d.ts.map +1 -1
  58. package/dist/commonjs/guards.js +56 -40
  59. package/dist/commonjs/guards.js.map +1 -1
  60. package/dist/commonjs/index.d.ts +241 -86
  61. package/dist/commonjs/index.d.ts.map +1 -1
  62. package/dist/commonjs/index.js +44 -42
  63. package/dist/commonjs/index.js.map +1 -1
  64. package/dist/commonjs/metadata.d.ts +1 -27
  65. package/dist/commonjs/metadata.d.ts.map +1 -1
  66. package/dist/commonjs/metadata.js +16 -15
  67. package/dist/commonjs/metadata.js.map +1 -1
  68. package/dist/commonjs/schema.d.ts +76 -33
  69. package/dist/commonjs/schema.d.ts.map +1 -1
  70. package/dist/commonjs/schema.js +77 -34
  71. package/dist/commonjs/schema.js.map +1 -1
  72. package/dist/commonjs/types.d.ts +480 -39
  73. package/dist/commonjs/types.d.ts.map +1 -1
  74. package/dist/commonjs/types.js +12 -2
  75. package/dist/commonjs/types.js.map +1 -1
  76. package/dist/commonjs/util.d.ts +72 -49
  77. package/dist/commonjs/util.d.ts.map +1 -1
  78. package/dist/commonjs/util.js +175 -155
  79. package/dist/commonjs/util.js.map +1 -1
  80. package/dist/commonjs/value-to-schema.d.ts +122 -0
  81. package/dist/commonjs/value-to-schema.d.ts.map +1 -0
  82. package/dist/commonjs/value-to-schema.js +309 -0
  83. package/dist/commonjs/value-to-schema.js.map +1 -0
  84. package/dist/esm/assertion/assertion-async.d.ts +2 -1
  85. package/dist/esm/assertion/assertion-async.d.ts.map +1 -1
  86. package/dist/esm/assertion/assertion-async.js +85 -3
  87. package/dist/esm/assertion/assertion-async.js.map +1 -1
  88. package/dist/esm/assertion/assertion-sync.d.ts +1 -1
  89. package/dist/esm/assertion/assertion-sync.d.ts.map +1 -1
  90. package/dist/esm/assertion/assertion-sync.js +6 -2
  91. package/dist/esm/assertion/assertion-sync.js.map +1 -1
  92. package/dist/esm/assertion/assertion-types.d.ts +39 -84
  93. package/dist/esm/assertion/assertion-types.d.ts.map +1 -1
  94. package/dist/esm/assertion/assertion.d.ts +1 -1
  95. package/dist/esm/assertion/assertion.d.ts.map +1 -1
  96. package/dist/esm/assertion/assertion.js +1 -14
  97. package/dist/esm/assertion/assertion.js.map +1 -1
  98. package/dist/esm/assertion/create.d.ts +5 -33
  99. package/dist/esm/assertion/create.d.ts.map +1 -1
  100. package/dist/esm/assertion/create.js +14 -4
  101. package/dist/esm/assertion/create.js.map +1 -1
  102. package/dist/esm/assertion/impl/async.d.ts +122 -21
  103. package/dist/esm/assertion/impl/async.d.ts.map +1 -1
  104. package/dist/esm/assertion/impl/async.js +113 -89
  105. package/dist/esm/assertion/impl/async.js.map +1 -1
  106. package/dist/esm/assertion/impl/callback.d.ts +104 -0
  107. package/dist/esm/assertion/impl/callback.d.ts.map +1 -0
  108. package/dist/esm/assertion/impl/callback.js +691 -0
  109. package/dist/esm/assertion/impl/callback.js.map +1 -0
  110. package/dist/esm/assertion/impl/index.d.ts +1 -1
  111. package/dist/esm/assertion/impl/index.d.ts.map +1 -1
  112. package/dist/esm/assertion/impl/index.js +1 -1
  113. package/dist/esm/assertion/impl/index.js.map +1 -1
  114. package/dist/esm/assertion/impl/sync-esoteric.js +2 -2
  115. package/dist/esm/assertion/impl/sync-esoteric.js.map +1 -1
  116. package/dist/esm/assertion/impl/sync-parametric.d.ts +37 -34
  117. package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
  118. package/dist/esm/assertion/impl/sync-parametric.js +32 -47
  119. package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
  120. package/dist/esm/assertion/impl/sync.d.ts +105 -58
  121. package/dist/esm/assertion/impl/sync.d.ts.map +1 -1
  122. package/dist/esm/assertion/impl/sync.js +3 -1
  123. package/dist/esm/assertion/impl/sync.js.map +1 -1
  124. package/dist/esm/bootstrap.d.ts +199 -85
  125. package/dist/esm/bootstrap.d.ts.map +1 -1
  126. package/dist/esm/bootstrap.js +19 -10
  127. package/dist/esm/bootstrap.js.map +1 -1
  128. package/dist/esm/constant.js +6 -0
  129. package/dist/esm/constant.js.map +1 -1
  130. package/dist/esm/error.d.ts +32 -5
  131. package/dist/esm/error.d.ts.map +1 -1
  132. package/dist/esm/error.js +59 -5
  133. package/dist/esm/error.js.map +1 -1
  134. package/dist/esm/expect.d.ts +130 -3
  135. package/dist/esm/expect.d.ts.map +1 -1
  136. package/dist/esm/expect.js +117 -2
  137. package/dist/esm/expect.js.map +1 -1
  138. package/dist/esm/guards.d.ts +45 -20
  139. package/dist/esm/guards.d.ts.map +1 -1
  140. package/dist/esm/guards.js +48 -31
  141. package/dist/esm/guards.js.map +1 -1
  142. package/dist/esm/index.d.ts +241 -86
  143. package/dist/esm/index.d.ts.map +1 -1
  144. package/dist/esm/index.js +46 -7
  145. package/dist/esm/index.js.map +1 -1
  146. package/dist/esm/metadata.d.ts +1 -27
  147. package/dist/esm/metadata.d.ts.map +1 -1
  148. package/dist/esm/metadata.js +2 -1
  149. package/dist/esm/metadata.js.map +1 -1
  150. package/dist/esm/schema.d.ts +76 -33
  151. package/dist/esm/schema.d.ts.map +1 -1
  152. package/dist/esm/schema.js +77 -34
  153. package/dist/esm/schema.js.map +1 -1
  154. package/dist/esm/types.d.ts +480 -39
  155. package/dist/esm/types.d.ts.map +1 -1
  156. package/dist/esm/types.js +12 -2
  157. package/dist/esm/types.js.map +1 -1
  158. package/dist/esm/util.d.ts +72 -49
  159. package/dist/esm/util.d.ts.map +1 -1
  160. package/dist/esm/util.js +159 -153
  161. package/dist/esm/util.js.map +1 -1
  162. package/dist/esm/value-to-schema.d.ts +122 -0
  163. package/dist/esm/value-to-schema.d.ts.map +1 -0
  164. package/dist/esm/value-to-schema.js +305 -0
  165. package/dist/esm/value-to-schema.js.map +1 -0
  166. package/package.json +94 -17
  167. package/src/assertion/assertion-async.ts +113 -3
  168. package/src/assertion/assertion-sync.ts +5 -2
  169. package/src/assertion/assertion-types.ts +52 -45
  170. package/src/assertion/assertion.ts +2 -17
  171. package/src/assertion/create.ts +16 -65
  172. package/src/assertion/impl/async.ts +132 -92
  173. package/src/assertion/impl/callback.ts +882 -0
  174. package/src/assertion/impl/index.ts +1 -1
  175. package/src/assertion/impl/sync-esoteric.ts +2 -2
  176. package/src/assertion/impl/sync-parametric.ts +41 -49
  177. package/src/assertion/impl/sync.ts +3 -0
  178. package/src/bootstrap.ts +21 -11
  179. package/src/constant.ts +8 -0
  180. package/src/error.ts +75 -4
  181. package/src/expect.ts +275 -20
  182. package/src/guards.ts +74 -69
  183. package/src/index.ts +72 -11
  184. package/src/metadata.ts +3 -4
  185. package/src/schema.ts +80 -36
  186. package/src/types.ts +625 -72
  187. package/src/util.ts +174 -222
  188. package/src/value-to-schema.ts +464 -0
  189. package/dist/commonjs/api.d.ts +0 -93
  190. package/dist/commonjs/api.d.ts.map +0 -1
  191. package/dist/commonjs/api.js +0 -8
  192. package/dist/commonjs/api.js.map +0 -1
  193. package/dist/esm/api.d.ts +0 -93
  194. package/dist/esm/api.d.ts.map +0 -1
  195. package/dist/esm/api.js +0 -7
  196. package/dist/esm/api.js.map +0 -1
  197. package/src/api.ts +0 -149
  198. package/src/schema.md +0 -15
@@ -1,19 +1,39 @@
1
1
  "use strict";
2
2
  /**
3
- * Zod schema definitions for common types and validation patterns.
3
+ * Arguably-useful Zod schemas for common types and validation patterns.
4
4
  *
5
5
  * This module provides reusable Zod schemas for validating constructors,
6
6
  * functions, property keys, promises, and other common JavaScript types used
7
- * throughout the assertion system. These tend to work around Zod's
8
- * limitations.
7
+ * throughout the assertion system. These tend to work around the impedance
8
+ * mismatch between **BUPKIS** and Zod.
9
9
  *
10
10
  * These are used internally, but consumers may also find them useful.
11
11
  *
12
- * @document schema.md
12
+ * For example, we have {@link FunctionSchema} which accepts any
13
+ * function—regardless of its signature. We need this because Zod v4's
14
+ * `z.function()` no longer returns a `ZodType` (ref:
15
+ * {@link https://zod.dev/v4/changelog | Zod v4 Migration Guide}) and so behaves
16
+ * differently. `FunctionSchema` allows us to work with functions as _values_
17
+ * instead of something to be implemented.
18
+ *
19
+ * Similarly—but not a new development—`z.promise()` does not parse a
20
+ * {@link Promise} object; it parses the _fulfilled value_. This is not what we
21
+ * want for "is a Promise" assertions, but it _can_ be useful for making sense
22
+ * of the fulfilled value. To solve this, we have
23
+ * {@link WrappedPromiseLikeSchema} (which explicitly supports
24
+ * {@link PromiseLike}/"thenable" objects).
25
+ *
26
+ * @category API
27
+ * @example
28
+ *
29
+ * ```ts
30
+ * import * as schema from 'bupkis/schema';
31
+ * ```
32
+ *
13
33
  * @packageDocumentation
14
34
  */
15
35
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.RegExpSchema = exports.ArrayLikeSchema = exports.PrimitiveSchema = exports.FalsySchema = exports.TruthySchema = exports.AsyncFunctionSchema = exports.NullProtoObjectSchema = exports.StrongSetSchema = exports.StrongMapSchema = exports.WrappedPromiseLikeSchema = exports.PropertyKeySchema = exports.FunctionSchema = exports.ClassSchema = void 0;
36
+ exports.RegExpSchema = exports.ArrayLikeSchema = exports.PrimitiveSchema = exports.FalsySchema = exports.TruthySchema = exports.AsyncFunctionSchema = exports.NullProtoObjectSchema = exports.DictionarySchema = exports.StrongSetSchema = exports.StrongMapSchema = exports.WrappedPromiseLikeSchema = exports.PropertyKeySchema = exports.FunctionSchema = exports.ClassSchema = void 0;
17
37
  const v4_1 = require("zod/v4");
18
38
  const guards_js_1 = require("./guards.js");
19
39
  const metadata_js_1 = require("./metadata.js");
@@ -22,13 +42,12 @@ const metadata_js_1 = require("./metadata.js");
22
42
  *
23
43
  * This schema validates values that can be used as constructors, including ES6
24
44
  * classes, traditional constructor functions, and built-in constructors. It
25
- * uses the {@link isConstructable} guard function to determine if a value can be
45
+ * uses the {@link isConstructible} guard function to determine if a value can be
26
46
  * invoked with the `new` operator to create object instances.
27
47
  *
28
- * @remarks
48
+ * @privateRemarks
29
49
  * The schema is registered in the {@link BupkisRegistry} with the name
30
50
  * `ClassSchema` for later reference and type checking purposes.
31
- * @category Schema
32
51
  * @example
33
52
  *
34
53
  * ```typescript
@@ -42,9 +61,11 @@ const metadata_js_1 = require("./metadata.js");
42
61
  * ClassSchema.parse(() => {}); // ✗ Throws validation error
43
62
  * ClassSchema.parse({}); // ✗ Throws validation error
44
63
  * ```
64
+ *
65
+ * @group Schema
45
66
  */
46
67
  exports.ClassSchema = v4_1.z
47
- .custom(guards_js_1.isConstructable)
68
+ .custom(guards_js_1.isConstructible)
48
69
  .register(metadata_js_1.BupkisRegistry, { name: 'ClassSchema' })
49
70
  .describe('Class / Constructor');
50
71
  /**
@@ -56,10 +77,9 @@ exports.ClassSchema = v4_1.z
56
77
  * including regular functions, arrow functions, async functions, generator
57
78
  * functions, and methods.
58
79
  *
59
- * @remarks
80
+ * @privateRemarks
60
81
  * The schema is registered in the {@link BupkisRegistry} with the name
61
82
  * `FunctionSchema` for later reference and type checking purposes.
62
- * @category Schema
63
83
  * @example
64
84
  *
65
85
  * ```typescript
@@ -71,6 +91,8 @@ exports.ClassSchema = v4_1.z
71
91
  * FunctionSchema.parse('not a function'); // ✗ Throws validation error
72
92
  * FunctionSchema.parse({}); // ✗ Throws validation error
73
93
  * ```
94
+ *
95
+ * @group Schema
74
96
  */
75
97
  exports.FunctionSchema = v4_1.z
76
98
  .custom(guards_js_1.isFunction)
@@ -86,10 +108,9 @@ exports.FunctionSchema = v4_1.z
86
108
  * types that JavaScript automatically converts to property keys when used in
87
109
  * object access or assignment operations.
88
110
  *
89
- * @remarks
111
+ * @privateRemarks
90
112
  * The schema is registered in the `BupkisRegistry` with the name
91
113
  * `PropertyKeySchema` for later reference and type checking purposes.
92
- * @category Schema
93
114
  * @example
94
115
  *
95
116
  * ```typescript
@@ -99,6 +120,8 @@ exports.FunctionSchema = v4_1.z
99
120
  * PropertyKeySchema.parse({}); // ✗ Throws validation error
100
121
  * PropertyKeySchema.parse(null); // ✗ Throws validation error
101
122
  * ```
123
+ *
124
+ * @group Schema
102
125
  */
103
126
  exports.PropertyKeySchema = v4_1.z
104
127
  .union([v4_1.z.string(), v4_1.z.number(), v4_1.z.symbol()])
@@ -113,12 +136,11 @@ exports.PropertyKeySchema = v4_1.z
113
136
  * resolved value, meaning the result of parsing remains a Promise or thenable
114
137
  * object.
115
138
  *
116
- * @remarks
139
+ * @privateRemarks
117
140
  * The schema is registered in the `BupkisRegistry` with the name
118
141
  * `WrappedPromiseLikeSchema` for later reference and type checking purposes.
119
142
  * This is useful when you need to validate that something is thenable without
120
143
  * automatically resolving it.
121
- * @category Schema
122
144
  * @example
123
145
  *
124
146
  * ```typescript
@@ -127,6 +149,8 @@ exports.PropertyKeySchema = v4_1.z
127
149
  * WrappedPromiseLikeSchema.parse(42); // ✗ Throws validation error
128
150
  * WrappedPromiseLikeSchema.parse({}); // ✗ Throws validation error
129
151
  * ```
152
+ *
153
+ * @group Schema
130
154
  */
131
155
  exports.WrappedPromiseLikeSchema = v4_1.z
132
156
  .custom((value) => (0, guards_js_1.isPromiseLike)(value))
@@ -143,7 +167,6 @@ exports.WrappedPromiseLikeSchema = v4_1.z
143
167
  * @remarks
144
168
  * The schema is registered in the `BupkisRegistry` with the name
145
169
  * `StrongMapSchema` for later reference and type checking purposes.
146
- * @category Schema
147
170
  * @example
148
171
  *
149
172
  * ```typescript
@@ -156,6 +179,8 @@ exports.WrappedPromiseLikeSchema = v4_1.z
156
179
  * const weakMap = new WeakMap();
157
180
  * StrongMapSchema.parse(weakMap); // ✗ Throws validation error
158
181
  * ```
182
+ *
183
+ * @group Schema
159
184
  */
160
185
  exports.StrongMapSchema = v4_1.z
161
186
  .instanceof(Map)
@@ -173,7 +198,6 @@ exports.StrongMapSchema = v4_1.z
173
198
  * @remarks
174
199
  * The schema is registered in the `BupkisRegistry` with the name
175
200
  * `StrongSetSchema` for later reference and type checking purposes.
176
- * @category Schema
177
201
  * @example
178
202
  *
179
203
  * ```typescript
@@ -183,6 +207,8 @@ exports.StrongMapSchema = v4_1.z
183
207
  * const weakSet = new WeakSet();
184
208
  * StrongSetSchema.parse(weakSet); // ✗ Throws validation error
185
209
  * ```
210
+ *
211
+ * @group Schema
186
212
  */
187
213
  exports.StrongSetSchema = v4_1.z
188
214
  .instanceof(Set)
@@ -198,10 +224,12 @@ exports.StrongSetSchema = v4_1.z
198
224
  * `Object.prototype`, making them useful as pure data containers or
199
225
  * dictionaries.
200
226
  *
201
- * @remarks
227
+ * @privateRemarks
202
228
  * The schema is registered in the `BupkisRegistry` with the name
203
229
  * `ObjectWithNullPrototype` for later reference and type checking purposes.
204
- * @category Schema
230
+ *
231
+ * Changing this to be a `ZodRecord` would be nice, but that would end up
232
+ * blasting away the original object's prototype.
205
233
  * @example
206
234
  *
207
235
  * ```typescript
@@ -215,11 +243,20 @@ exports.StrongSetSchema = v4_1.z
215
243
  * const emptyObj = {};
216
244
  * NullProtoObjectSchema.parse(emptyObj); // ✗ Throws validation error
217
245
  * ```
246
+ *
247
+ * @group Schema
248
+ * @see Aliases: {@link NullProtoObjectSchema}, {@link DictionarySchema}
218
249
  */
219
- exports.NullProtoObjectSchema = v4_1.z
250
+ exports.DictionarySchema = v4_1.z
220
251
  .custom((value) => (0, guards_js_1.isNonNullObject)(value) && Object.getPrototypeOf(value) === null)
221
252
  .describe('Object with null prototype')
222
253
  .register(metadata_js_1.BupkisRegistry, { name: 'ObjectWithNullPrototype' });
254
+ /**
255
+ * {@inheritDoc DictionarySchema}
256
+ *
257
+ * @group Schema
258
+ */
259
+ exports.NullProtoObjectSchema = exports.DictionarySchema;
223
260
  /**
224
261
  * A Zod schema that validates functions declared with the `async` keyword.
225
262
  *
@@ -228,13 +265,12 @@ exports.NullProtoObjectSchema = v4_1.z
228
265
  * function's internal `[[ToString]]` representation to distinguish async
229
266
  * functions from regular functions that might return Promises.
230
267
  *
231
- * @remarks
268
+ * @privateRemarks
232
269
  * The schema is registered in the `BupkisRegistry` with the name
233
270
  * `AsyncFunctionSchema` for later reference and type checking purposes. This
234
271
  * schema cannot reliably detect functions that return Promises but are not
235
272
  * declared with `async`, as this determination requires static analysis that is
236
273
  * not available at runtime.
237
- * @category Schema
238
274
  * @example
239
275
  *
240
276
  * ```typescript
@@ -254,6 +290,8 @@ exports.NullProtoObjectSchema = v4_1.z
254
290
  * const regularFn = () => 42;
255
291
  * AsyncFunctionSchema.parse(regularFn); // ✗ Throws validation error
256
292
  * ```
293
+ *
294
+ * @group Schema
257
295
  */
258
296
  exports.AsyncFunctionSchema = exports.FunctionSchema.refine((value) => Object.prototype.toString.call(value) === '[object AsyncFunction]')
259
297
  .describe('Function declared with the `async` keyword')
@@ -266,10 +304,9 @@ exports.AsyncFunctionSchema = exports.FunctionSchema.refine((value) => Object.pr
266
304
  * if it converts to `true` when evaluated in a boolean context - essentially
267
305
  * any value that is not one of the eight falsy values.
268
306
  *
269
- * @remarks
307
+ * @privateRemarks
270
308
  * The schema is registered in the `BupkisRegistry` with the name `Truthy` and
271
309
  * indicates that it accepts anything as valid input for evaluation.
272
- * @category Schema
273
310
  * @example
274
311
  *
275
312
  * ```typescript
@@ -283,6 +320,8 @@ exports.AsyncFunctionSchema = exports.FunctionSchema.refine((value) => Object.pr
283
320
  * TruthySchema.parse(''); // ✗ Throws validation error
284
321
  * TruthySchema.parse(null); // ✗ Throws validation error
285
322
  * ```
323
+ *
324
+ * @group Schema
286
325
  */
287
326
  exports.TruthySchema = v4_1.z
288
327
  .any()
@@ -300,10 +339,9 @@ exports.TruthySchema = v4_1.z
300
339
  * in JavaScript are: `false`, `0`, `-0`, `0n`, `""` (empty string), `null`,
301
340
  * `undefined`, and `NaN`.
302
341
  *
303
- * @remarks
342
+ * @privateRemarks
304
343
  * The schema is registered in the `BupkisRegistry` with the name `Falsy` and
305
344
  * indicates that it accepts anything as valid input for evaluation.
306
- * @category Schema
307
345
  * @example
308
346
  *
309
347
  * ```typescript
@@ -320,6 +358,8 @@ exports.TruthySchema = v4_1.z
320
358
  * FalsySchema.parse('hello'); // ✗ Throws validation error
321
359
  * FalsySchema.parse({}); // ✗ Throws validation error
322
360
  * ```
361
+ *
362
+ * @group Schema
323
363
  */
324
364
  exports.FalsySchema = v4_1.z
325
365
  .any()
@@ -336,10 +376,9 @@ exports.FalsySchema = v4_1.z
336
376
  * distinguishing them from objects and functions which are non-primitive
337
377
  * reference types.
338
378
  *
339
- * @remarks
379
+ * @privateRemarks
340
380
  * The schema is registered in the `BupkisRegistry` with the name `Primitive`
341
381
  * and indicates that it accepts primitive values as valid input.
342
- * @category Schema
343
382
  * @example
344
383
  *
345
384
  * ```typescript
@@ -354,6 +393,8 @@ exports.FalsySchema = v4_1.z
354
393
  * PrimitiveSchema.parse([]); // ✗ Throws validation error (array)
355
394
  * PrimitiveSchema.parse(() => {}); // ✗ Throws validation error (function)
356
395
  * ```
396
+ *
397
+ * @group Schema
357
398
  */
358
399
  exports.PrimitiveSchema = v4_1.z
359
400
  .union([
@@ -377,12 +418,11 @@ exports.PrimitiveSchema = v4_1.z
377
418
  * it useful for validating collections where the specific array mutability or
378
419
  * tuple structure is not critical.
379
420
  *
380
- * @remarks
421
+ * @privateRemarks
381
422
  * The schema is registered in the {@link BupkisRegistry} with the name
382
423
  * `ArrayLike` for later reference and type checking purposes. This schema is
383
424
  * particularly useful when you need to accept various forms of array-like data
384
425
  * without being restrictive about mutability or exact tuple structure.
385
- * @category Schema
386
426
  * @example
387
427
  *
388
428
  * ```typescript
@@ -394,11 +434,13 @@ exports.PrimitiveSchema = v4_1.z
394
434
  * ArrayLikeSchema.parse({}); // ✗ Throws validation error
395
435
  * ArrayLikeSchema.parse(null); // ✗ Throws validation error
396
436
  * ```
437
+ *
438
+ * @group Schema
397
439
  */
398
440
  exports.ArrayLikeSchema = v4_1.z
399
441
  .union([
400
- v4_1.z.array(v4_1.z.any()),
401
- v4_1.z.tuple([v4_1.z.any()], v4_1.z.any()),
442
+ v4_1.z.array(v4_1.z.unknown()),
443
+ v4_1.z.tuple([v4_1.z.unknown()], v4_1.z.unknown()),
402
444
  v4_1.z.looseObject({ length: v4_1.z.number().nonnegative().int() }),
403
445
  ])
404
446
  .describe('Array-like value')
@@ -414,10 +456,9 @@ exports.ArrayLikeSchema = v4_1.z
414
456
  * It ensures the validated value is a proper regular expression object with all
415
457
  * associated methods and properties.
416
458
  *
417
- * @remarks
459
+ * @privateRemarks
418
460
  * The schema is registered in the `BupkisRegistry` with the name `RegExp` for
419
461
  * later reference and type checking purposes.
420
- * @category Schema
421
462
  * @example
422
463
  *
423
464
  * ```typescript
@@ -429,6 +470,8 @@ exports.ArrayLikeSchema = v4_1.z
429
470
  * RegExpSchema.parse(/abc/.source); // ✗ Throws validation error (string pattern)
430
471
  * RegExpSchema.parse({}); // ✗ Throws validation error (object)
431
472
  * ```
473
+ *
474
+ * @group Schema
432
475
  */
433
476
  exports.RegExpSchema = v4_1.z
434
477
  .instanceof(RegExp)
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,+BAA2B;AAE3B,2CAMqB;AACrB,+CAA+C;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEU,QAAA,WAAW,GAAG,MAAC;KACzB,MAAM,CAAc,2BAAe,CAAC;KACpC,QAAQ,CAAC,4BAAc,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;KACjD,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,cAAc,GAAG,MAAC;KAC5B,MAAM,CAA0B,sBAAU,CAAC;KAC3C,QAAQ,CAAC,4BAAc,EAAE;IACxB,IAAI,EAAE,gBAAgB;CACvB,CAAC;KACD,QAAQ,CACP,oEAAoE,CACrE,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,iBAAiB,GAAG,MAAC;KAC/B,KAAK,CAAC,CAAC,MAAC,CAAC,MAAM,EAAE,EAAE,MAAC,CAAC,MAAM,EAAE,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KAC3C,QAAQ,CAAC,aAAa,CAAC;KACvB,QAAQ,CAAC,4BAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,wBAAwB,GAAG,MAAC;KACtC,MAAM,CAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,yBAAa,EAAC,KAAK,CAAC,CAAC;KAC7D,QAAQ,CACP,qEAAqE,CACtE;KACA,QAAQ,CAAC,4BAAc,EAAE,EAAE,IAAI,EA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