@overkill-dev/doubles 0.0.1 → 0.0.2

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 (178) hide show
  1. package/LICENSE +21 -0
  2. package/assert/assertion-extension.d.ts +65 -0
  3. package/assert/assertion-extension.d.ts.map +1 -0
  4. package/assert/assertion-extension.js +250 -0
  5. package/assert/assertion-extension.js.map +1 -0
  6. package/assertion-protocol/assertion-evaluation.d.ts +13 -0
  7. package/assertion-protocol/assertion-evaluation.d.ts.map +1 -0
  8. package/assertion-protocol/assertion-node-shape.d.ts +71 -0
  9. package/assertion-protocol/assertion-node-shape.d.ts.map +1 -0
  10. package/assertion-protocol/assertion-node.d.ts +97 -0
  11. package/assertion-protocol/assertion-node.d.ts.map +1 -0
  12. package/assertion-protocol/assertion-reference.d.ts +73 -0
  13. package/assertion-protocol/assertion-reference.d.ts.map +1 -0
  14. package/assertion-protocol/assertion-reference.js +49 -0
  15. package/assertion-protocol/assertion-reference.js.map +1 -0
  16. package/assertion-protocol/assertions/boolean.d.ts +11 -0
  17. package/assertion-protocol/assertions/boolean.d.ts.map +1 -0
  18. package/assertion-protocol/assertions/collection.d.ts +22 -0
  19. package/assertion-protocol/assertions/collection.d.ts.map +1 -0
  20. package/assertion-protocol/assertions/equality.d.ts +17 -0
  21. package/assertion-protocol/assertions/equality.d.ts.map +1 -0
  22. package/assertion-protocol/assertions/fail.d.ts +13 -0
  23. package/assertion-protocol/assertions/fail.d.ts.map +1 -0
  24. package/assertion-protocol/assertions/numeric.d.ts +29 -0
  25. package/assertion-protocol/assertions/numeric.d.ts.map +1 -0
  26. package/assertion-protocol/assertions/partial.d.ts +14 -0
  27. package/assertion-protocol/assertions/partial.d.ts.map +1 -0
  28. package/assertion-protocol/assertions/presence.d.ts +17 -0
  29. package/assertion-protocol/assertions/presence.d.ts.map +1 -0
  30. package/assertion-protocol/assertions/string.d.ts +28 -0
  31. package/assertion-protocol/assertions/string.d.ts.map +1 -0
  32. package/assertion-protocol/assertions/type-shape.d.ts +42 -0
  33. package/assertion-protocol/assertions/type-shape.d.ts.map +1 -0
  34. package/assertion-protocol/thrown-error-record.d.ts +8 -0
  35. package/assertion-protocol/thrown-error-record.d.ts.map +1 -0
  36. package/assertion-protocol/thrown-error-record.js +17 -0
  37. package/assertion-protocol/thrown-error-record.js.map +1 -0
  38. package/assertion-protocol/thrown-matcher.d.ts +51 -0
  39. package/assertion-protocol/thrown-matcher.d.ts.map +1 -0
  40. package/assertion-protocol/thrown-matcher.js +186 -0
  41. package/assertion-protocol/thrown-matcher.js.map +1 -0
  42. package/compare/comparison-result.d.ts +25 -0
  43. package/compare/comparison-result.d.ts.map +1 -0
  44. package/compare/comparison-state.d.ts +7 -0
  45. package/compare/comparison-state.d.ts.map +1 -0
  46. package/compare/comparison-state.js +20 -0
  47. package/compare/comparison-state.js.map +1 -0
  48. package/compare/comparison.d.ts +12 -0
  49. package/compare/comparison.d.ts.map +1 -0
  50. package/compare/raw-comparison.d.ts +24 -0
  51. package/compare/raw-comparison.d.ts.map +1 -0
  52. package/compare/raw-comparison.js +285 -0
  53. package/compare/raw-comparison.js.map +1 -0
  54. package/compare/serialized-value-shape.d.ts +143 -0
  55. package/compare/serialized-value-shape.d.ts.map +1 -0
  56. package/compare/serialized-value.d.ts +11 -0
  57. package/compare/serialized-value.d.ts.map +1 -0
  58. package/compare/value-classification.d.ts +26 -0
  59. package/compare/value-classification.d.ts.map +1 -0
  60. package/compare/value-classification.js +110 -0
  61. package/compare/value-classification.js.map +1 -0
  62. package/diff/diff-shape.d.ts +117 -0
  63. package/diff/diff-shape.d.ts.map +1 -0
  64. package/doubles/disposal-symbol.d.ts +3 -0
  65. package/doubles/disposal-symbol.d.ts.map +1 -0
  66. package/doubles/disposal-symbol.js +10 -0
  67. package/doubles/disposal-symbol.js.map +1 -0
  68. package/doubles/double-behavior.d.ts +106 -0
  69. package/doubles/double-behavior.d.ts.map +1 -0
  70. package/doubles/double-behavior.js +257 -0
  71. package/doubles/double-behavior.js.map +1 -0
  72. package/doubles/double-chronology.d.ts +21 -0
  73. package/doubles/double-chronology.d.ts.map +1 -0
  74. package/doubles/double-chronology.js +78 -0
  75. package/doubles/double-chronology.js.map +1 -0
  76. package/doubles/double-history-api.d.ts +33 -0
  77. package/doubles/double-history-api.d.ts.map +1 -0
  78. package/doubles/double-history-api.js +125 -0
  79. package/doubles/double-history-api.js.map +1 -0
  80. package/doubles/double-history-record.d.ts +82 -0
  81. package/doubles/double-history-record.d.ts.map +1 -0
  82. package/doubles/double-history-record.js +65 -0
  83. package/doubles/double-history-record.js.map +1 -0
  84. package/doubles/double-history-store.d.ts +21 -0
  85. package/doubles/double-history-store.d.ts.map +1 -0
  86. package/doubles/double-history-store.js +118 -0
  87. package/doubles/double-history-store.js.map +1 -0
  88. package/doubles/double-history.d.ts +141 -0
  89. package/doubles/double-history.d.ts.map +1 -0
  90. package/doubles/double-history.js +32 -0
  91. package/doubles/double-history.js.map +1 -0
  92. package/doubles/double-iterator-event-types.d.ts +25 -0
  93. package/doubles/double-iterator-event-types.d.ts.map +1 -0
  94. package/doubles/double-iterator-tracking.d.ts +12 -0
  95. package/doubles/double-iterator-tracking.d.ts.map +1 -0
  96. package/doubles/double-iterator-tracking.js +161 -0
  97. package/doubles/double-iterator-tracking.js.map +1 -0
  98. package/doubles/double-rule-arguments.d.ts +18 -0
  99. package/doubles/double-rule-arguments.d.ts.map +1 -0
  100. package/doubles/double-rule-callback.d.ts +40 -0
  101. package/doubles/double-rule-callback.d.ts.map +1 -0
  102. package/doubles/double-rule-callback.js +84 -0
  103. package/doubles/double-rule-callback.js.map +1 -0
  104. package/doubles/double-rule-generator.d.ts +108 -0
  105. package/doubles/double-rule-generator.d.ts.map +1 -0
  106. package/doubles/double-rule-generator.js +37 -0
  107. package/doubles/double-rule-generator.js.map +1 -0
  108. package/doubles/double-rule-types.d.ts +162 -0
  109. package/doubles/double-rule-types.d.ts.map +1 -0
  110. package/doubles/double-rule.d.ts +3 -0
  111. package/doubles/double-rule.d.ts.map +1 -0
  112. package/doubles/double-rule.js +113 -0
  113. package/doubles/double-rule.js.map +1 -0
  114. package/doubles/double-runtime.d.ts +9 -0
  115. package/doubles/double-runtime.d.ts.map +1 -0
  116. package/doubles/double-runtime.js +173 -0
  117. package/doubles/double-runtime.js.map +1 -0
  118. package/doubles/double-signature.d.ts +5 -0
  119. package/doubles/double-signature.d.ts.map +1 -0
  120. package/doubles/double-usage-argument-assertion.d.ts +27 -0
  121. package/doubles/double-usage-argument-assertion.d.ts.map +1 -0
  122. package/doubles/double-usage-argument-assertion.js +202 -0
  123. package/doubles/double-usage-argument-assertion.js.map +1 -0
  124. package/doubles/double-usage-contract.d.ts +29 -0
  125. package/doubles/double-usage-contract.d.ts.map +1 -0
  126. package/doubles/double-usage-contract.js +11 -0
  127. package/doubles/double-usage-contract.js.map +1 -0
  128. package/doubles/double-usage-count-assertion.d.ts +6 -0
  129. package/doubles/double-usage-count-assertion.d.ts.map +1 -0
  130. package/doubles/double-usage-count-assertion.js +73 -0
  131. package/doubles/double-usage-count-assertion.js.map +1 -0
  132. package/doubles/double-usage-disposal-assertion.d.ts +7 -0
  133. package/doubles/double-usage-disposal-assertion.d.ts.map +1 -0
  134. package/doubles/double-usage-disposal-assertion.js +175 -0
  135. package/doubles/double-usage-disposal-assertion.js.map +1 -0
  136. package/doubles/double-usage-inspection.d.ts +22 -0
  137. package/doubles/double-usage-inspection.d.ts.map +1 -0
  138. package/doubles/double-usage-inspection.js +59 -0
  139. package/doubles/double-usage-inspection.js.map +1 -0
  140. package/doubles/double-usage-iterator-assertion.d.ts +7 -0
  141. package/doubles/double-usage-iterator-assertion.d.ts.map +1 -0
  142. package/doubles/double-usage-iterator-assertion.js +124 -0
  143. package/doubles/double-usage-iterator-assertion.js.map +1 -0
  144. package/doubles/double-usage-order-assertion.d.ts +3 -0
  145. package/doubles/double-usage-order-assertion.d.ts.map +1 -0
  146. package/doubles/double-usage-order-assertion.js +91 -0
  147. package/doubles/double-usage-order-assertion.js.map +1 -0
  148. package/doubles/double-usage.d.ts +81 -0
  149. package/doubles/double-usage.d.ts.map +1 -0
  150. package/doubles/double-usage.js +228 -0
  151. package/doubles/double-usage.js.map +1 -0
  152. package/doubles/protocol-disposable-double.d.ts +16 -0
  153. package/doubles/protocol-disposable-double.d.ts.map +1 -0
  154. package/doubles/protocol-disposable-double.js +37 -0
  155. package/doubles/protocol-disposable-double.js.map +1 -0
  156. package/doubles/protocol-double-metadata.d.ts +15 -0
  157. package/doubles/protocol-double-metadata.d.ts.map +1 -0
  158. package/doubles/protocol-double-metadata.js +30 -0
  159. package/doubles/protocol-double-metadata.js.map +1 -0
  160. package/doubles/protocol-double.d.ts +50 -0
  161. package/doubles/protocol-double.d.ts.map +1 -0
  162. package/doubles/protocol-double.js +76 -0
  163. package/doubles/protocol-double.js.map +1 -0
  164. package/doubles/protocol-iterator-double.d.ts +93 -0
  165. package/doubles/protocol-iterator-double.d.ts.map +1 -0
  166. package/doubles/protocol-iterator-double.js +512 -0
  167. package/doubles/protocol-iterator-double.js.map +1 -0
  168. package/doubles/test-double.d.ts +62 -0
  169. package/doubles/test-double.d.ts.map +1 -0
  170. package/doubles/test-double.js +192 -0
  171. package/doubles/test-double.js.map +1 -0
  172. package/package.json +36 -6
  173. package/packages/doubles/doubles.entry-point.d.ts +13 -0
  174. package/packages/doubles/doubles.entry-point.d.ts.map +1 -0
  175. package/packages/doubles/doubles.entry-point.js +5 -0
  176. package/packages/doubles/doubles.entry-point.js.map +1 -0
  177. package/readme.md +423 -5
  178. package/sbom.cdx.json +30 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Overkill contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,65 @@
1
+ import { type CompositeAssertionGroup, type CompositeAssertionReference, type CompositeAssertionSummaryContext, type AssertCompositeAssertionReturn, type NarrowingCompositeAssertionReference } from '../assertion-protocol/assertion-reference.ts';
2
+ import type { BuiltInAssertAssertionNode, CompositeAssertionChildNode, ForeignAssertionNode } from '../assertion-protocol/assertion-node.ts';
3
+ import type { AssertionSource, DeepComparable, InstanceConstructor, NonEmptyReadonlyArray, ResolvableSourceLocation } from '../assertion-protocol/assertion-node-shape.ts';
4
+ import { type SynchronousCallback, type ThrownMatcher } from '../assertion-protocol/thrown-matcher.ts';
5
+ type GroupItem<Source extends AssertionSource> = CompositeAssertionChildNode<Source> | CompositeAssertionGroup<Source>;
6
+ type CompositeAssertionSummaryFormatter<Arguments extends readonly unknown[]> = (context: CompositeAssertionSummaryContext, ...parameters: Arguments) => string;
7
+ type NarrowingCompositeAssertionSummaryFormatter<Actual, Arguments extends readonly unknown[]> = (context: CompositeAssertionSummaryContext, actual: Actual, ...parameters: Arguments) => string;
8
+ export type CompositeCheckBuilder<Source extends AssertionSource = AssertionSource> = {
9
+ readonly annotated: (message: string) => CompositeCheckBuilder<Source>;
10
+ readonly array: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
11
+ readonly arrayContainsPartial: <Actual, Expected>(actual: readonly DeepComparable<Actual>[], expectedSubset: DeepComparable<Expected>) => BuiltInAssertAssertionNode<Source>;
12
+ readonly between: (actual: number, minimum: number, maximum: number) => BuiltInAssertAssertionNode<Source>;
13
+ readonly boolean: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
14
+ readonly deepEqual: <Actual, Expected>(actual: DeepComparable<Actual>, expected: DeepComparable<Expected>) => BuiltInAssertAssertionNode<Source>;
15
+ readonly defined: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
16
+ readonly empty: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
17
+ readonly endsWith: (actual: string, expected: string) => BuiltInAssertAssertionNode<Source>;
18
+ readonly equal: (actual: unknown, expected: unknown) => BuiltInAssertAssertionNode<Source>;
19
+ readonly fail: () => BuiltInAssertAssertionNode<Source>;
20
+ readonly false: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
21
+ readonly fromRejectable: (label: string, body: () => Promise<void>) => Promise<ForeignAssertionNode<Source>>;
22
+ readonly fromThrowable: (label: string, body: () => void) => ForeignAssertionNode<Source>;
23
+ readonly function: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
24
+ readonly greaterThan: (actual: number, expected: number) => BuiltInAssertAssertionNode<Source>;
25
+ readonly greaterThanOrEqual: (actual: number, expected: number) => BuiltInAssertAssertionNode<Source>;
26
+ readonly group: (children: NonEmptyReadonlyArray<GroupItem<Source>>) => CompositeAssertionGroup<Source>;
27
+ readonly hasProperty: (actual: unknown, key: PropertyKey) => BuiltInAssertAssertionNode<Source>;
28
+ readonly includes: (actual: string, expected: string) => BuiltInAssertAssertionNode<Source>;
29
+ readonly instanceOf: (actual: unknown, expected: InstanceConstructor) => BuiltInAssertAssertionNode<Source>;
30
+ readonly length: (actual: unknown, expectedLength: number) => BuiltInAssertAssertionNode<Source>;
31
+ readonly lessThan: (actual: number, expected: number) => BuiltInAssertAssertionNode<Source>;
32
+ readonly lessThanOrEqual: (actual: number, expected: number) => BuiltInAssertAssertionNode<Source>;
33
+ readonly match: (actual: string, pattern: RegExp) => BuiltInAssertAssertionNode<Source>;
34
+ readonly membersPartialDeepEqual: <Actual, Expected>(actual: readonly DeepComparable<Actual>[], expectedMembers: readonly DeepComparable<Expected>[]) => BuiltInAssertAssertionNode<Source>;
35
+ readonly notDeepEqual: <Actual, Expected>(actual: DeepComparable<Actual>, expected: DeepComparable<Expected>) => BuiltInAssertAssertionNode<Source>;
36
+ readonly notEmpty: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
37
+ readonly notEqual: (actual: unknown, expected: unknown) => BuiltInAssertAssertionNode<Source>;
38
+ readonly notMatch: (actual: string, pattern: RegExp) => BuiltInAssertAssertionNode<Source>;
39
+ readonly notNull: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
40
+ readonly null: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
41
+ readonly number: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
42
+ readonly object: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
43
+ readonly partialDeepEqual: <Actual, Expected>(actual: DeepComparable<Actual>, expectedSubset: DeepComparable<Expected>) => BuiltInAssertAssertionNode<Source>;
44
+ readonly rejects: (thunk: () => PromiseLike<unknown>, matcher: ThrownMatcher) => Promise<CompositeAssertionGroup<Source>>;
45
+ readonly startsWith: (actual: string, expected: string) => BuiltInAssertAssertionNode<Source>;
46
+ readonly string: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
47
+ readonly throws: <Body extends () => unknown>(body: SynchronousCallback<Body>, matcher: ThrownMatcher) => CompositeAssertionGroup<Source>;
48
+ readonly true: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
49
+ readonly undefined: (actual: unknown) => BuiltInAssertAssertionNode<Source>;
50
+ };
51
+ export type CompositeAssertionDefinition<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn> = {
52
+ readonly assert: (check: CompositeCheckBuilder<'assert'>, ...parameters: Arguments) => Result;
53
+ readonly formatSummary?: CompositeAssertionSummaryFormatter<Arguments>;
54
+ readonly name: string;
55
+ };
56
+ export type NarrowingCompositeAssertionDefinition<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]> = {
57
+ readonly formatSummary?: NarrowingCompositeAssertionSummaryFormatter<Actual, Arguments>;
58
+ readonly name: string;
59
+ readonly narrows: (actual: Actual, ...parameters: Arguments) => actual is Narrowed;
60
+ };
61
+ export declare function createCompositeCheckBuilder<Source extends AssertionSource>(source: Source, message: string | null, location: ResolvableSourceLocation): CompositeCheckBuilder<Source>;
62
+ export declare function defineCompositeAssertion<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(definition: CompositeAssertionDefinition<Arguments, Result>): CompositeAssertionReference<Arguments, Result>;
63
+ export declare function defineNarrowingCompositeAssertion<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(definition: NarrowingCompositeAssertionDefinition<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>;
64
+ export {};
65
+ //# sourceMappingURL=assertion-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-extension.d.ts","sourceRoot":"","sources":["../../../../source/assert/assertion-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACnC,KAAK,oCAAoC,EAC5C,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACR,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACR,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EAC3B,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAErB,MAAM,yCAAyC,CAAC;AAEjD,KAAK,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AAU,EAAE,SAAS,KAAK,MAAM,IAAI,QAAQ,CAAC;CACtF,CAAC;AAuCF,wBAAgB,2BAA2B,CAAC,MAAM,SAAS,eAAe,EACtE,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,QAAQ,EAAE,wBAAwB,GACnC,qBAAqB,CAAC,MAAM,CAAC,CA0P/B;AAED,wBAAgB,wBAAwB,CACpC,SAAS,SAAS,SAAS,OAAO,EAAE,EACpC,MAAM,SAAS,8BAA8B,EAC/C,UAAU,EAAE,4BAA4B,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,2BAA2B,CAAC,SAAS,EAAE,MAAM,CAAC,CAY7G;AAED,wBAAgB,iCAAiC,CAC7C,MAAM,EACN,QAAQ,SAAS,MAAM,EACvB,SAAS,SAAS,SAAS,OAAO,EAAE,EAEpC,UAAU,EAAE,qCAAqC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,GAC/E,oCAAoC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAOnE"}
@@ -0,0 +1,250 @@
1
+ import { createAssertionReferenceRecord, createCompositeAssertionGroup, isCompositeAssertionGroup } from "../assertion-protocol/assertion-reference.js";
2
+ import { createThrownErrorRecord } from "../assertion-protocol/thrown-error-record.js";
3
+ import { thrownMatcherChildren } from "../assertion-protocol/thrown-matcher.js";
4
+ function createForeignAssertionNode(input) {
5
+ return {
6
+ check: 'foreign',
7
+ label: input.label,
8
+ location: input.location,
9
+ message: input.message,
10
+ result: input.result,
11
+ source: input.source,
12
+ summary: input.result.passed
13
+ ? `Expected foreign assertion ${input.label} to pass.`
14
+ : `${input.label}: ${input.result.error.message}`
15
+ };
16
+ }
17
+ function assertNonEmptyItems(items, message) {
18
+ if (items.length === 0) {
19
+ throw new TypeError(message);
20
+ }
21
+ }
22
+ function flattenCompositeGroupItems(items) {
23
+ const children = items.flatMap(function toChildren(item) {
24
+ return isCompositeAssertionGroup(item) ? item.children : [item];
25
+ });
26
+ assertNonEmptyItems(children, 'Expected composite assertion group to contain children.');
27
+ return children;
28
+ }
29
+ export function createCompositeCheckBuilder(source, message, location) {
30
+ return {
31
+ annotated(childMessage) {
32
+ return createCompositeCheckBuilder(source, childMessage, location);
33
+ },
34
+ array(actual) {
35
+ return { actual, check: 'array', location, message, source };
36
+ },
37
+ arrayContainsPartial(actual, expected) {
38
+ return { actual, check: 'array-contains-partial', expected, location, message, source };
39
+ },
40
+ between(actual, minimum, maximum) {
41
+ return { actual, check: 'between', location, maximum, message, minimum, source };
42
+ },
43
+ boolean(actual) {
44
+ return { actual, check: 'boolean', location, message, source };
45
+ },
46
+ deepEqual(actual, expected) {
47
+ return { actual, check: 'deep-equal', expected, location, message, source };
48
+ },
49
+ defined(actual) {
50
+ return { actual, check: 'defined', location, message, source };
51
+ },
52
+ empty(actual) {
53
+ return { actual, check: 'empty', location, message, source };
54
+ },
55
+ endsWith(actual, expected) {
56
+ return { actual, check: 'ends-with', expected, location, message, source };
57
+ },
58
+ equal(actual, expected) {
59
+ return { actual, check: 'equal', expected, location, message, source };
60
+ },
61
+ fail() {
62
+ return { check: 'fail', location, message, source };
63
+ },
64
+ false(actual) {
65
+ return { actual, check: 'false', location, message, source };
66
+ },
67
+ async fromRejectable(label, body) {
68
+ try {
69
+ await body();
70
+ return createForeignAssertionNode({
71
+ label,
72
+ location,
73
+ message,
74
+ result: { passed: true },
75
+ source
76
+ });
77
+ }
78
+ catch (error) {
79
+ return createForeignAssertionNode({
80
+ label,
81
+ location,
82
+ message,
83
+ result: {
84
+ error: createThrownErrorRecord(error),
85
+ passed: false
86
+ },
87
+ source
88
+ });
89
+ }
90
+ },
91
+ fromThrowable(label, body) {
92
+ try {
93
+ body();
94
+ return createForeignAssertionNode({
95
+ label,
96
+ location,
97
+ message,
98
+ result: { passed: true },
99
+ source
100
+ });
101
+ }
102
+ catch (error) {
103
+ return createForeignAssertionNode({
104
+ label,
105
+ location,
106
+ message,
107
+ result: {
108
+ error: createThrownErrorRecord(error),
109
+ passed: false
110
+ },
111
+ source
112
+ });
113
+ }
114
+ },
115
+ function(actual) {
116
+ return { actual, check: 'function', location, message, source };
117
+ },
118
+ greaterThan(actual, expected) {
119
+ return { actual, check: 'greater-than', expected, location, message, source };
120
+ },
121
+ greaterThanOrEqual(actual, expected) {
122
+ return { actual, check: 'greater-than-or-equal', expected, location, message, source };
123
+ },
124
+ group(children) {
125
+ return createCompositeAssertionGroup(flattenCompositeGroupItems(children));
126
+ },
127
+ hasProperty(actual, key) {
128
+ return { actual, check: 'has-property', key, location, message, source };
129
+ },
130
+ includes(actual, expected) {
131
+ return { actual, check: 'includes', expected, location, message, source };
132
+ },
133
+ instanceOf(actual, expected) {
134
+ return { actual, check: 'instance-of', expected, location, message, source };
135
+ },
136
+ length(actual, expectedLength) {
137
+ return { actual, check: 'length', expectedLength, location, message, source };
138
+ },
139
+ lessThan(actual, expected) {
140
+ return { actual, check: 'less-than', expected, location, message, source };
141
+ },
142
+ lessThanOrEqual(actual, expected) {
143
+ return { actual, check: 'less-than-or-equal', expected, location, message, source };
144
+ },
145
+ match(actual, pattern) {
146
+ return { actual, check: 'match', location, message, pattern, source };
147
+ },
148
+ membersPartialDeepEqual(actual, expected) {
149
+ return { actual, check: 'members-partial-deep-equal', expected, location, message, source };
150
+ },
151
+ notDeepEqual(actual, expected) {
152
+ return { actual, check: 'not-deep-equal', expected, location, message, source };
153
+ },
154
+ notEmpty(actual) {
155
+ return { actual, check: 'not-empty', location, message, source };
156
+ },
157
+ notEqual(actual, expected) {
158
+ return { actual, check: 'not-equal', expected, location, message, source };
159
+ },
160
+ notMatch(actual, pattern) {
161
+ return { actual, check: 'not-match', location, message, pattern, source };
162
+ },
163
+ notNull(actual) {
164
+ return { actual, check: 'not-null', location, message, source };
165
+ },
166
+ null(actual) {
167
+ return { actual, check: 'null', location, message, source };
168
+ },
169
+ number(actual) {
170
+ return { actual, check: 'number', location, message, source };
171
+ },
172
+ object(actual) {
173
+ return { actual, check: 'object', location, message, source };
174
+ },
175
+ partialDeepEqual(actual, expected) {
176
+ return { actual, check: 'partial-deep-equal', expected, location, message, source };
177
+ },
178
+ async rejects(thunk, matcher) {
179
+ const promise = thunk();
180
+ try {
181
+ const value = await promise;
182
+ return createCompositeAssertionGroup(thrownMatcherChildren({
183
+ kind: 'rejects',
184
+ location,
185
+ matcher,
186
+ message,
187
+ observation: { status: 'resolved', value },
188
+ source
189
+ }));
190
+ }
191
+ catch (error) {
192
+ return createCompositeAssertionGroup(thrownMatcherChildren({
193
+ kind: 'rejects',
194
+ location,
195
+ matcher,
196
+ message,
197
+ observation: { status: 'rejected', value: error },
198
+ source
199
+ }));
200
+ }
201
+ },
202
+ startsWith(actual, expected) {
203
+ return { actual, check: 'starts-with', expected, location, message, source };
204
+ },
205
+ string(actual) {
206
+ return { actual, check: 'string', location, message, source };
207
+ },
208
+ throws(body, matcher) {
209
+ try {
210
+ const value = body();
211
+ return createCompositeAssertionGroup(thrownMatcherChildren({
212
+ kind: 'throws',
213
+ location,
214
+ matcher,
215
+ message,
216
+ observation: { status: 'returned', value },
217
+ source
218
+ }));
219
+ }
220
+ catch (error) {
221
+ return createCompositeAssertionGroup(thrownMatcherChildren({
222
+ kind: 'throws',
223
+ location,
224
+ matcher,
225
+ message,
226
+ observation: { status: 'threw', value: error },
227
+ source
228
+ }));
229
+ }
230
+ },
231
+ true(actual) {
232
+ return { actual, check: 'true', location, message, source };
233
+ },
234
+ undefined(actual) {
235
+ return { actual, check: 'undefined', location, message, source };
236
+ }
237
+ };
238
+ }
239
+ export function defineCompositeAssertion(definition) {
240
+ return createAssertionReferenceRecord({
241
+ formatSummary: definition.formatSummary ?? null,
242
+ kind: 'composite',
243
+ name: definition.name,
244
+ run(input) {
245
+ return definition.assert(createCompositeCheckBuilder(input.source, input.message, input.location), ...input.parameters);
246
+ }
247
+ });
248
+ }
249
+
250
+ //# sourceMappingURL=assertion-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-extension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AO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAChE,CAAC;QAED,SAAS,CAAC,MAAM;YACZ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QACrE,CAAC;KACJ,CAAC;AACN;AAEA,MAAM,UAAU,wBAAwB,CAGtC,UAA2D;IACzD,OAAO,8BAA8B,CAAC;QAClC,aAAa,EAAE,UAAU,CAAC,aAAa,IAAI,IAAI;QAC/C,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,GAAG,CAAC,KAAK;YACL,OAAO,UAAU,CAAC,MAAM,CACpB,2BAA2B,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,EACxE,GAAG,KAAK,CAAC,UAAU,CACtB,CAAC;QACN,CAAC;KACJ,CAAC,CAAC;AACP"}
@@ -0,0 +1,13 @@
1
+ import { type ComparisonResult } from '../compare/comparison.ts';
2
+ import type { SerializedValue } from '../compare/serialized-value.ts';
3
+ import type { Diff, DiffPathSegment } from '../diff/diff-shape.ts';
4
+ export type AssertionOutcome = {
5
+ readonly actual: SerializedValue;
6
+ readonly diff: Diff | null;
7
+ readonly expected: SerializedValue;
8
+ readonly passed: boolean;
9
+ readonly path: readonly DiffPathSegment[];
10
+ };
11
+ export declare const assertionOutcome: (actual: unknown, expected: unknown, passed: boolean) => AssertionOutcome;
12
+ export declare function comparisonOutcome(comparison: ComparisonResult): AssertionOutcome;
13
+ //# sourceMappingURL=assertion-evaluation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-evaluation.d.ts","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-evaluation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,0BAA0B,CAAC;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,KAAK,gBACnE,CAAC;AAEtB,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,CAEhF"}
@@ -0,0 +1,71 @@
1
+ import type { SerializedValue } from '../compare/serialized-value.ts';
2
+ import type { Diff, DiffPathSegment } from '../diff/diff-shape.ts';
3
+ import type { ThrownErrorRecord } from './thrown-error-record.ts';
4
+ export declare const assertionSources: readonly ["assert", "require"];
5
+ export type NonEmptyReadonlyArray<Item> = readonly [Item, ...(readonly Item[])];
6
+ export type AssertionSource = (typeof assertionSources)[number];
7
+ type PrimitiveValueByType = {
8
+ readonly bigint: bigint;
9
+ readonly boolean: boolean;
10
+ readonly null: null;
11
+ readonly number: number;
12
+ readonly string: string;
13
+ readonly symbol: symbol;
14
+ readonly undefined: undefined;
15
+ };
16
+ type PrimitiveValue = PrimitiveValueByType[keyof PrimitiveValueByType];
17
+ type IsAny<Value> = 0 extends Value & 1 ? true : false;
18
+ type DeepComparableKnownValue<Value> = [Extract<Value, PrimitiveValue>] extends [never] ? Value : never;
19
+ type DeepComparableUnknownValue<Value> = unknown extends Value ? unknown : DeepComparableKnownValue<Value>;
20
+ export type DeepComparable<Value = unknown> = IsAny<Value> extends true ? never : DeepComparableUnknownValue<Value>;
21
+ export type AssertionOptions = {
22
+ readonly message: string;
23
+ };
24
+ export type SourceLocation = {
25
+ readonly column: number | null;
26
+ readonly file: string;
27
+ readonly line: number | null;
28
+ };
29
+ export type SourceLocationProvider = () => SourceLocation;
30
+ export type ResolvableSourceLocation = SourceLocation | SourceLocationProvider;
31
+ type FailedCheckBase = {
32
+ readonly actual: SerializedValue;
33
+ readonly diff: Diff | null;
34
+ readonly expected: SerializedValue;
35
+ readonly id: string;
36
+ readonly location: SourceLocation;
37
+ readonly path: readonly DiffPathSegment[];
38
+ readonly source: AssertionSource;
39
+ readonly summary: string;
40
+ };
41
+ export type FailedLeafCheck = FailedCheckBase & {
42
+ readonly kind: 'leaf';
43
+ };
44
+ export type FailedCompositeCheck = FailedCheckBase & {
45
+ readonly children: NonEmptyReadonlyArray<FailedCheck>;
46
+ readonly kind: 'composite';
47
+ };
48
+ export type FailedForeignCheck = FailedCheckBase & {
49
+ readonly error: ThrownErrorRecord;
50
+ readonly kind: 'foreign';
51
+ readonly label: string;
52
+ };
53
+ export type FailedCheck = FailedCompositeCheck | FailedForeignCheck | FailedLeafCheck;
54
+ export type InstanceConstructor = abstract new (...args: never[]) => unknown;
55
+ export type ActualAssertionNode<Source extends AssertionSource, Check extends string> = {
56
+ readonly actual: unknown;
57
+ readonly check: Check;
58
+ readonly location: ResolvableSourceLocation;
59
+ readonly message: string | null;
60
+ readonly source: Source;
61
+ };
62
+ export type ExpectedAssertionNode<Source extends AssertionSource, Check extends string> = {
63
+ readonly actual: unknown;
64
+ readonly check: Check;
65
+ readonly expected: unknown;
66
+ readonly location: ResolvableSourceLocation;
67
+ readonly message: string | null;
68
+ readonly source: Source;
69
+ };
70
+ export {};
71
+ //# sourceMappingURL=assertion-node-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-node-shape.d.ts","sourceRoot":"","sources":["../../../../source/assertion-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G,eAAe,GAAG;IAC/C,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEtF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC;AAE7E,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,eAAe,EAAE,KAAK,SAAS,MAAM,IAAI;IACpF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,MAAM,SAAS,eAAe,EAAE,KAAK,SAAS,MAAM,IAAI;IACtF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,97 @@
1
+ import { type FalseAssertionNode, type TrueAssertionNode } from './assertions/boolean.ts';
2
+ import { type EmptinessAssertionNode, type LengthAssertionNode } from './assertions/collection.ts';
3
+ import { type DeepEqualAssertionNode, type EqualAssertionNode, type NotDeepEqualAssertionNode, type NotEqualAssertionNode } from './assertions/equality.ts';
4
+ import { type FailAssertionNode } from './assertions/fail.ts';
5
+ import { type BetweenAssertionNode, type NumericComparisonAssertionNode } from './assertions/numeric.ts';
6
+ import { type ArrayContainsPartialAssertionNode, type MembersPartialDeepEqualAssertionNode, type PartialDeepEqualAssertionNode } from './assertions/partial.ts';
7
+ import { type DefinedAssertionNode, type NotNullAssertionNode, type NullAssertionNode, type UndefinedAssertionNode } from './assertions/presence.ts';
8
+ import { type MatchAssertionNode, type StringContainsAssertionNode } from './assertions/string.ts';
9
+ import { type HasPropertyAssertionNode, type InstanceOfAssertionNode, type TypeAssertionNode } from './assertions/type-shape.ts';
10
+ import type { AssertionSource, NonEmptyReadonlyArray, ResolvableSourceLocation } from './assertion-node-shape.ts';
11
+ type ForeignAssertionErrorRecord = {
12
+ readonly message: string;
13
+ readonly name: string;
14
+ readonly stack: string | null;
15
+ readonly thrown: unknown;
16
+ };
17
+ type RequireAssertionNodeByName = {
18
+ readonly defined: DefinedAssertionNode<'require'>;
19
+ readonly hasProperty: HasPropertyAssertionNode<'require'>;
20
+ readonly instanceOf: InstanceOfAssertionNode<'require'>;
21
+ readonly notNull: NotNullAssertionNode<'require'>;
22
+ readonly null: NullAssertionNode<'require'>;
23
+ readonly type: TypeAssertionNode<'require'>;
24
+ };
25
+ type BuiltInAssertAssertionNodeByName<Source extends AssertionSource> = {
26
+ readonly arrayContainsPartial: ArrayContainsPartialAssertionNode<Source>;
27
+ readonly between: BetweenAssertionNode<Source>;
28
+ readonly deepEqual: DeepEqualAssertionNode<Source>;
29
+ readonly defined: DefinedAssertionNode<Source>;
30
+ readonly emptiness: EmptinessAssertionNode<Source>;
31
+ readonly equal: EqualAssertionNode<Source>;
32
+ readonly fail: FailAssertionNode<Source>;
33
+ readonly false: FalseAssertionNode<Source>;
34
+ readonly hasProperty: HasPropertyNode<Source>;
35
+ readonly instanceOf: InstanceOfAssertionNode<Source>;
36
+ readonly length: LengthAssertionNode<Source>;
37
+ readonly match: MatchAssertionNode<Source>;
38
+ readonly membersPartialDeepEqual: MembersPartialDeepEqualAssertionNode<Source>;
39
+ readonly notDeepEqual: NotDeepEqualAssertionNode<Source>;
40
+ readonly notEqual: NotEqualAssertionNode<Source>;
41
+ readonly notNull: NotNullAssertionNode<Source>;
42
+ readonly null: NullAssertionNode<Source>;
43
+ readonly numericComparison: NumericComparisonAssertionNode<Source>;
44
+ readonly partialDeepEqual: PartialDeepEqualAssertionNode<Source>;
45
+ readonly stringContains: StringContainsAssertionNode<Source>;
46
+ readonly true: TrueAssertionNode<Source>;
47
+ readonly type: TypeAssertionNode<Source>;
48
+ readonly undefined: UndefinedAssertionNode<Source>;
49
+ };
50
+ type HasPropertyNode<Source extends AssertionSource> = HasPropertyAssertionNode<Source>;
51
+ export type BuiltInAssertAssertionNode<Source extends AssertionSource = 'assert'> = BuiltInAssertAssertionNodeByName<Source>[keyof BuiltInAssertAssertionNodeByName<Source>];
52
+ type ForeignAssertionResultByOutcome = {
53
+ readonly fail: {
54
+ readonly error: ForeignAssertionErrorRecord;
55
+ readonly passed: false;
56
+ };
57
+ readonly pass: {
58
+ readonly passed: true;
59
+ };
60
+ };
61
+ export type ForeignAssertionResult = ForeignAssertionResultByOutcome[keyof ForeignAssertionResultByOutcome];
62
+ export type ForeignAssertionNode<Source extends AssertionSource = AssertionSource> = {
63
+ readonly check: 'foreign';
64
+ readonly label: string;
65
+ readonly location: ResolvableSourceLocation;
66
+ readonly message: string | null;
67
+ readonly result: ForeignAssertionResult;
68
+ readonly source: Source;
69
+ readonly summary: string;
70
+ };
71
+ type CompositeAssertionChildNodeByKind<Source extends AssertionSource> = {
72
+ readonly builtIn: BuiltInAssertAssertionNode<Source>;
73
+ readonly foreign: ForeignAssertionNode<Source>;
74
+ };
75
+ export type CompositeAssertionChildNode<Source extends AssertionSource = AssertionSource> = CompositeAssertionChildNodeByKind<Source>[keyof CompositeAssertionChildNodeByKind<Source>];
76
+ export type CompositeAssertionNode<Source extends AssertionSource = AssertionSource> = {
77
+ readonly actual: unknown;
78
+ readonly check: 'composite';
79
+ readonly children: NonEmptyReadonlyArray<CompositeAssertionChildNode<Source>>;
80
+ readonly expected: unknown;
81
+ readonly location: ResolvableSourceLocation;
82
+ readonly message: string | null;
83
+ readonly name: string;
84
+ readonly source: Source;
85
+ readonly summary: string;
86
+ };
87
+ type RequireAssertionNodeByKind = RequireAssertionNodeByName & {
88
+ readonly composite: CompositeAssertionNode<'require'>;
89
+ };
90
+ export type RequireAssertionNode = RequireAssertionNodeByKind[keyof RequireAssertionNodeByKind];
91
+ export type AssertAssertionNode = BuiltInAssertAssertionNode | CompositeAssertionNode<'assert'>;
92
+ export type AssertionNode = AssertAssertionNode | RequireAssertionNode;
93
+ export type AssertionResult = AssertAssertionNode | NonEmptyReadonlyArray<AssertAssertionNode>;
94
+ type SummarizedAssertionNode = AssertionNode | CompositeAssertionChildNode | CompositeAssertionNode;
95
+ export declare function assertionSummary(assertion: SummarizedAssertionNode): string;
96
+ export {};
97
+ //# sourceMappingURL=assertion-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-node.d.ts","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjH,OAAO,EAEH,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEH,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EACzC,KAAK,6BAA6B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