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
package/src/util.ts CHANGED
@@ -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
 
@@ -1,93 +0,0 @@
1
- /**
2
- * Contains the main API types
3
- *
4
- * @packageDocumentation
5
- */
6
- import type { TupleToUnion, UnionToIntersection } from 'type-fest';
7
- import type { AnyAsyncAssertion, AnyAsyncAssertions, AnySyncAssertion, AnySyncAssertions, BuiltinAsyncAssertions, BuiltinSyncAssertions } from './assertion/assertion-types.js';
8
- import type { createAssertion, createAsyncAssertion } from './assertion/create.js';
9
- import { type InferredExpectSlots, type MutableOrReadonly, type UseFn } from './types.js';
10
- /**
11
- * Base set of properties included in both {@link Expect} and {@link ExpectAsync}.
12
- */
13
- export interface BaseExpect {
14
- /**
15
- * Creates a new synchronous assertion.
16
- */
17
- createAssertion: typeof createAssertion;
18
- /**
19
- * Creates a new asynchronous assertion.
20
- */
21
- createAsyncAssertion: typeof createAsyncAssertion;
22
- /**
23
- * Fails immediately with optional `reason`.
24
- *
25
- * @param reason Reason for failure
26
- * @throws {AssertionError}
27
- */
28
- fail(this: void, reason?: string): never;
29
- }
30
- /**
31
- * The main synchronous assertion function.
32
- *
33
- * Contains properties in {@link ExpectSyncProps}.
34
- *
35
- * @template T All synchronous assertions available
36
- * @template U All asynchronous assertions available; for use in
37
- * {@link ExpectSyncProps.use}
38
- * @useDeclaredType
39
- * @see {@link expect}
40
- */
41
- export type Expect<T extends AnySyncAssertions = BuiltinSyncAssertions, U extends AnyAsyncAssertions = BuiltinAsyncAssertions> = ExpectFunction<T> & ExpectSyncProps<T, U>;
42
- /**
43
- * The main asynchronous assertion function.
44
- *
45
- * Contains properties in {@link ExpectSyncProps}.
46
- *
47
- * @useDeclaredType
48
- * @see {@link expectAsync}
49
- */
50
- export type ExpectAsync<T extends AnyAsyncAssertions = BuiltinAsyncAssertions, U extends AnySyncAssertions = BuiltinSyncAssertions> = ExpectAsyncFunction<T> & ExpectAsyncProps<T, U>;
51
- /**
52
- * All function overloads for `expectAsync()`; part of {@link ExpectAsync}.
53
- */
54
- export type ExpectAsyncFunction<T extends AnyAsyncAssertions = BuiltinAsyncAssertions> = UnionToIntersection<TupleToUnion<{
55
- [K in keyof T]: T[K] extends AnyAsyncAssertion ? (...args: MutableOrReadonly<InferredExpectSlots<T[K]['parts']>>) => Promise<void> : never;
56
- }>>;
57
- /**
58
- * Properties available on `expectAsync()`; part of {@link ExpectAsync}.
59
- */
60
- export interface ExpectAsyncProps<T extends AnyAsyncAssertions, U extends AnySyncAssertions> extends BaseExpect {
61
- /**
62
- * Tuple of all assertions available in this `expect()`.
63
- */
64
- assertions: T;
65
- /**
66
- * Function to add more assertions to this `expect()`, returning a new
67
- * `expect()` and `expectAsync()` pair with the combined assertions.
68
- */
69
- use: UseFn<U, T>;
70
- }
71
- /**
72
- * All function overloads for `expect()`; part of {@link Expect}.
73
- *
74
- * @useDeclaredType
75
- */
76
- export type ExpectFunction<T extends AnySyncAssertions = BuiltinSyncAssertions> = UnionToIntersection<TupleToUnion<{
77
- [K in keyof T]: T[K] extends AnySyncAssertion ? (...args: MutableOrReadonly<InferredExpectSlots<T[K]['parts']>>) => void : never;
78
- }>>;
79
- /**
80
- * Properties for `expect()`; part of {@link Expect}.
81
- */
82
- export interface ExpectSyncProps<T extends AnySyncAssertions, U extends AnyAsyncAssertions> extends BaseExpect {
83
- /**
84
- * Tuple of all assertions available in this `expect()`.
85
- */
86
- assertions: T;
87
- /**
88
- * Function to add more assertions to this `expect()`, returning a new
89
- * `expect()` and `expectAsync()` pair with the combined assertions.
90
- */
91
- use: UseFn<T, U>;
92
- }
93
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACX,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC;;OAEG;IACH,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC1C;AAED;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,MAAM,CAChB,CAAC,SAAS,iBAAiB,GAAG,qBAAqB,EACnD,CAAC,SAAS,kBAAkB,GAAG,sBAAsB,IACnD,cAAc,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9C;;;;;;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,CAC5B,SAAQ,UAAU;IAClB;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC;IAEd;;;OAGG;IACH,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAClB"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- /**
3
- * Contains the main API types
4
- *
5
- * @packageDocumentation
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
package/dist/esm/api.d.ts DELETED
@@ -1,93 +0,0 @@
1
- /**
2
- * Contains the main API types
3
- *
4
- * @packageDocumentation
5
- */
6
- import type { TupleToUnion, UnionToIntersection } from 'type-fest';
7
- import type { AnyAsyncAssertion, AnyAsyncAssertions, AnySyncAssertion, AnySyncAssertions, BuiltinAsyncAssertions, BuiltinSyncAssertions } from './assertion/assertion-types.js';
8
- import type { createAssertion, createAsyncAssertion } from './assertion/create.js';
9
- import { type InferredExpectSlots, type MutableOrReadonly, type UseFn } from './types.js';
10
- /**
11
- * Base set of properties included in both {@link Expect} and {@link ExpectAsync}.
12
- */
13
- export interface BaseExpect {
14
- /**
15
- * Creates a new synchronous assertion.
16
- */
17
- createAssertion: typeof createAssertion;
18
- /**
19
- * Creates a new asynchronous assertion.
20
- */
21
- createAsyncAssertion: typeof createAsyncAssertion;
22
- /**
23
- * Fails immediately with optional `reason`.
24
- *
25
- * @param reason Reason for failure
26
- * @throws {AssertionError}
27
- */
28
- fail(this: void, reason?: string): never;
29
- }
30
- /**
31
- * The main synchronous assertion function.
32
- *
33
- * Contains properties in {@link ExpectSyncProps}.
34
- *
35
- * @template T All synchronous assertions available
36
- * @template U All asynchronous assertions available; for use in
37
- * {@link ExpectSyncProps.use}
38
- * @useDeclaredType
39
- * @see {@link expect}
40
- */
41
- export type Expect<T extends AnySyncAssertions = BuiltinSyncAssertions, U extends AnyAsyncAssertions = BuiltinAsyncAssertions> = ExpectFunction<T> & ExpectSyncProps<T, U>;
42
- /**
43
- * The main asynchronous assertion function.
44
- *
45
- * Contains properties in {@link ExpectSyncProps}.
46
- *
47
- * @useDeclaredType
48
- * @see {@link expectAsync}
49
- */
50
- export type ExpectAsync<T extends AnyAsyncAssertions = BuiltinAsyncAssertions, U extends AnySyncAssertions = BuiltinSyncAssertions> = ExpectAsyncFunction<T> & ExpectAsyncProps<T, U>;
51
- /**
52
- * All function overloads for `expectAsync()`; part of {@link ExpectAsync}.
53
- */
54
- export type ExpectAsyncFunction<T extends AnyAsyncAssertions = BuiltinAsyncAssertions> = UnionToIntersection<TupleToUnion<{
55
- [K in keyof T]: T[K] extends AnyAsyncAssertion ? (...args: MutableOrReadonly<InferredExpectSlots<T[K]['parts']>>) => Promise<void> : never;
56
- }>>;
57
- /**
58
- * Properties available on `expectAsync()`; part of {@link ExpectAsync}.
59
- */
60
- export interface ExpectAsyncProps<T extends AnyAsyncAssertions, U extends AnySyncAssertions> extends BaseExpect {
61
- /**
62
- * Tuple of all assertions available in this `expect()`.
63
- */
64
- assertions: T;
65
- /**
66
- * Function to add more assertions to this `expect()`, returning a new
67
- * `expect()` and `expectAsync()` pair with the combined assertions.
68
- */
69
- use: UseFn<U, T>;
70
- }
71
- /**
72
- * All function overloads for `expect()`; part of {@link Expect}.
73
- *
74
- * @useDeclaredType
75
- */
76
- export type ExpectFunction<T extends AnySyncAssertions = BuiltinSyncAssertions> = UnionToIntersection<TupleToUnion<{
77
- [K in keyof T]: T[K] extends AnySyncAssertion ? (...args: MutableOrReadonly<InferredExpectSlots<T[K]['parts']>>) => void : never;
78
- }>>;
79
- /**
80
- * Properties for `expect()`; part of {@link Expect}.
81
- */
82
- export interface ExpectSyncProps<T extends AnySyncAssertions, U extends AnyAsyncAssertions> extends BaseExpect {
83
- /**
84
- * Tuple of all assertions available in this `expect()`.
85
- */
86
- assertions: T;
87
- /**
88
- * Function to add more assertions to this `expect()`, returning a new
89
- * `expect()` and `expectAsync()` pair with the combined assertions.
90
- */
91
- use: UseFn<T, U>;
92
- }
93
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACX,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC;;OAEG;IACH,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC1C;AAED;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,MAAM,CAChB,CAAC,SAAS,iBAAiB,GAAG,qBAAqB,EACnD,CAAC,SAAS,kBAAkB,GAAG,sBAAsB,IACnD,cAAc,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9C;;;;;;;GAOG;AAEH,MAAM,MAAM,WAAW,CACrB,CAAC,SAAS,kBAAkB,GAAG,sBAAsB,EACrD,CAAC,SAAS,iBAAiB,GAAG,qBAAqB,IACjD,mBAAmB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEpD;;G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3
- *
4
- * @packageDocumentation
5
- */
6
- export {};
7
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/src/api.ts DELETED
@@ -1,149 +0,0 @@
1
- /**
2
- * Contains the main API types
3
- *
4
- * @packageDocumentation
5
- */
6
-
7
- import type { TupleToUnion, UnionToIntersection } from 'type-fest';
8
-
9
- import type {
10
- AnyAsyncAssertion,
11
- AnyAsyncAssertions,
12
- AnySyncAssertion,
13
- AnySyncAssertions,
14
- BuiltinAsyncAssertions,
15
- BuiltinSyncAssertions,
16
- } from './assertion/assertion-types.js';
17
- import type {
18
- createAssertion,
19
- createAsyncAssertion,
20
- } from './assertion/create.js';
21
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
- import type { expect, expectAsync } from './bootstrap.js';
23
-
24
- import {
25
- type InferredExpectSlots,
26
- type MutableOrReadonly,
27
- type UseFn,
28
- } from './types.js';
29
-
30
- /**
31
- * Base set of properties included in both {@link Expect} and {@link ExpectAsync}.
32
- */
33
- export interface BaseExpect {
34
- /**
35
- * Creates a new synchronous assertion.
36
- */
37
- createAssertion: typeof createAssertion;
38
- /**
39
- * Creates a new asynchronous assertion.
40
- */
41
- createAsyncAssertion: typeof createAsyncAssertion;
42
- /**
43
- * Fails immediately with optional `reason`.
44
- *
45
- * @param reason Reason for failure
46
- * @throws {AssertionError}
47
- */
48
- fail(this: void, reason?: string): never;
49
- }
50
-
51
- /**
52
- * The main synchronous assertion function.
53
- *
54
- * Contains properties in {@link ExpectSyncProps}.
55
- *
56
- * @template T All synchronous assertions available
57
- * @template U All asynchronous assertions available; for use in
58
- * {@link ExpectSyncProps.use}
59
- * @useDeclaredType
60
- * @see {@link expect}
61
- */
62
-
63
- export type Expect<
64
- T extends AnySyncAssertions = BuiltinSyncAssertions,
65
- U extends AnyAsyncAssertions = BuiltinAsyncAssertions,
66
- > = ExpectFunction<T> & ExpectSyncProps<T, U>;
67
-
68
- /**
69
- * The main asynchronous assertion function.
70
- *
71
- * Contains properties in {@link ExpectSyncProps}.
72
- *
73
- * @useDeclaredType
74
- * @see {@link expectAsync}
75
- */
76
-
77
- export type ExpectAsync<
78
- T extends AnyAsyncAssertions = BuiltinAsyncAssertions,
79
- U extends AnySyncAssertions = BuiltinSyncAssertions,
80
- > = ExpectAsyncFunction<T> & ExpectAsyncProps<T, U>;
81
-
82
- /**
83
- * All function overloads for `expectAsync()`; part of {@link ExpectAsync}.
84
- */
85
-
86
- export type ExpectAsyncFunction<
87
- T extends AnyAsyncAssertions = BuiltinAsyncAssertions,
88
- > = UnionToIntersection<
89
- TupleToUnion<{
90
- [K in keyof T]: T[K] extends AnyAsyncAssertion
91
- ? (
92
- ...args: MutableOrReadonly<InferredExpectSlots<T[K]['parts']>>
93
- ) => Promise<void>
94
- : never;
95
- }>
96
- >;
97
-
98
- /**
99
- * Properties available on `expectAsync()`; part of {@link ExpectAsync}.
100
- */
101
-
102
- export interface ExpectAsyncProps<
103
- T extends AnyAsyncAssertions,
104
- U extends AnySyncAssertions,
105
- > extends BaseExpect {
106
- /**
107
- * Tuple of all assertions available in this `expect()`.
108
- */
109
- assertions: T;
110
- /**
111
- * Function to add more assertions to this `expect()`, returning a new
112
- * `expect()` and `expectAsync()` pair with the combined assertions.
113
- */
114
- use: UseFn<U, T>;
115
- }
116
-
117
- /**
118
- * All function overloads for `expect()`; part of {@link Expect}.
119
- *
120
- * @useDeclaredType
121
- */
122
- export type ExpectFunction<
123
- T extends AnySyncAssertions = BuiltinSyncAssertions,
124
- > = UnionToIntersection<
125
- TupleToUnion<{
126
- [K in keyof T]: T[K] extends AnySyncAssertion
127
- ? (...args: MutableOrReadonly<InferredExpectSlots<T[K]['parts']>>) => void
128
- : never;
129
- }>
130
- >;
131
-
132
- /**
133
- * Properties for `expect()`; part of {@link Expect}.
134
- */
135
- export interface ExpectSyncProps<
136
- T extends AnySyncAssertions,
137
- U extends AnyAsyncAssertions,
138
- > extends BaseExpect {
139
- /**
140
- * Tuple of all assertions available in this `expect()`.
141
- */
142
- assertions: T;
143
-
144
- /**
145
- * Function to add more assertions to this `expect()`, returning a new
146
- * `expect()` and `expectAsync()` pair with the combined assertions.
147
- */
148
- use: UseFn<T, U>;
149
- }
package/src/schema.md DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- title: About Schemas
3
- group: Documents
4
- category: 'For Developers'
5
- ---
6
-
7
- # About Schemas
8
-
9
- The schemas located in [schema.ts](./schema.ts) are used internally, but will be helpful for anyone implementing custom assertions.
10
-
11
- These contain workarounds for where Zod's concepts and scope conflict with the aim of _BUPKIS_.
12
-
13
- For example, we have a `FunctionSchema` which accepts any function, regardless of its signature. Zod v4's `z.function()` is no longer a `ZodType` and acts differently, but this schema allows us to validate "is a function" assertions and perform assertion matching.
14
-
15
- Likewise, `z.promise()` does not parse a `Promise` instance, but rather the resolved value of a promise. This is not what we want for "is a Promise" assertions, so we have `PromiseSchema` to handle that.