@overkill-dev/engine 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/assertion-protocol/assertion-evaluation.d.ts +13 -0
- package/assertion-protocol/assertion-evaluation.d.ts.map +1 -0
- package/assertion-protocol/assertion-evaluation.js +6 -0
- package/assertion-protocol/assertion-evaluation.js.map +1 -0
- package/assertion-protocol/assertion-node-shape.d.ts +71 -0
- package/assertion-protocol/assertion-node-shape.d.ts.map +1 -0
- package/assertion-protocol/assertion-node.d.ts +97 -0
- package/assertion-protocol/assertion-node.d.ts.map +1 -0
- package/assertion-protocol/assertion-node.js +33 -0
- package/assertion-protocol/assertion-node.js.map +1 -0
- package/assertion-protocol/assertion-reference.d.ts +73 -0
- package/assertion-protocol/assertion-reference.d.ts.map +1 -0
- package/assertion-protocol/assertion-reference.js +49 -0
- package/assertion-protocol/assertion-reference.js.map +1 -0
- package/assertion-protocol/assertions/boolean.d.ts +11 -0
- package/assertion-protocol/assertions/boolean.d.ts.map +1 -0
- package/assertion-protocol/assertions/boolean.js +12 -0
- package/assertion-protocol/assertions/boolean.js.map +1 -0
- package/assertion-protocol/assertions/collection.d.ts +22 -0
- package/assertion-protocol/assertions/collection.d.ts.map +1 -0
- package/assertion-protocol/assertions/collection.js +21 -0
- package/assertion-protocol/assertions/collection.js.map +1 -0
- package/assertion-protocol/assertions/dispatch.d.ts +88 -0
- package/assertion-protocol/assertions/dispatch.d.ts.map +1 -0
- package/assertion-protocol/assertions/dispatch.js +47 -0
- package/assertion-protocol/assertions/dispatch.js.map +1 -0
- package/assertion-protocol/assertions/equality.d.ts +17 -0
- package/assertion-protocol/assertions/equality.d.ts.map +1 -0
- package/assertion-protocol/assertions/equality.js +24 -0
- package/assertion-protocol/assertions/equality.js.map +1 -0
- package/assertion-protocol/assertions/fail.d.ts +13 -0
- package/assertion-protocol/assertions/fail.d.ts.map +1 -0
- package/assertion-protocol/assertions/fail.js +8 -0
- package/assertion-protocol/assertions/fail.js.map +1 -0
- package/assertion-protocol/assertions/numeric.d.ts +29 -0
- package/assertion-protocol/assertions/numeric.d.ts.map +1 -0
- package/assertion-protocol/assertions/numeric.js +43 -0
- package/assertion-protocol/assertions/numeric.js.map +1 -0
- package/assertion-protocol/assertions/partial.d.ts +14 -0
- package/assertion-protocol/assertions/partial.d.ts.map +1 -0
- package/assertion-protocol/assertions/partial.js +17 -0
- package/assertion-protocol/assertions/partial.js.map +1 -0
- package/assertion-protocol/assertions/presence.d.ts +17 -0
- package/assertion-protocol/assertions/presence.d.ts.map +1 -0
- package/assertion-protocol/assertions/presence.js +20 -0
- package/assertion-protocol/assertions/presence.js.map +1 -0
- package/assertion-protocol/assertions/string.d.ts +28 -0
- package/assertion-protocol/assertions/string.d.ts.map +1 -0
- package/assertion-protocol/assertions/string.js +33 -0
- package/assertion-protocol/assertions/string.js.map +1 -0
- package/assertion-protocol/assertions/type-shape.d.ts +42 -0
- package/assertion-protocol/assertions/type-shape.d.ts.map +1 -0
- package/assertion-protocol/assertions/type-shape.js +43 -0
- package/assertion-protocol/assertions/type-shape.js.map +1 -0
- package/assertion-protocol/collection-count.d.ts +6 -0
- package/assertion-protocol/collection-count.d.ts.map +1 -0
- package/assertion-protocol/collection-count.js +42 -0
- package/assertion-protocol/collection-count.js.map +1 -0
- package/assertion-protocol/evaluation.d.ts +32 -0
- package/assertion-protocol/evaluation.d.ts.map +1 -0
- package/assertion-protocol/evaluation.js +170 -0
- package/assertion-protocol/evaluation.js.map +1 -0
- package/assertion-protocol/partial-matching.d.ts +4 -0
- package/assertion-protocol/partial-matching.d.ts.map +1 -0
- package/assertion-protocol/partial-matching.js +13 -0
- package/assertion-protocol/partial-matching.js.map +1 -0
- package/assertion-protocol/source-location.d.ts +6 -0
- package/assertion-protocol/source-location.d.ts.map +1 -0
- package/assertion-protocol/source-location.js +76 -0
- package/assertion-protocol/source-location.js.map +1 -0
- package/assertion-protocol/thrown-error-record.d.ts +8 -0
- package/assertion-protocol/thrown-error-record.d.ts.map +1 -0
- package/assertion-protocol/thrown-error-record.js +17 -0
- package/assertion-protocol/thrown-error-record.js.map +1 -0
- package/assertion-protocol/thrown-matcher.d.ts +51 -0
- package/assertion-protocol/thrown-matcher.d.ts.map +1 -0
- package/assertion-protocol/thrown-matcher.js +201 -0
- package/assertion-protocol/thrown-matcher.js.map +1 -0
- package/compare/comparison-result.d.ts +25 -0
- package/compare/comparison-result.d.ts.map +1 -0
- package/compare/comparison-result.js +47 -0
- package/compare/comparison-result.js.map +1 -0
- package/compare/comparison-state.d.ts +7 -0
- package/compare/comparison-state.d.ts.map +1 -0
- package/compare/comparison-state.js +20 -0
- package/compare/comparison-state.js.map +1 -0
- package/compare/comparison.d.ts +12 -0
- package/compare/comparison.d.ts.map +1 -0
- package/compare/comparison.js +78 -0
- package/compare/comparison.js.map +1 -0
- package/compare/diff-path.d.ts +8 -0
- package/compare/diff-path.d.ts.map +1 -0
- package/compare/diff-path.js +37 -0
- package/compare/diff-path.js.map +1 -0
- package/compare/raw-comparison.d.ts +24 -0
- package/compare/raw-comparison.d.ts.map +1 -0
- package/compare/raw-comparison.js +285 -0
- package/compare/raw-comparison.js.map +1 -0
- package/compare/serialized-value-classification.d.ts +12 -0
- package/compare/serialized-value-classification.d.ts.map +1 -0
- package/compare/serialized-value-classification.js +99 -0
- package/compare/serialized-value-classification.js.map +1 -0
- package/compare/serialized-value-shape.d.ts +143 -0
- package/compare/serialized-value-shape.d.ts.map +1 -0
- package/compare/serialized-value-shape.js +12 -0
- package/compare/serialized-value-shape.js.map +1 -0
- package/compare/serialized-value-state.d.ts +12 -0
- package/compare/serialized-value-state.d.ts.map +1 -0
- package/compare/serialized-value-state.js +55 -0
- package/compare/serialized-value-state.js.map +1 -0
- package/compare/serialized-value.d.ts +11 -0
- package/compare/serialized-value.d.ts.map +1 -0
- package/compare/serialized-value.js +389 -0
- package/compare/serialized-value.js.map +1 -0
- package/compare/structured-diff.d.ts +4 -0
- package/compare/structured-diff.d.ts.map +1 -0
- package/compare/structured-diff.js +382 -0
- package/compare/structured-diff.js.map +1 -0
- package/compare/value-classification.d.ts +26 -0
- package/compare/value-classification.d.ts.map +1 -0
- package/compare/value-classification.js +112 -0
- package/compare/value-classification.js.map +1 -0
- package/diff/binary-diff.d.ts +4 -0
- package/diff/binary-diff.d.ts.map +1 -0
- package/diff/binary-diff.js +49 -0
- package/diff/binary-diff.js.map +1 -0
- package/diff/diff-shape.d.ts +117 -0
- package/diff/diff-shape.d.ts.map +1 -0
- package/diff/string-diff.d.ts +3 -0
- package/diff/string-diff.d.ts.map +1 -0
- package/diff/string-diff.js +22 -0
- package/diff/string-diff.js.map +1 -0
- package/engine/assertion-facade.d.ts +50 -0
- package/engine/assertion-facade.d.ts.map +1 -0
- package/engine/assertion-facade.js +361 -0
- package/engine/assertion-facade.js.map +1 -0
- package/engine/case-execution.d.ts +10 -0
- package/engine/case-execution.d.ts.map +1 -0
- package/engine/case-execution.js +408 -0
- package/engine/case-execution.js.map +1 -0
- package/engine/custom-assertion-recording.d.ts +33 -0
- package/engine/custom-assertion-recording.d.ts.map +1 -0
- package/engine/custom-assertion-recording.js +175 -0
- package/engine/custom-assertion-recording.js.map +1 -0
- package/engine/engine.d.ts +24 -0
- package/engine/engine.d.ts.map +1 -0
- package/engine/engine.js +33 -0
- package/engine/engine.js.map +1 -0
- package/engine/execution.d.ts +16 -0
- package/engine/execution.d.ts.map +1 -0
- package/engine/execution.js +223 -0
- package/engine/execution.js.map +1 -0
- package/engine/identity.d.ts +12 -0
- package/engine/identity.d.ts.map +1 -0
- package/engine/identity.js +20 -0
- package/engine/identity.js.map +1 -0
- package/engine/reporter.d.ts +103 -0
- package/engine/reporter.d.ts.map +1 -0
- package/engine/reporter.js +177 -0
- package/engine/reporter.js.map +1 -0
- package/engine/require-assertion-facade.d.ts +21 -0
- package/engine/require-assertion-facade.d.ts.map +1 -0
- package/engine/require-assertion-facade.js +127 -0
- package/engine/require-assertion-facade.js.map +1 -0
- package/engine/run-if-main.d.ts +20 -0
- package/engine/run-if-main.d.ts.map +1 -0
- package/engine/run-if-main.js +30 -0
- package/engine/run-if-main.js.map +1 -0
- package/engine/run-result.d.ts +110 -0
- package/engine/run-result.d.ts.map +1 -0
- package/engine/run-result.js +13 -0
- package/engine/run-result.js.map +1 -0
- package/engine/test-node.d.ts +88 -0
- package/engine/test-node.d.ts.map +1 -0
- package/engine/test-node.js +103 -0
- package/engine/test-node.js.map +1 -0
- package/engine/test-plan.d.ts +20 -0
- package/engine/test-plan.d.ts.map +1 -0
- package/engine/test-plan.js +115 -0
- package/engine/test-plan.js.map +1 -0
- package/package.json +78 -6
- package/packages/engine/assertion-protocol.entry-point.d.ts +9 -0
- package/packages/engine/assertion-protocol.entry-point.d.ts.map +1 -0
- package/packages/engine/assertion-protocol.entry-point.js +4 -0
- package/packages/engine/assertion-protocol.entry-point.js.map +1 -0
- package/packages/engine/engine.entry-point.d.ts +39 -0
- package/packages/engine/engine.entry-point.d.ts.map +1 -0
- package/packages/engine/engine.entry-point.js +47 -0
- package/packages/engine/engine.entry-point.js.map +1 -0
- package/readme.md +121 -5
- package/sbom.cdx.json +67 -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,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 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-evaluation.js","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-evaluation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAYpF,MAAM,CAAC,MAAM,gBAAgB,GACzB,iBAAiB,CAAC;AAEtB,MAAM,UAAU,iBAAiB,CAAC,UAA4B;IAC1D,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
|
@@ -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-protocol/assertion-node-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,gBAAgB,gCAAmC,CAAC;AAEjE,MAAM,MAAM,qBAAqB,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC;AAEhF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,KAAK,oBAAoB,GAAG;IACxB,QAAQ,CAAC,MAAM,EAAE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AAQ,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,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AC;AAEhG,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;AAc/F,KAAK,uBAAuB,GAAG,aAAa,GAAG,2BAA2B,GAAG,sBAAsB,CAAC;AAQpG,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,uBAAuB,GAAG,MAAM,CAU3E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { booleanSummaryByCheck } from "./assertions/boolean.js";
|
|
2
|
+
import { collectionSummaryByCheck } from "./assertions/collection.js";
|
|
3
|
+
import { equalitySummaryByCheck } from "./assertions/equality.js";
|
|
4
|
+
import { failSummaryByCheck } from "./assertions/fail.js";
|
|
5
|
+
import { numericSummaryByCheck } from "./assertions/numeric.js";
|
|
6
|
+
import { partialSummaryByCheck } from "./assertions/partial.js";
|
|
7
|
+
import { presenceSummaryByCheck } from "./assertions/presence.js";
|
|
8
|
+
import { stringSummaryByCheck } from "./assertions/string.js";
|
|
9
|
+
import { typeShapeSummaryByCheck } from "./assertions/type-shape.js";
|
|
10
|
+
const defaultSummaryByCheck = {
|
|
11
|
+
...booleanSummaryByCheck,
|
|
12
|
+
...collectionSummaryByCheck,
|
|
13
|
+
...equalitySummaryByCheck,
|
|
14
|
+
...failSummaryByCheck,
|
|
15
|
+
...numericSummaryByCheck,
|
|
16
|
+
...partialSummaryByCheck,
|
|
17
|
+
...presenceSummaryByCheck,
|
|
18
|
+
...stringSummaryByCheck,
|
|
19
|
+
...typeShapeSummaryByCheck
|
|
20
|
+
};
|
|
21
|
+
function isCompositeAssertion(assertion) {
|
|
22
|
+
return assertion.check === 'composite';
|
|
23
|
+
}
|
|
24
|
+
export function assertionSummary(assertion) {
|
|
25
|
+
if (isCompositeAssertion(assertion)) {
|
|
26
|
+
return assertion.message ?? assertion.summary;
|
|
27
|
+
}
|
|
28
|
+
if (assertion.check === 'foreign') {
|
|
29
|
+
return assertion.message ?? assertion.summary;
|
|
30
|
+
}
|
|
31
|
+
return assertion.message ?? defaultSummaryByCheck[assertion.check];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=assertion-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-node.js","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAmD,MAAM,yBAAyB,CAAC;AACjH,OAAO,EACH,wBAAwB,EAG3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,sBAAsB,EAKzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAA0B,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACH,qBAAqB,EAGxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,qBAAqB,EAIxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,sBAAsB,EAKzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,oBAAoB,EAGvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,uBAAuB,EAI1B,MAAM,4BAA4B,CAAC;AA6GpC,MAAM,qBAAqB,GAAkE;IACzF,GAAG,qBAAqB;IACxB,GAAG,wBAAwB;IAC3B,GAAG,sBAAsB;IACzB,GAAG,kBAAkB;IACrB,GAAG,qBAAqB;IACxB,GAAG,qBAAqB;IACxB,GAAG,sBAAsB;IACzB,GAAG,oBAAoB;IACvB,GAAG,uBAAuB;CAC7B,CAAC;AAIF,SAAS,oBAAoB,CACzB,SAAkC;IAElC,OAAO,SAAS,CAAC,KAAK,KAAK,WAAW,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,SAAkC;IAC/D,IAAI,oBAAoB,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC;IAClD,CAAC;IAED,IAAI,SAAS,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC;IAClD,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,IAAI,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { CompositeAssertionChildNode } from './assertion-node.ts';
|
|
2
|
+
import type { AssertionSource, NonEmptyReadonlyArray, ResolvableSourceLocation } from './assertion-node-shape.ts';
|
|
3
|
+
declare const assertionReferenceIdentity: unique symbol;
|
|
4
|
+
declare const assertionReferenceRecordIdentity: unique symbol;
|
|
5
|
+
declare const compositeGroupIdentity: unique symbol;
|
|
6
|
+
export type CompositeAssertionSummaryContext = {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly source: AssertionSource;
|
|
9
|
+
};
|
|
10
|
+
export type CompositeAssertionGroup<Source extends AssertionSource = AssertionSource> = {
|
|
11
|
+
readonly [compositeGroupIdentity]: true;
|
|
12
|
+
readonly children: NonEmptyReadonlyArray<CompositeAssertionChildNode<Source>>;
|
|
13
|
+
};
|
|
14
|
+
type CompositeAssertionReturnByKind<Source extends AssertionSource> = {
|
|
15
|
+
readonly child: CompositeAssertionChildNode<Source>;
|
|
16
|
+
readonly group: CompositeAssertionGroup<Source>;
|
|
17
|
+
};
|
|
18
|
+
export type CompositeAssertionReturn<Source extends AssertionSource = AssertionSource> = CompositeAssertionReturnByKind<Source>[keyof CompositeAssertionReturnByKind<Source>];
|
|
19
|
+
type PromiseCompositeAssertionReturn = Promise<CompositeAssertionReturn<'assert'>>;
|
|
20
|
+
export type AssertCompositeAssertionReturn = CompositeAssertionReturn<'assert'> | PromiseCompositeAssertionReturn;
|
|
21
|
+
type SyncAssertionReturn = ReturnType<() => void>;
|
|
22
|
+
export type CompositeAssertionSummaryFormatter<Arguments extends readonly unknown[]> = (context: CompositeAssertionSummaryContext, ...parameters: Arguments) => string;
|
|
23
|
+
export type NarrowingCompositeAssertionSummaryFormatter<Actual, Arguments extends readonly unknown[]> = (context: CompositeAssertionSummaryContext, actual: Actual, ...parameters: Arguments) => string;
|
|
24
|
+
export type CompositeAssertionRunnerInput<Arguments extends readonly unknown[], Source extends AssertionSource> = {
|
|
25
|
+
readonly location: ResolvableSourceLocation;
|
|
26
|
+
readonly message: string | null;
|
|
27
|
+
readonly parameters: Arguments;
|
|
28
|
+
readonly source: Source;
|
|
29
|
+
};
|
|
30
|
+
export type CompositeAssertionReferenceRecord<Arguments extends readonly unknown[] = readonly unknown[], Result extends AssertCompositeAssertionReturn = AssertCompositeAssertionReturn> = {
|
|
31
|
+
readonly formatSummary: CompositeAssertionSummaryFormatter<Arguments> | null;
|
|
32
|
+
readonly kind: 'composite';
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly run: (input: CompositeAssertionRunnerInput<Arguments, 'assert'>) => Result;
|
|
35
|
+
};
|
|
36
|
+
export type NarrowingCompositeAssertionReferenceRecord<Actual = unknown, Narrowed extends Actual = Actual, Arguments extends readonly unknown[] = readonly unknown[]> = {
|
|
37
|
+
readonly formatSummary: NarrowingCompositeAssertionSummaryFormatter<Actual, Arguments> | null;
|
|
38
|
+
readonly kind: 'narrowing-composite';
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly narrows: (actual: Actual, ...parameters: Arguments) => actual is Narrowed;
|
|
41
|
+
};
|
|
42
|
+
export type AssertionReferenceRecord = CompositeAssertionReferenceRecord | NarrowingCompositeAssertionReferenceRecord;
|
|
43
|
+
export type CompositeAssertionReference<Arguments extends readonly unknown[] = readonly unknown[], Result extends AssertCompositeAssertionReturn = AssertCompositeAssertionReturn> = {
|
|
44
|
+
readonly [assertionReferenceIdentity]: true;
|
|
45
|
+
readonly [assertionReferenceRecordIdentity]: CompositeAssertionReferenceRecord<Arguments, Result>;
|
|
46
|
+
};
|
|
47
|
+
export type NarrowingCompositeAssertionReference<Actual = unknown, Narrowed extends Actual = Actual, Arguments extends readonly unknown[] = readonly unknown[]> = {
|
|
48
|
+
readonly [assertionReferenceIdentity]: true;
|
|
49
|
+
readonly [assertionReferenceRecordIdentity]: NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>;
|
|
50
|
+
};
|
|
51
|
+
export type AssertionReference = CompositeAssertionReference | NarrowingCompositeAssertionReference;
|
|
52
|
+
type NarrowingReferenceArguments<Actual, Arguments extends readonly unknown[]> = readonly [
|
|
53
|
+
actual: Actual,
|
|
54
|
+
...parameters: Arguments
|
|
55
|
+
];
|
|
56
|
+
type ReferenceArguments<Reference> = Reference extends NarrowingCompositeAssertionReference<infer Actual, infer Narrowed, infer Arguments> ? NarrowingReferenceArguments<Actual | Narrowed, Arguments> : never;
|
|
57
|
+
type ReferenceReturn<Result> = Result extends Promise<CompositeAssertionReturn<'assert'>> ? Promise<void> : SyncAssertionReturn;
|
|
58
|
+
type ReadonlyParameters<Arguments extends readonly unknown[]> = readonly [...Arguments];
|
|
59
|
+
export type AssertReferenceArguments<Reference> = Reference extends CompositeAssertionReference<infer Arguments> ? ReadonlyParameters<Arguments> : ReferenceArguments<Reference>;
|
|
60
|
+
export type AssertReferenceReturn<Reference> = Reference extends CompositeAssertionReference<infer Arguments, infer Result> ? Arguments extends readonly unknown[] ? ReferenceReturn<Result> : never : SyncAssertionReturn;
|
|
61
|
+
export declare function createAssertionReferenceRecord<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(record: CompositeAssertionReferenceRecord<Arguments, Result>): CompositeAssertionReference<Arguments, Result>;
|
|
62
|
+
export declare function createAssertionReferenceRecord<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(record: NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>;
|
|
63
|
+
export declare function createCompositeAssertionReferenceRecord<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(record: CompositeAssertionReferenceRecord<Arguments, Result>): CompositeAssertionReference<Arguments, Result>;
|
|
64
|
+
export declare function createNarrowingCompositeAssertionReferenceRecord<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(record: NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>;
|
|
65
|
+
export declare function getAssertionReferenceRecord(reference: AssertionReference): AssertionReferenceRecord;
|
|
66
|
+
export declare function getCompositeAssertionReferenceRecord<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(reference: CompositeAssertionReference<Arguments, Result>): CompositeAssertionReferenceRecord<Arguments, Result>;
|
|
67
|
+
export declare function getNarrowingAssertionReferenceRecord<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(reference: NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>;
|
|
68
|
+
export declare function isAssertionReference(value: unknown): value is AssertionReference;
|
|
69
|
+
export declare function isNarrowingAssertionReference(value: unknown): value is NarrowingCompositeAssertionReference;
|
|
70
|
+
export declare function isCompositeAssertionGroup<Source extends AssertionSource>(value: unknown): value is CompositeAssertionGroup<Source>;
|
|
71
|
+
export declare function createCompositeAssertionGroup<Source extends AssertionSource>(children: NonEmptyReadonlyArray<CompositeAssertionChildNode<Source>>): CompositeAssertionGroup<Source>;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=assertion-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-reference.d.ts","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,2BAA2B,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACR,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EAC3B,MAAM,2BAA2B,CAAC;AAEnC,QAAA,MAAM,0BAA0B,EAAE,OAAO,MAAiD,CAAC;AA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,EAAE,EAEpC,MAAM,EAAE,0CAA0C,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,GAChF,oCAAoC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAEnE;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,kBAAkB,GAAG,wBAAwB,CAEnG;AAED,wBAAgB,oCAAoC,CAChD,SAAS,SAAS,SAAS,OAAO,EAAE,EACpC,MAAM,SAAS,8BAA8B,EAE7C,SAAS,EAAE,2BAA2B,CAAC,SAAS,EAAE,MAAM,CAAC,GAC1D,iCAAiC,CAAC,SAAS,EAAE,MAAM,CAAC,CAEtD;AAED,wBAAgB,oCAAoC,CAChD,MAAM,EACN,QAAQ,SAAS,MAAM,EACvB,SAAS,SAAS,SAAS,OAAO,EAAE,EAEpC,SAAS,EAAE,oCAAoC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,GAC7E,0CAA0C,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAEzE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oCAAoC,CAE3G;AAED,wBAAgB,yBAAyB,CAAC,MAAM,SAAS,eAAe,EACpE,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAE1C;AAED,wBAAgB,6BAA6B,CAAC,MAAM,SAAS,eAAe,EACxE,QAAQ,EAAE,qBAAqB,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,GACrE,uBAAuB,CAAC,MAAM,CAAC,CAEjC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const assertionReferenceIdentity = Symbol.for('OverkillAssertionReference');
|
|
2
|
+
const assertionReferenceRecordIdentity = Symbol.for('OverkillAssertionReferenceRecord');
|
|
3
|
+
const compositeGroupIdentity = Symbol.for('OverkillCompositeGroup');
|
|
4
|
+
function ensureAssertionName(name) {
|
|
5
|
+
if (name.trim().length === 0) {
|
|
6
|
+
throw new TypeError('Assertion reference name must not be empty.');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function createAssertionReferenceRecord(record) {
|
|
10
|
+
ensureAssertionName(record.name);
|
|
11
|
+
if (record.kind === 'composite') {
|
|
12
|
+
return {
|
|
13
|
+
[assertionReferenceIdentity]: true,
|
|
14
|
+
[assertionReferenceRecordIdentity]: record
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
[assertionReferenceIdentity]: true,
|
|
19
|
+
[assertionReferenceRecordIdentity]: record
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function createCompositeAssertionReferenceRecord(record) {
|
|
23
|
+
return createAssertionReferenceRecord({ ...record });
|
|
24
|
+
}
|
|
25
|
+
export function createNarrowingCompositeAssertionReferenceRecord(record) {
|
|
26
|
+
return createAssertionReferenceRecord({ ...record });
|
|
27
|
+
}
|
|
28
|
+
export function getAssertionReferenceRecord(reference) {
|
|
29
|
+
return reference[assertionReferenceRecordIdentity];
|
|
30
|
+
}
|
|
31
|
+
export function getCompositeAssertionReferenceRecord(reference) {
|
|
32
|
+
return reference[assertionReferenceRecordIdentity];
|
|
33
|
+
}
|
|
34
|
+
export function getNarrowingAssertionReferenceRecord(reference) {
|
|
35
|
+
return reference[assertionReferenceRecordIdentity];
|
|
36
|
+
}
|
|
37
|
+
export function isAssertionReference(value) {
|
|
38
|
+
return typeof value === 'object' && value !== null && Object.hasOwn(value, assertionReferenceIdentity);
|
|
39
|
+
}
|
|
40
|
+
export function isNarrowingAssertionReference(value) {
|
|
41
|
+
return isAssertionReference(value) && getAssertionReferenceRecord(value).kind === 'narrowing-composite';
|
|
42
|
+
}
|
|
43
|
+
export function isCompositeAssertionGroup(value) {
|
|
44
|
+
return typeof value === 'object' && value !== null && Object.hasOwn(value, compositeGroupIdentity);
|
|
45
|
+
}
|
|
46
|
+
export function createCompositeAssertionGroup(children) {
|
|
47
|
+
return { [compositeGroupIdentity]: true, children };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=assertion-reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-reference.js","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-reference.ts"],"names":[],"mappings":"AASA,MAAM,0BAA0B,GAAkB,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC3F,MAAM,gCAAgC,GAAkB,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AACvG,MAAM,sBAAsB,GAAkB,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAyHnF,SAAS,mBAAmB,CAAC,IAAY;IACrC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;IACvE,CAAC;AACL,CAAC;AAaD,MAAM,UAAU,8BAA8B,CAAC,MAAgC;IAC3E,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO;YACH,CAAC,0BAA0B,CAAC,EAAE,IAAI;YAClC,CAAC,gCAAgC,CAAC,EAAE,MAAM;SAC7C,CAAC;IACN,CAAC;IAED,OAAO;QACH,CAAC,0BAA0B,CAAC,EAAE,IAAI;QAClC,CAAC,gCAAgC,CAAC,EAAE,MAAM;KAC7C,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uCAAuC,CAGrD,MAA4D;IAC1D,OAAO,8BAA8B,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,gDAAgD,CAK5D,MAA+E;IAE/E,OAAO,8BAA8B,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,SAA6B;IACrE,OAAO,SAAS,CAAC,gCAAgC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,oCAAoC,CAIhD,SAAyD;IAEzD,OAAO,SAAS,CAAC,gCAAgC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,oCAAoC,CAKhD,SAA4E;IAE5E,OAAO,SAAS,CAAC,gCAAgC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;AAC3G,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,KAAc;IACxD,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,2BAA2B,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,qBAAqB,CAAC;AAC5G,CAAC;AAED,MAAM,UAAU,yBAAyB,CACrC,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;AACvG,CAAC;AAED,MAAM,UAAU,6BAA6B,CACzC,QAAoE;IAEpE,OAAO,EAAE,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { ActualAssertionNode, AssertionSource } from '../assertion-node-shape.ts';
|
|
3
|
+
export type TrueAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'true'>;
|
|
4
|
+
export type FalseAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'false'>;
|
|
5
|
+
export declare const booleanSummaryByCheck: {
|
|
6
|
+
readonly false: "Expected value to be false.";
|
|
7
|
+
readonly true: "Expected value to be true.";
|
|
8
|
+
};
|
|
9
|
+
export declare function evaluateFalse(assertion: FalseAssertionNode): AssertionOutcome;
|
|
10
|
+
export declare function evaluateTrue(assertion: TrueAssertionNode): AssertionOutcome;
|
|
11
|
+
//# sourceMappingURL=boolean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEvF,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtH,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExH,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX,wBAAgB,aAAa,CAAC,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAE7E;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAE3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { assertionOutcome } from "../assertion-evaluation.js";
|
|
2
|
+
export const booleanSummaryByCheck = {
|
|
3
|
+
false: 'Expected value to be false.',
|
|
4
|
+
true: 'Expected value to be true.'
|
|
5
|
+
};
|
|
6
|
+
export function evaluateFalse(assertion) {
|
|
7
|
+
return assertionOutcome(assertion.actual, false, assertion.actual === false);
|
|
8
|
+
}
|
|
9
|
+
export function evaluateTrue(assertion) {
|
|
10
|
+
return assertionOutcome(assertion.actual, true, assertion.actual === true);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=boolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAC;AAOrF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,4BAA4B;CAC5B,CAAC;AAEX,MAAM,UAAU,aAAa,CAAC,SAA6B;IACvD,OAAO,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,SAA4B;IACrD,OAAO,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { ActualAssertionNode, AssertionSource, ResolvableSourceLocation } from '../assertion-node-shape.ts';
|
|
3
|
+
export type LengthAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
4
|
+
readonly actual: unknown;
|
|
5
|
+
readonly check: 'length';
|
|
6
|
+
readonly expectedLength: number;
|
|
7
|
+
readonly location: ResolvableSourceLocation;
|
|
8
|
+
readonly message: string | null;
|
|
9
|
+
readonly source: Source;
|
|
10
|
+
};
|
|
11
|
+
export type EmptinessAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
12
|
+
readonly [Check in 'empty' | 'not-empty']: ActualAssertionNode<Source, Check>;
|
|
13
|
+
}['empty' | 'not-empty'];
|
|
14
|
+
export declare const collectionSummaryByCheck: {
|
|
15
|
+
readonly empty: "Expected collection to be empty.";
|
|
16
|
+
readonly length: "Expected collection length to match.";
|
|
17
|
+
readonly 'not-empty': "Expected collection not to be empty.";
|
|
18
|
+
};
|
|
19
|
+
export declare function evaluateEmpty(assertion: EmptinessAssertionNode): AssertionOutcome;
|
|
20
|
+
export declare function evaluateLength(assertion: LengthAssertionNode): AssertionOutcome;
|
|
21
|
+
export declare function evaluateNotEmpty(assertion: EmptinessAssertionNode): AssertionOutcome;
|
|
22
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGjH,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IAChF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,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,sBAAsB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IACnF,QAAQ,EAAE,KAAK,IAAI,OAAO,GAAG,WAAW,GAAG,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC;CAChF,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;AAEzB,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX,wBAAgB,aAAa,CAAC,SAAS,EAAE,sBAAsB,GAAG,gBAAgB,CAQjF;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,mBAAmB,GAAG,gBAAgB,CAS/E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,sBAAsB,GAAG,gBAAgB,CAQpF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { assertionOutcome } from "../assertion-evaluation.js";
|
|
2
|
+
import { collectionCount } from "../collection-count.js";
|
|
3
|
+
export const collectionSummaryByCheck = {
|
|
4
|
+
empty: 'Expected collection to be empty.',
|
|
5
|
+
length: 'Expected collection length to match.',
|
|
6
|
+
'not-empty': 'Expected collection not to be empty.'
|
|
7
|
+
};
|
|
8
|
+
export function evaluateEmpty(assertion) {
|
|
9
|
+
const count = collectionCount(assertion.actual, 1);
|
|
10
|
+
return assertionOutcome(count.supported ? count.count : assertion.actual, 0, count.supported && count.count === 0);
|
|
11
|
+
}
|
|
12
|
+
export function evaluateLength(assertion) {
|
|
13
|
+
const count = collectionCount(assertion.actual, assertion.expectedLength + 1);
|
|
14
|
+
const validLength = Number.isSafeInteger(assertion.expectedLength) && assertion.expectedLength >= 0;
|
|
15
|
+
return assertionOutcome(count.supported ? count.count : assertion.actual, assertion.expectedLength, validLength && count.supported && count.count === assertion.expectedLength);
|
|
16
|
+
}
|
|
17
|
+
export function evaluateNotEmpty(assertion) {
|
|
18
|
+
const count = collectionCount(assertion.actual, 1);
|
|
19
|
+
return assertionOutcome(count.supported ? count.count : assertion.actual, 'more than 0', count.supported && count.count > 0);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAezD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IAC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ACrC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import { type FalseAssertionNode, type TrueAssertionNode } from './boolean.ts';
|
|
3
|
+
import { type EmptinessAssertionNode, type LengthAssertionNode } from './collection.ts';
|
|
4
|
+
import { type DeepEqualAssertionNode, type EqualAssertionNode, type NotDeepEqualAssertionNode, type NotEqualAssertionNode } from './equality.ts';
|
|
5
|
+
import { type FailAssertionNode } from './fail.ts';
|
|
6
|
+
import { type BetweenAssertionNode, type NumericComparisonAssertionNode } from './numeric.ts';
|
|
7
|
+
import { type ArrayContainsPartialAssertionNode, type MembersPartialDeepEqualAssertionNode, type PartialDeepEqualAssertionNode } from './partial.ts';
|
|
8
|
+
import { type DefinedAssertionNode, type NotNullAssertionNode, type NullAssertionNode, type UndefinedAssertionNode } from './presence.ts';
|
|
9
|
+
import { type MatchAssertionNode, type StringContainsAssertionNode } from './string.ts';
|
|
10
|
+
import { type HasPropertyAssertionNode, type InstanceOfAssertionNode, type TypeAssertionNode } from './type-shape.ts';
|
|
11
|
+
export type AssertionNodeByCheck = {
|
|
12
|
+
readonly array: Extract<TypeAssertionNode, {
|
|
13
|
+
readonly check: 'array';
|
|
14
|
+
}>;
|
|
15
|
+
readonly 'array-contains-partial': ArrayContainsPartialAssertionNode;
|
|
16
|
+
readonly between: BetweenAssertionNode;
|
|
17
|
+
readonly boolean: Extract<TypeAssertionNode, {
|
|
18
|
+
readonly check: 'boolean';
|
|
19
|
+
}>;
|
|
20
|
+
readonly 'deep-equal': DeepEqualAssertionNode;
|
|
21
|
+
readonly defined: DefinedAssertionNode;
|
|
22
|
+
readonly empty: Extract<EmptinessAssertionNode, {
|
|
23
|
+
readonly check: 'empty';
|
|
24
|
+
}>;
|
|
25
|
+
readonly 'ends-with': Extract<StringContainsAssertionNode, {
|
|
26
|
+
readonly check: 'ends-with';
|
|
27
|
+
}>;
|
|
28
|
+
readonly equal: EqualAssertionNode;
|
|
29
|
+
readonly fail: FailAssertionNode;
|
|
30
|
+
readonly false: FalseAssertionNode;
|
|
31
|
+
readonly function: Extract<TypeAssertionNode, {
|
|
32
|
+
readonly check: 'function';
|
|
33
|
+
}>;
|
|
34
|
+
readonly 'greater-than': Extract<NumericComparisonAssertionNode, {
|
|
35
|
+
readonly check: 'greater-than';
|
|
36
|
+
}>;
|
|
37
|
+
readonly 'greater-than-or-equal': Extract<NumericComparisonAssertionNode, {
|
|
38
|
+
readonly check: 'greater-than-or-equal';
|
|
39
|
+
}>;
|
|
40
|
+
readonly 'has-property': HasPropertyAssertionNode;
|
|
41
|
+
readonly includes: Extract<StringContainsAssertionNode, {
|
|
42
|
+
readonly check: 'includes';
|
|
43
|
+
}>;
|
|
44
|
+
readonly 'instance-of': InstanceOfAssertionNode;
|
|
45
|
+
readonly length: LengthAssertionNode;
|
|
46
|
+
readonly 'less-than': Extract<NumericComparisonAssertionNode, {
|
|
47
|
+
readonly check: 'less-than';
|
|
48
|
+
}>;
|
|
49
|
+
readonly 'less-than-or-equal': Extract<NumericComparisonAssertionNode, {
|
|
50
|
+
readonly check: 'less-than-or-equal';
|
|
51
|
+
}>;
|
|
52
|
+
readonly match: Extract<MatchAssertionNode, {
|
|
53
|
+
readonly check: 'match';
|
|
54
|
+
}>;
|
|
55
|
+
readonly 'members-partial-deep-equal': MembersPartialDeepEqualAssertionNode;
|
|
56
|
+
readonly 'not-deep-equal': NotDeepEqualAssertionNode;
|
|
57
|
+
readonly 'not-empty': Extract<EmptinessAssertionNode, {
|
|
58
|
+
readonly check: 'not-empty';
|
|
59
|
+
}>;
|
|
60
|
+
readonly 'not-equal': NotEqualAssertionNode;
|
|
61
|
+
readonly 'not-match': Extract<MatchAssertionNode, {
|
|
62
|
+
readonly check: 'not-match';
|
|
63
|
+
}>;
|
|
64
|
+
readonly 'not-null': NotNullAssertionNode;
|
|
65
|
+
readonly null: NullAssertionNode;
|
|
66
|
+
readonly number: Extract<TypeAssertionNode, {
|
|
67
|
+
readonly check: 'number';
|
|
68
|
+
}>;
|
|
69
|
+
readonly object: Extract<TypeAssertionNode, {
|
|
70
|
+
readonly check: 'object';
|
|
71
|
+
}>;
|
|
72
|
+
readonly 'partial-deep-equal': PartialDeepEqualAssertionNode;
|
|
73
|
+
readonly 'starts-with': Extract<StringContainsAssertionNode, {
|
|
74
|
+
readonly check: 'starts-with';
|
|
75
|
+
}>;
|
|
76
|
+
readonly string: Extract<TypeAssertionNode, {
|
|
77
|
+
readonly check: 'string';
|
|
78
|
+
}>;
|
|
79
|
+
readonly true: TrueAssertionNode;
|
|
80
|
+
readonly undefined: UndefinedAssertionNode;
|
|
81
|
+
};
|
|
82
|
+
type AssertionCheck = keyof AssertionNodeByCheck;
|
|
83
|
+
export type AssertionEvaluatorByCheck = {
|
|
84
|
+
readonly [Check in AssertionCheck]: (assertion: AssertionNodeByCheck[Check]) => AssertionOutcome;
|
|
85
|
+
};
|
|
86
|
+
export declare const assertionEvaluatorByCheck: AssertionEvaluatorByCheck;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAA+B,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EAIH,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAKH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,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