bupkis 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +8 -8
  3. package/dist/commonjs/assertion/assertion-types.d.ts +33 -82
  4. package/dist/commonjs/assertion/assertion-types.d.ts.map +1 -1
  5. package/dist/commonjs/assertion/create.d.ts +5 -33
  6. package/dist/commonjs/assertion/create.d.ts.map +1 -1
  7. package/dist/commonjs/assertion/create.js +17 -6
  8. package/dist/commonjs/assertion/create.js.map +1 -1
  9. package/dist/commonjs/assertion/impl/async.d.ts +5 -5
  10. package/dist/commonjs/assertion/impl/async.d.ts.map +1 -1
  11. package/dist/commonjs/assertion/impl/async.js +2 -2
  12. package/dist/commonjs/assertion/impl/async.js.map +1 -1
  13. package/dist/commonjs/assertion/impl/sync-parametric.d.ts +24 -24
  14. package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
  15. package/dist/commonjs/assertion/impl/sync-parametric.js +3 -3
  16. package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
  17. package/dist/commonjs/assertion/impl/sync.d.ts +50 -50
  18. package/dist/commonjs/assertion/impl/sync.d.ts.map +1 -1
  19. package/dist/commonjs/bootstrap.d.ts +71 -61
  20. package/dist/commonjs/bootstrap.d.ts.map +1 -1
  21. package/dist/commonjs/bootstrap.js +20 -10
  22. package/dist/commonjs/bootstrap.js.map +1 -1
  23. package/dist/commonjs/error.d.ts +12 -5
  24. package/dist/commonjs/error.d.ts.map +1 -1
  25. package/dist/commonjs/error.js +19 -4
  26. package/dist/commonjs/error.js.map +1 -1
  27. package/dist/commonjs/expect.d.ts +130 -3
  28. package/dist/commonjs/expect.d.ts.map +1 -1
  29. package/dist/commonjs/expect.js +115 -0
  30. package/dist/commonjs/expect.js.map +1 -1
  31. package/dist/commonjs/guards.d.ts +22 -15
  32. package/dist/commonjs/guards.d.ts.map +1 -1
  33. package/dist/commonjs/guards.js +34 -20
  34. package/dist/commonjs/guards.js.map +1 -1
  35. package/dist/commonjs/index.d.ts +113 -62
  36. package/dist/commonjs/index.d.ts.map +1 -1
  37. package/dist/commonjs/index.js +44 -42
  38. package/dist/commonjs/index.js.map +1 -1
  39. package/dist/commonjs/metadata.d.ts +1 -27
  40. package/dist/commonjs/metadata.d.ts.map +1 -1
  41. package/dist/commonjs/metadata.js +16 -15
  42. package/dist/commonjs/metadata.js.map +1 -1
  43. package/dist/commonjs/schema.d.ts +59 -26
  44. package/dist/commonjs/schema.d.ts.map +1 -1
  45. package/dist/commonjs/schema.js +57 -24
  46. package/dist/commonjs/schema.js.map +1 -1
  47. package/dist/commonjs/types.d.ts +449 -39
  48. package/dist/commonjs/types.d.ts.map +1 -1
  49. package/dist/commonjs/types.js +12 -2
  50. package/dist/commonjs/types.js.map +1 -1
  51. package/dist/commonjs/util.d.ts +7 -0
  52. package/dist/commonjs/util.d.ts.map +1 -1
  53. package/dist/commonjs/util.js +7 -0
  54. package/dist/commonjs/util.js.map +1 -1
  55. package/dist/esm/assertion/assertion-types.d.ts +33 -82
  56. package/dist/esm/assertion/assertion-types.d.ts.map +1 -1
  57. package/dist/esm/assertion/create.d.ts +5 -33
  58. package/dist/esm/assertion/create.d.ts.map +1 -1
  59. package/dist/esm/assertion/create.js +14 -4
  60. package/dist/esm/assertion/create.js.map +1 -1
  61. package/dist/esm/assertion/impl/async.d.ts +5 -5
  62. package/dist/esm/assertion/impl/async.d.ts.map +1 -1
  63. package/dist/esm/assertion/impl/async.js +2 -2
  64. package/dist/esm/assertion/impl/async.js.map +1 -1
  65. package/dist/esm/assertion/impl/sync-parametric.d.ts +24 -24
  66. package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
  67. package/dist/esm/assertion/impl/sync-parametric.js +3 -3
  68. package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
  69. package/dist/esm/assertion/impl/sync.d.ts +50 -50
  70. package/dist/esm/assertion/impl/sync.d.ts.map +1 -1
  71. package/dist/esm/bootstrap.d.ts +71 -61
  72. package/dist/esm/bootstrap.d.ts.map +1 -1
  73. package/dist/esm/bootstrap.js +19 -9
  74. package/dist/esm/bootstrap.js.map +1 -1
  75. package/dist/esm/error.d.ts +12 -5
  76. package/dist/esm/error.d.ts.map +1 -1
  77. package/dist/esm/error.js +19 -4
  78. package/dist/esm/error.js.map +1 -1
  79. package/dist/esm/expect.d.ts +130 -3
  80. package/dist/esm/expect.d.ts.map +1 -1
  81. package/dist/esm/expect.js +115 -0
  82. package/dist/esm/expect.js.map +1 -1
  83. package/dist/esm/guards.d.ts +22 -15
  84. package/dist/esm/guards.d.ts.map +1 -1
  85. package/dist/esm/guards.js +29 -13
  86. package/dist/esm/guards.js.map +1 -1
  87. package/dist/esm/index.d.ts +113 -62
  88. package/dist/esm/index.d.ts.map +1 -1
  89. package/dist/esm/index.js +46 -7
  90. package/dist/esm/index.js.map +1 -1
  91. package/dist/esm/metadata.d.ts +1 -27
  92. package/dist/esm/metadata.d.ts.map +1 -1
  93. package/dist/esm/metadata.js +2 -1
  94. package/dist/esm/metadata.js.map +1 -1
  95. package/dist/esm/schema.d.ts +59 -26
  96. package/dist/esm/schema.d.ts.map +1 -1
  97. package/dist/esm/schema.js +57 -24
  98. package/dist/esm/schema.js.map +1 -1
  99. package/dist/esm/types.d.ts +449 -39
  100. package/dist/esm/types.d.ts.map +1 -1
  101. package/dist/esm/types.js +12 -2
  102. package/dist/esm/types.js.map +1 -1
  103. package/dist/esm/util.d.ts +7 -0
  104. package/dist/esm/util.d.ts.map +1 -1
  105. package/dist/esm/util.js +7 -0
  106. package/dist/esm/util.js.map +1 -1
  107. package/package.json +89 -15
  108. package/src/assertion/assertion-types.ts +38 -41
  109. package/src/assertion/create.ts +16 -65
  110. package/src/assertion/impl/async.ts +2 -2
  111. package/src/assertion/impl/sync-parametric.ts +3 -3
  112. package/src/bootstrap.ts +21 -10
  113. package/src/error.ts +21 -4
  114. package/src/expect.ts +269 -18
  115. package/src/guards.ts +29 -51
  116. package/src/index.ts +71 -11
  117. package/src/metadata.ts +3 -4
  118. package/src/schema.ts +59 -26
  119. package/src/types.ts +593 -72
  120. package/src/util.ts +7 -0
  121. package/dist/commonjs/api.d.ts +0 -93
  122. package/dist/commonjs/api.d.ts.map +0 -1
  123. package/dist/commonjs/api.js +0 -8
  124. package/dist/commonjs/api.js.map +0 -1
  125. package/dist/esm/api.d.ts +0 -93
  126. package/dist/esm/api.d.ts.map +0 -1
  127. package/dist/esm/api.js +0 -7
  128. package/dist/esm/api.js.map +0 -1
  129. package/src/api.ts +0 -149
  130. package/src/schema.md +0 -15
@@ -1,58 +1,373 @@
1
1
  /**
2
- * Types used throughout _BUPKIS_, mainly related to the
3
- * `expect()`/`expectAsync()` API.
2
+ * Types used throughout _BUPKIS_.
3
+ *
4
+ * May be useful for those building on top of _BUPKIS_.
5
+ *
6
+ * @example
7
+ *
8
+ * ```ts
9
+ * // namespace
10
+ * import { types } from 'bupkis';
11
+ * // subpath import
12
+ * import type * as alsoTypes from 'bupkis/types';
13
+ * ```
4
14
  *
5
15
  * @packageDocumentation
6
16
  */
7
- import type { ArrayValues, NonEmptyTuple, Constructor as TypeFestConstructor } from 'type-fest';
17
+ import type { ArrayValues, TupleToUnion, Constructor as TypeFestConstructor, UnionToIntersection } from 'type-fest';
8
18
  import type { z } from 'zod/v4';
9
- import type { AnyAssertion, AnyAsyncAssertion, AnyAsyncAssertions, AnySyncAssertion, AnySyncAssertions, AssertionPart, AssertionParts, AssertionSlot, NoNeverTuple, PhraseLiteral, PhraseLiteralChoice, PhraseLiteralChoiceSlot, PhraseLiteralSlot } from './assertion/assertion-types.js';
10
- import { type Expect, type ExpectAsync } from './api.js';
19
+ import type { AnyAssertion, AnyAsyncAssertion, AnyAsyncAssertions, AnySyncAssertion, AnySyncAssertions, AssertionFunctionAsync, AssertionFunctionSync, AssertionImplFnAsync, AssertionImplFnSync, AssertionImplSchemaAsync, AssertionImplSchemaSync, AssertionPart, AssertionParts, AssertionSchemaAsync, AssertionSchemaSync, AssertionSlot, AssertionSlots, BuiltinAsyncAssertions, BuiltinSyncAssertions, NoNeverTuple, PhraseLiteral, PhraseLiteralChoice, PhraseLiteralChoiceSlot, PhraseLiteralSlot, RawAssertionImplSchemaSync } from './assertion/assertion-types.js';
11
20
  /**
12
- * Helper type to create negated version of assertion parts. For phrase
13
- * literals, creates "not phrase" version. For phrase arrays, creates negated
14
- * versions of each phrase in the array.
21
+ * Creates a negated version of a tuple of
22
+ * {@link AssertionPart | AssertionParts}.
23
+ *
24
+ * For {@link PhraseLiteral | PhraseLiterals}, creates a
25
+ * {@link Negation | "not" variant}. For
26
+ * {@link PhraseLiteralChoice | PhraseLiteralChoices}, creates negated versions
27
+ * of each `Phrase` in the array.
28
+ *
29
+ * Does not affect Zod schemas.
30
+ *
31
+ * @template Parts Parts containing `PhraseLiterals` or `PhraseLiteralChoices`
32
+ * to negate.
15
33
  */
16
- export type AddNegation<T extends readonly AssertionPart[]> = T extends readonly [
34
+ export type AddNegation<Parts extends readonly AssertionPart[]> = Parts extends readonly [
17
35
  infer First extends AssertionPart,
18
36
  ...infer Rest extends readonly AssertionPart[]
19
- ] ? First extends NonEmptyTuple<string> ? readonly [
37
+ ] ? First extends PhraseLiteralChoice ? readonly [
20
38
  {
21
- [K in keyof First]: First[K] extends string ? Negation<First[K]> : never;
39
+ [K in keyof First]: First[K] extends PhraseLiteral ? Negation<First[K]> : never;
22
40
  },
23
41
  ...AddNegation<Rest>
24
- ] : First extends string ? readonly [Negation<First>, ...AddNegation<Rest>] : readonly [First, ...AddNegation<Rest>] : readonly [];
42
+ ] : First extends PhraseLiteral ? readonly [Negation<First>, ...AddNegation<Rest>] : readonly [First, ...AddNegation<Rest>] : readonly [];
43
+ /**
44
+ * Base set of properties included in both {@link Expect} and {@link ExpectAsync}.
45
+ *
46
+ * @preventExpand
47
+ */
48
+ export interface BaseExpect {
49
+ /**
50
+ * Creates a new synchronous assertion.
51
+ */
52
+ createAssertion: CreateAssertionFn;
53
+ /**
54
+ * Creates a new asynchronous assertion.
55
+ */
56
+ createAsyncAssertion: CreateAsyncAssertionFn;
57
+ /**
58
+ * Fails immediately with optional `reason`.
59
+ *
60
+ * @param reason Reason for failure
61
+ * @throws {AssertionError}
62
+ */
63
+ fail: FailFn;
64
+ }
65
+ export type * from './assertion/assertion-types.js';
66
+ /**
67
+ * The main API as returned by a {@link UseFn}.
68
+ *
69
+ * @template BaseSyncAssertions Base set of synchronous
70
+ * {@link Assertion Assertions}; will be the builtin sync assertions, at
71
+ * minimum)
72
+ * @template BaseAsyncAssertions Base set of asynchronous
73
+ * {@link Assertion Assertions}; will be the builtin async assertions, at
74
+ * minimum)
75
+ * @template ExtendedSyncAssertions Synchronous assertions extracted from
76
+ * `MixedAssertions`
77
+ * @template ExtendedAsyncAssertions Asynchronous assertions extracted from
78
+ * `MixedAssertions`
79
+ */
80
+ export interface Bupkis<BaseSyncAssertions extends AnySyncAssertions, BaseAsyncAssertions extends AnyAsyncAssertions, ExtendedSyncAssertions extends readonly AnySyncAssertion[] = readonly [], ExtendedAsyncAssertions extends readonly AnyAsyncAssertion[] = readonly []> {
81
+ /**
82
+ * A new {@link Expect} function which handles {@link ExtendedSyncAssertions}
83
+ * and {@link BaseSyncAssertions}
84
+ */
85
+ expect: Expect<Concat<BaseSyncAssertions, ExtendedSyncAssertions>, Concat<BaseAsyncAssertions, ExtendedAsyncAssertions>>;
86
+ /**
87
+ * A new {@link ExpectAsync} function which handles
88
+ * {@link ExtendedAsyncAssertions} and {@link BaseAsyncAssertions}
89
+ */
90
+ expectAsync: ExpectAsync<Concat<BaseAsyncAssertions, ExtendedAsyncAssertions>, Concat<BaseSyncAssertions, ExtendedSyncAssertions>>;
91
+ /**
92
+ * For composing arrays of assertions, one after another.
93
+ *
94
+ * The _only_ chainable API in <span class="bupkis">Bupkis</span>.
95
+ *
96
+ * @since 0.1.0
97
+ * @example
98
+ *
99
+ * ```ts
100
+ * const { expect } = use([...someAssertions]).use([...otherAssertions]);
101
+ * ```
102
+ */
103
+ use: UseFn<Concat<BaseSyncAssertions, ExtendedSyncAssertions>, Concat<BaseAsyncAssertions, ExtendedAsyncAssertions>>;
104
+ }
25
105
  /**
26
106
  * Helper type to concatenate two tuples
27
107
  */
28
- export type Concat<A extends readonly unknown[], B extends readonly unknown[]> = readonly [...A, ...B];
108
+ export type Concat<TupleA extends readonly unknown[], TupleB extends readonly unknown[]> = readonly [...TupleA, ...TupleB];
29
109
  /**
30
110
  * A constructor based on {@link TypeFestConstructor type-fest's Constructor}
31
111
  * with a default instance type argument.
32
112
  */
33
- export type Constructor<T = any, Arguments extends unknown[] = any[]> = TypeFestConstructor<T, Arguments>;
34
- export type FilterAsyncAssertions<T extends readonly AnyAssertion[]> = T extends readonly [
35
- infer S extends AnyAssertion,
113
+ export type Constructor<Instance = any, Args extends unknown[] = any[]> = TypeFestConstructor<Instance, Args>;
114
+ /**
115
+ * The main factory function for creating synchronous assertions.
116
+ */
117
+ export interface CreateAssertionFn {
118
+ /**
119
+ * Create a synchronous `Assertion` from {@link AssertionParts parts} and a
120
+ * {@link z.ZodType Zod schema}.
121
+ *
122
+ * @template Parts Parts defining the shape of the assertion, including
123
+ * Phrases and Zod schemas
124
+ * @template Impl Assertion implementation as a Zod schema
125
+ * @template Slots Inferred slots based on the provided `Parts`
126
+ * @returns New `AssertionSchemaSync` object
127
+ */
128
+ <const Parts extends AssertionParts, Impl extends RawAssertionImplSchemaSync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionSchemaSync<Parts, AssertionImplSchemaSync<Parts>, Slots>;
129
+ /**
130
+ * Create a synchronous `Assertion` from {@link AssertionParts parts} and an
131
+ * implementation function.
132
+ *
133
+ * @template Parts Parts defining the shape of the assertion, including
134
+ * Phrases and Zod schemas
135
+ * @template Impl Assertion implementation as a function
136
+ * @template Slots Inferred slots based on the provided `Parts`
137
+ * @returns New `AssertionFunctionSync` object
138
+ */
139
+ <const Parts extends AssertionParts, Impl extends AssertionImplFnSync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionFunctionSync<Parts, Impl, Slots>;
140
+ }
141
+ /**
142
+ * The main factory function for creating asynchronous assertions.
143
+ */
144
+ export interface CreateAsyncAssertionFn {
145
+ /**
146
+ * Create an async `Assertion` from {@link AssertionParts parts} and an
147
+ * {@link z.ZodType Zod schema}.
148
+ *
149
+ * The Zod schema need not be async itself.
150
+ *
151
+ * @template Parts Parts defining the shape of the assertion, including
152
+ * Phrases and Zod schemas
153
+ * @template Impl Assertion implementation as a Zod schema
154
+ * @template Slots Inferred slots based on the provided `Parts`
155
+ * @returns New `AssertionSchemaAsync` object
156
+ */
157
+ <const Parts extends AssertionParts, Impl extends AssertionImplSchemaAsync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionSchemaAsync<Parts, Impl, Slots>;
158
+ /**
159
+ * Create an async `Assertion` from {@link AssertionParts parts} and an
160
+ * implementation function.
161
+ *
162
+ * @template Parts Parts defining the shape of the assertion, including
163
+ * Phrases and Zod schemas
164
+ * @template Impl Assertion implementation as a function
165
+ * @template Slots Inferred slots based on the provided `Parts`
166
+ * @returns New `AssertionFunctionAsync` object
167
+ */
168
+ <const Parts extends AssertionParts, Impl extends AssertionImplFnAsync<Parts>, Slots extends AssertionSlots<Parts>>(parts: Parts, impl: Impl): AssertionFunctionAsync<Parts, Impl, Slots>;
169
+ } /**
170
+ * @template BaseSyncAssertions Base set of synchronous
171
+ * {@link Assertion | Assertions}; will be the builtin sync assertions, at
172
+ * minimum)
173
+ * @template BaseAsyncAssertions Base set of asynchronous
174
+ * {@link Assertion | Assertions}; will be the builtin async assertions, at
175
+ * minimum)
176
+ */
177
+ /**
178
+ * The main synchronous assertion function.
179
+ *
180
+ * Contains properties in {@link ExpectSyncProps}.
181
+ *
182
+ * @template SyncAssertions All synchronous assertions available
183
+ * @template AsyncAssertions All asynchronous assertions available; for use in
184
+ * {@link ExpectSyncProps.use}
185
+ * @expandType ExpectSyncProps
186
+ * @see {@link expect}
187
+ */
188
+ export type Expect<SyncAssertions extends AnySyncAssertions = BuiltinSyncAssertions, AsyncAssertions extends AnyAsyncAssertions = BuiltinAsyncAssertions> = ExpectFunction<SyncAssertions> & ExpectSyncProps<SyncAssertions, AsyncAssertions>;
189
+ /**
190
+ * The main asynchronous assertion function.
191
+ *
192
+ * Contains properties in {@link ExpectAsyncProps}.
193
+ *
194
+ * @template AsyncAssertions All asynchronous assertions available
195
+ * @template SyncAssertions All synchronous assertions available; for use in
196
+ * {@link ExpectAsyncProps.use}
197
+ * @expandType ExpectAsyncProps
198
+ * @see {@link expectAsync}
199
+ */
200
+ export type ExpectAsync<AsyncAssertions extends AnyAsyncAssertions = BuiltinAsyncAssertions, SyncAssertions extends AnySyncAssertions = BuiltinSyncAssertions> = ExpectAsyncFunction<AsyncAssertions> & ExpectAsyncProps<AsyncAssertions, SyncAssertions>;
201
+ /**
202
+ * The callable function type for asynchronous assertions.
203
+ *
204
+ * This type represents the actual function signature of an async expect
205
+ * function, created by mapping all available assertions to their respective
206
+ * function signatures and combining them using intersection types. Each
207
+ * assertion contributes its own overload to the final function type.
208
+ *
209
+ * The function signatures are derived from the {@link AssertionParts} of each
210
+ * assertion, with parameters that match the expected slots for natural language
211
+ * assertion calls.
212
+ *
213
+ * @example
214
+ *
215
+ * ```typescript
216
+ * // Example function type derived from async assertions
217
+ * const expectAsync: ExpectAsyncFunction<MyAsyncAssertions> = ...;
218
+ * await expectAsync(promise, 'to resolve');
219
+ * await expectAsync(promise, 'to resolve with value satisfying', expectedValue);
220
+ * ```
221
+ *
222
+ * @template T - Array of async assertion objects that define available
223
+ * assertion logic
224
+ * @see {@link ExpectFunction} for the synchronous equivalent
225
+ * @see {@link SlotsFromParts} for how assertion parts are converted to function parameters
226
+ */
227
+ export type ExpectAsyncFunction<T extends AnyAsyncAssertions = BuiltinAsyncAssertions> = UnionToIntersection<TupleToUnion<{
228
+ [K in keyof T]: T[K] extends AnyAsyncAssertion ? (...args: MutableOrReadonly<SlotsFromParts<T[K]['parts']>>) => Promise<void> : never;
229
+ }>>;
230
+ /**
231
+ * Properties available on asynchronous expect functions.
232
+ *
233
+ * This interface defines the additional properties and methods that are
234
+ * attached to async expect functions, extending the base expect functionality
235
+ * with async-specific features. These properties provide access to the
236
+ * underlying assertions and enable function composition through the
237
+ * {@link UseFn | use} method.
238
+ *
239
+ * @example
240
+ *
241
+ * ```typescript
242
+ * const expectAsync: ExpectAsync<MyAsyncAssertions> =
243
+ * createExpectAsyncFunction(assertions);
244
+ *
245
+ * // Access the underlying assertions
246
+ * console.log(expectAsync.assertions.length);
247
+ *
248
+ * // Compose with additional assertions
249
+ * const { expectAsync: enhanced } = expectAsync.use(moreAssertions);
250
+ * ```
251
+ *
252
+ * @template AsyncAssertions - Array of async assertion objects available to
253
+ * this expect function
254
+ * @template SyncAssertions - Array of sync assertion objects available for
255
+ * composition via {@link UseFn | use}
256
+ */
257
+ export interface ExpectAsyncProps<AsyncAssertions extends AnyAsyncAssertions, SyncAssertions extends AnySyncAssertions> extends BaseExpect {
258
+ /**
259
+ * Tuple of all assertions available in this `expect()`.
260
+ *
261
+ * @preventExpand
262
+ */
263
+ assertions: AsyncAssertions;
264
+ /**
265
+ * {@inheritDoc UseFn}
266
+ */
267
+ use: UseFn<SyncAssertions, AsyncAssertions>;
268
+ }
269
+ export type ExpectFunction<SyncAssertions extends AnySyncAssertions = BuiltinSyncAssertions> = UnionToIntersection<TupleToUnion<{
270
+ [K in keyof SyncAssertions]: SyncAssertions[K] extends AnySyncAssertion ? (...args: MutableOrReadonly<SlotsFromParts<SyncAssertions[K]['parts']>>) => void : never;
271
+ }>>;
272
+ /**
273
+ * Properties of {@link expect}.
274
+ */
275
+ export interface ExpectSyncProps<SyncAssertions extends AnySyncAssertions, AsyncAssertions extends AnyAsyncAssertions> extends BaseExpect {
276
+ /**
277
+ * Tuple of all assertions available in this `expect()`.
278
+ *
279
+ * @preventExpand
280
+ */
281
+ assertions: SyncAssertions;
282
+ /**
283
+ * Function to add more assertions to this `expect()`, returning a new
284
+ * `expect()` and `expectAsync()` pair with the combined assertions.
285
+ */
286
+ use: UseFn<SyncAssertions, AsyncAssertions>;
287
+ }
288
+ /**
289
+ * A function which immediately throws an {@link AssertionError}.
290
+ *
291
+ * Member of {@link BaseExpect}.
292
+ *
293
+ * @param reason Optional reason for failure
294
+ * @see {@link fail}
295
+ */
296
+ export type FailFn = (reason?: string) => never;
297
+ /**
298
+ * Given a mixed array of assertions, filters out only the async assertions.
299
+ */
300
+ /**
301
+ * Given a mixed array of assertions, filters out only the async assertions.
302
+ *
303
+ * This utility type recursively examines each assertion in the input array and
304
+ * constructs a new tuple containing only the asynchronous assertions. It uses
305
+ * conditional types to test whether each assertion extends
306
+ * {@link AnyAsyncAssertion} and includes it in the result if so.
307
+ *
308
+ * Used primarily by {@link UseFn} to separate async assertions from mixed
309
+ * assertion arrays when composing expect functions.
310
+ *
311
+ * @example
312
+ *
313
+ * ```typescript
314
+ * type Mixed = [
315
+ * SyncAssertion1,
316
+ * AsyncAssertion1,
317
+ * SyncAssertion2,
318
+ * AsyncAssertion2,
319
+ * ];
320
+ * type AsyncOnly = FilterAsyncAssertions<Mixed>; // [AsyncAssertion1, AsyncAssertion2]
321
+ * ```
322
+ *
323
+ * @template MixedAssertions - Array that may contain both sync and async
324
+ * assertions
325
+ * @see {@link FilterSyncAssertions} for extracting synchronous assertions
326
+ * @see {@link UseFn} for the primary use case of this type
327
+ */
328
+ export type FilterAsyncAssertions<MixedAssertions extends readonly AnyAssertion[]> = MixedAssertions extends readonly [
329
+ infer MixedAssertion extends AnyAssertion,
36
330
  ...infer Rest extends readonly AnyAssertion[]
37
- ] ? S extends AnyAsyncAssertion ? readonly [S, ...FilterAsyncAssertions<Rest>] : FilterAsyncAssertions<Rest> : readonly [];
38
- export type FilterSyncAssertions<T extends readonly AnyAssertion[]> = T extends readonly [
39
- infer S extends AnyAssertion,
331
+ ] ? MixedAssertion extends AnyAsyncAssertion ? readonly [MixedAssertion, ...FilterAsyncAssertions<Rest>] : FilterAsyncAssertions<Rest> : readonly [];
332
+ /**
333
+ * Given a mixed array of assertions, extracts only the synchronous assertions.
334
+ */
335
+ export type FilterSyncAssertions<MixedAssertions extends readonly AnyAssertion[]> = MixedAssertions extends readonly [
336
+ infer MixedAssertion extends AnyAssertion,
40
337
  ...infer Rest extends readonly AnyAssertion[]
41
- ] ? S extends AnySyncAssertion ? readonly [S, ...FilterSyncAssertions<Rest>] : FilterSyncAssertions<Rest> : readonly [];
338
+ ] ? MixedAssertion extends AnySyncAssertion ? readonly [MixedAssertion, ...FilterSyncAssertions<Rest>] : FilterSyncAssertions<Rest> : readonly [];
42
339
  /**
43
- * Prepares {@link MapExpectSlots} by injecting `unknown` if the `AssertionParts`
44
- * have no `z.ZodType` in the head position.
340
+ * Maps AssertionParts to the corresponding argument types for expect and
341
+ * expectAsync functions.
45
342
  *
46
- * Also filters out `never` from the resulting tuple to guarantee tupleness.
343
+ * This utility type transforms assertion parts into the actual parameter types
344
+ * that users provide when calling expect functions. It handles both phrase
345
+ * literals and Zod schemas, creating appropriate TypeScript types for each
346
+ * slot.
347
+ *
348
+ * For phrase literals, it creates union types that include both the original
349
+ * phrase and its negated version (with "not " prefix). For Zod schemas, it
350
+ * extracts the inferred type. This enables natural language assertions with
351
+ * optional negation support.
47
352
  *
48
353
  * @remarks
49
- * This is a convenience and I hope it's not too confusing.
50
- */
51
- export type InferredExpectSlots<Parts extends AssertionParts> = NoNeverTuple<Parts extends readonly [infer First extends AssertionPart, ...infer _] ? First extends PhraseLiteral | PhraseLiteralChoice ? [unknown, ...MapExpectSlots<Parts>] : MapExpectSlots<Parts> : never>; /**
52
- * Maps `AssertionParts` to the corresponding argument types for `expect` and
53
- * `expectAsync`, as provided by the user.
354
+ * This type works recursively through the parts tuple, transforming each part
355
+ * according to its type. The resulting tuple maintains the same structure as
356
+ * the input but with user-facing TypeScript types instead of internal assertion
357
+ * part types.
358
+ * @example
359
+ *
360
+ * ```typescript
361
+ * // Given parts: ['to be a', z.string()]
362
+ * // Results in: ['to be a' | 'not to be a', string]
363
+ * type Slots = MapExpectSlots<['to be a', z.string()]>;
364
+ * // Usage: expect(value, 'to be a', 'hello') or expect(value, 'not to be a', 'hello')
365
+ * ```
54
366
  *
55
- * Overloads each phrase literal slot with a negated version using a union.
367
+ * @template Parts - Tuple of assertion parts to be converted to function
368
+ * parameter types
369
+ * @see {@link SlotsFromParts} for the complete slot transformation including subject injection
370
+ * @see {@link Negation} for how phrase negation is implemented
56
371
  */
57
372
  export type MapExpectSlots<Parts extends readonly AssertionPart[]> = Parts extends readonly [
58
373
  infer First extends AssertionPart,
@@ -62,18 +377,113 @@ export type MapExpectSlots<Parts extends readonly AssertionPart[]> = Parts exten
62
377
  ...MapExpectSlots<Rest>
63
378
  ] : readonly [];
64
379
  /**
65
- * Makes tuple types accept both mutable and readonly variants
380
+ * Makes tuple types accept both mutable and readonly variants.
381
+ *
382
+ * This utility type creates a union of both mutable and readonly versions of a
383
+ * tuple type, providing flexibility for function parameters that should accept
384
+ * either variant. This is particularly useful for assertion function parameters
385
+ * where users may pass either `const` arrays (readonly) or regular arrays.
386
+ *
387
+ * The type handles both array types and specific tuple types, creating
388
+ * appropriate unions for each case to maintain type safety while maximizing
389
+ * usability.
390
+ *
391
+ * @example
392
+ *
393
+ * ```typescript
394
+ * type FlexibleArgs = MutableOrReadonly<readonly [string, number]>;
395
+ * // Results in: [string, number] | readonly [string, number]
396
+ *
397
+ * function acceptArgs(args: FlexibleArgs) { ... }
398
+ * acceptArgs(['hello', 42]); // ✓ mutable array
399
+ * acceptArgs(['hello', 42] as const); // ✓ readonly array
400
+ * ```
401
+ *
402
+ * @template Tuple - The readonly tuple type to make flexible
403
+ * @see {@link ExpectFunction} and {@link ExpectAsyncFunction} which use this for parameter flexibility
404
+ */
405
+ export type MutableOrReadonly<Tuple extends readonly unknown[]> = Tuple extends readonly (infer Item)[] ? Item[] | readonly Item[] : Tuple extends readonly [infer First, ...infer Rest] ? [First, ...Rest] | readonly [First, ...Rest] : Tuple;
406
+ /**
407
+ * Creates a negated version of a phrase literal by prefixing "not ".
408
+ *
409
+ * This utility type transforms assertion phrases into their negated
410
+ * equivalents, enabling the natural language negation feature in Bupkis
411
+ * assertions. When users provide phrases like "not to be a string", this type
412
+ * helps the system understand and process the negation.
413
+ *
414
+ * The negation is applied at the type level during assertion matching and
415
+ * affects how the assertion logic is executed - negated assertions expect the
416
+ * opposite result.
417
+ *
418
+ * @example
419
+ *
420
+ * ```typescript
421
+ * type Negated = Negation<'to be a string'>; // "not to be a string"
422
+ * type AlsoNegated = Negation<'to equal'>; // "not to equal"
423
+ *
424
+ * // Usage in assertions:
425
+ * expect(42, 'not to be a string'); // Uses negated assertion logic
426
+ * ```
427
+ *
428
+ * @template S - The string literal phrase to be negated
429
+ * @see {@link AddNegation} for applying negation to entire AssertionParts tuples
430
+ * @see {@link MapExpectSlots} for how negation is incorporated into function signatures
431
+ */
432
+ export type Negation<S extends string> = `not ${S}`;
433
+ /**
434
+ * Converts AssertionParts to complete function parameter types for expect
435
+ * functions.
436
+ *
437
+ * This utility type prepares assertion parts for use as function parameters by
438
+ * applying several transformations:
439
+ *
440
+ * 1. Injects an `unknown` type for the subject parameter if the first part is a
441
+ * phrase literal
442
+ * 2. Maps the remaining parts to their corresponding TypeScript types via
443
+ * {@link MapExpectSlots}
444
+ * 3. Filters out `never` types to ensure a clean tuple structure
445
+ *
446
+ * The subject injection is a key feature - when assertions start with phrases
447
+ * like "to be a string", users still need to provide the subject being tested
448
+ * as the first argument to expect functions.
449
+ *
450
+ * @remarks
451
+ * This type is essential for bridging the gap between assertion definitions and
452
+ * user-facing function signatures. The subject injection ensures that all
453
+ * assertions have a consistent calling pattern regardless of whether they
454
+ * explicitly define a subject parameter.
455
+ * @example
456
+ *
457
+ * ```typescript
458
+ * // Assertion parts: ['to equal', z.string()]
459
+ * // Results in: [unknown, 'to equal' | 'not to equal', string]
460
+ * type Slots = SlotsFromParts<['to equal', z.string()]>;
461
+ *
462
+ * // Usage: expect(subject, 'to equal', 'expected')
463
+ * // expect(subject, 'not to equal', 'unexpected')
464
+ * ```
465
+ *
466
+ * @template Parts - Tuple of assertion parts that define the assertion
467
+ * structure
468
+ * @see {@link MapExpectSlots} for the core slot mapping logic
469
+ * @see {@link NoNeverTuple} for never-type filtering
66
470
  */
67
- export type MutableOrReadonly<T> = T extends readonly (infer U)[] ? readonly U[] | U[] : T extends readonly [infer First, ...infer Rest] ? [First, ...Rest] | readonly [First, ...Rest] : T;
471
+ export type SlotsFromParts<Parts extends AssertionParts> = NoNeverTuple<Parts extends readonly [infer First extends AssertionPart, ...infer _] ? First extends PhraseLiteral | PhraseLiteralChoice ? [unknown, ...MapExpectSlots<Parts>] : MapExpectSlots<Parts> : never>;
68
472
  /**
69
- * The type of a `PhraesLiteral` which is negated, e.g. "not to be"
473
+ * The type of a `use()` function.
70
474
  */
71
- export type Negation<T extends string> = `not ${T}`;
72
- export interface UseFn<T extends AnySyncAssertions, U extends AnyAsyncAssertions> {
73
- <V extends readonly AnyAssertion[], W extends FilterSyncAssertions<V>, X extends FilterAsyncAssertions<V>>(assertions: V): {
74
- expect: Expect<Concat<T, W>, Concat<U, X>>;
75
- expectAsync: ExpectAsync<Concat<U, X>, Concat<T, W>>;
76
- use: UseFn<Concat<T, W>, Concat<U, X>>;
77
- };
475
+ export interface UseFn<BaseSyncAssertions extends AnySyncAssertions, BaseAsyncAssertions extends AnyAsyncAssertions> {
476
+ /**
477
+ * @template MixedAssertions Mixed set of assertions to add; may include both
478
+ * sync and async assertions
479
+ * @template ExtendedSyncAssertions Synchronous assertions extracted from
480
+ * `MixedAssertions`
481
+ * @template ExtendedAsyncAssertions Asynchronous assertions extracted from
482
+ * `MixedAssertions`
483
+ * @param assertions Array of assertion classes to add
484
+ * @returns New {@link expect} and {@link expectAsync} functions with the
485
+ * combined assertions
486
+ */
487
+ <MixedAssertions extends readonly AnyAssertion[], ExtendedSyncAssertions extends FilterSyncAssertions<MixedAssertions>, ExtendedAsyncAssertions extends FilterAsyncAssertions<MixedAssertions>>(assertions: MixedAssertions): Bupkis<BaseSyncAssertions, BaseAsyncAssertions, ExtendedSyncAssertions, ExtendedAsyncAssertions>;
78
488
  }
79
489
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,IAAI,mBAAmB,EACnC,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,IACxD,CAAC,SAAS,SAAS;IACjB,MAAM,KAAK,SAAS,aAAa;IACjC,GAAG,MAAM,IAAI,SAAS,SAAS,aAAa,EAAE;CAC/C,GACG,KAAK,SAAS,aAAa,CAAC,MAAM,CAAC,GACjC,SAAS;IACP;SACG,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,MAAM,GACvC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAClB,KAAK;KACV;IACD,GAAG,WAAW,CAAC,IAAI,CAAC;CACrB,GACD,KAAK,SAAS,MAAM,GAClB,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,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nB,sBAAsB,EACtB,uBAAuB,CACxB,CAAC;CACH"}
@@ -1,7 +1,17 @@
1
1
  "use strict";
2
2
  /**
3
- * Types used throughout _BUPKIS_, mainly related to the
4
- * `expect()`/`expectAsync()` API.
3
+ * Types used throughout _BUPKIS_.
4
+ *
5
+ * May be useful for those building on top of _BUPKIS_.
6
+ *
7
+ * @example
8
+ *
9
+ * ```ts
10
+ * // namespace
11
+ * import { types } from 'bupkis';
12
+ * // subpath import
13
+ * import type * as alsoTypes from 'bupkis/types';
14
+ * ```
5
15
  *
6
16
  * @packageDocumentation
7
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -7,6 +7,13 @@
7
7
  * converting shapes to Zod schemas. All functions handle circular references
8
8
  * safely.
9
9
  *
10
+ * @category API
11
+ * @example
12
+ *
13
+ * ```ts
14
+ * import * as util from 'bupkis/util';
15
+ * ```
16
+ *
10
17
  * @packageDocumentation
11
18
  */
12
19
  import { type StringKeyOf } from 'type-fest';
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAW3B,wBAAgB,KAAK,CACnB,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,EACnD,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAChC,UAAU,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAA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;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;CACb,EACN,yBAA+B,KAC9B,CAAC,CAAC,OAoKJ,CAAC"}
@@ -8,6 +8,13 @@
8
8
  * converting shapes to Zod schemas. All functions handle circular references
9
9
  * safely.
10
10
  *
11
+ * @category API
12
+ * @example
13
+ *
14
+ * ```ts
15
+ * import * as util from 'bupkis/util';
16
+ * ```
17
+ *
11
18
  * @packageDocumentation
12
19
  */
13
20
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAcH,sBAkBC;AA7BD,+BAA2B;AAE3B,2CAAuE;AACvE,2CAMqB;AAErB,SAAgB,KAAK,CAGnB,UAAa,EAAE,GAAM;IACrB,MAAM,MAAM,GAAG,EAA+B,CAAC;IAE/C,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,IACE,OAAO,QAAQ,KAAK,QAAQ;YAC5B,OAAO,QAAQ,KAAK,QAAQ;YAC5B,OAAO,QAAQ,KAAK,QAAQ,EAC5B,CAAC;YACD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACI,MAAM,aAAa,GAAG,CAC3B,KAAc,EACd,UAgBI,EAAE,EACN,UAAU,IAAI,OAAO,EAAU,EACpB,EAAE;IACb,MAAM,EACJ,aAAa,GAAG,CAAC,EACjB,gBAAgB,GAAG,IAAI,EACvB,iBAAiB,G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