@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.
- package/LICENSE +21 -0
- package/assert/assertion-extension.d.ts +65 -0
- package/assert/assertion-extension.d.ts.map +1 -0
- package/assert/assertion-extension.js +250 -0
- package/assert/assertion-extension.js.map +1 -0
- package/assertion-protocol/assertion-evaluation.d.ts +13 -0
- package/assertion-protocol/assertion-evaluation.d.ts.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-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/collection.d.ts +22 -0
- package/assertion-protocol/assertions/collection.d.ts.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/fail.d.ts +13 -0
- package/assertion-protocol/assertions/fail.d.ts.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/partial.d.ts +14 -0
- package/assertion-protocol/assertions/partial.d.ts.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/string.d.ts +28 -0
- package/assertion-protocol/assertions/string.d.ts.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/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 +186 -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-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/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-shape.d.ts +143 -0
- package/compare/serialized-value-shape.d.ts.map +1 -0
- package/compare/serialized-value.d.ts +11 -0
- package/compare/serialized-value.d.ts.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 +110 -0
- package/compare/value-classification.js.map +1 -0
- package/diff/diff-shape.d.ts +117 -0
- package/diff/diff-shape.d.ts.map +1 -0
- package/doubles/disposal-symbol.d.ts +3 -0
- package/doubles/disposal-symbol.d.ts.map +1 -0
- package/doubles/disposal-symbol.js +10 -0
- package/doubles/disposal-symbol.js.map +1 -0
- package/doubles/double-behavior.d.ts +106 -0
- package/doubles/double-behavior.d.ts.map +1 -0
- package/doubles/double-behavior.js +257 -0
- package/doubles/double-behavior.js.map +1 -0
- package/doubles/double-chronology.d.ts +21 -0
- package/doubles/double-chronology.d.ts.map +1 -0
- package/doubles/double-chronology.js +78 -0
- package/doubles/double-chronology.js.map +1 -0
- package/doubles/double-history-api.d.ts +33 -0
- package/doubles/double-history-api.d.ts.map +1 -0
- package/doubles/double-history-api.js +125 -0
- package/doubles/double-history-api.js.map +1 -0
- package/doubles/double-history-record.d.ts +82 -0
- package/doubles/double-history-record.d.ts.map +1 -0
- package/doubles/double-history-record.js +65 -0
- package/doubles/double-history-record.js.map +1 -0
- package/doubles/double-history-store.d.ts +21 -0
- package/doubles/double-history-store.d.ts.map +1 -0
- package/doubles/double-history-store.js +118 -0
- package/doubles/double-history-store.js.map +1 -0
- package/doubles/double-history.d.ts +141 -0
- package/doubles/double-history.d.ts.map +1 -0
- package/doubles/double-history.js +32 -0
- package/doubles/double-history.js.map +1 -0
- package/doubles/double-iterator-event-types.d.ts +25 -0
- package/doubles/double-iterator-event-types.d.ts.map +1 -0
- package/doubles/double-iterator-tracking.d.ts +12 -0
- package/doubles/double-iterator-tracking.d.ts.map +1 -0
- package/doubles/double-iterator-tracking.js +161 -0
- package/doubles/double-iterator-tracking.js.map +1 -0
- package/doubles/double-rule-arguments.d.ts +18 -0
- package/doubles/double-rule-arguments.d.ts.map +1 -0
- package/doubles/double-rule-callback.d.ts +40 -0
- package/doubles/double-rule-callback.d.ts.map +1 -0
- package/doubles/double-rule-callback.js +84 -0
- package/doubles/double-rule-callback.js.map +1 -0
- package/doubles/double-rule-generator.d.ts +108 -0
- package/doubles/double-rule-generator.d.ts.map +1 -0
- package/doubles/double-rule-generator.js +37 -0
- package/doubles/double-rule-generator.js.map +1 -0
- package/doubles/double-rule-types.d.ts +162 -0
- package/doubles/double-rule-types.d.ts.map +1 -0
- package/doubles/double-rule.d.ts +3 -0
- package/doubles/double-rule.d.ts.map +1 -0
- package/doubles/double-rule.js +113 -0
- package/doubles/double-rule.js.map +1 -0
- package/doubles/double-runtime.d.ts +9 -0
- package/doubles/double-runtime.d.ts.map +1 -0
- package/doubles/double-runtime.js +173 -0
- package/doubles/double-runtime.js.map +1 -0
- package/doubles/double-signature.d.ts +5 -0
- package/doubles/double-signature.d.ts.map +1 -0
- package/doubles/double-usage-argument-assertion.d.ts +27 -0
- package/doubles/double-usage-argument-assertion.d.ts.map +1 -0
- package/doubles/double-usage-argument-assertion.js +202 -0
- package/doubles/double-usage-argument-assertion.js.map +1 -0
- package/doubles/double-usage-contract.d.ts +29 -0
- package/doubles/double-usage-contract.d.ts.map +1 -0
- package/doubles/double-usage-contract.js +11 -0
- package/doubles/double-usage-contract.js.map +1 -0
- package/doubles/double-usage-count-assertion.d.ts +6 -0
- package/doubles/double-usage-count-assertion.d.ts.map +1 -0
- package/doubles/double-usage-count-assertion.js +73 -0
- package/doubles/double-usage-count-assertion.js.map +1 -0
- package/doubles/double-usage-disposal-assertion.d.ts +7 -0
- package/doubles/double-usage-disposal-assertion.d.ts.map +1 -0
- package/doubles/double-usage-disposal-assertion.js +175 -0
- package/doubles/double-usage-disposal-assertion.js.map +1 -0
- package/doubles/double-usage-inspection.d.ts +22 -0
- package/doubles/double-usage-inspection.d.ts.map +1 -0
- package/doubles/double-usage-inspection.js +59 -0
- package/doubles/double-usage-inspection.js.map +1 -0
- package/doubles/double-usage-iterator-assertion.d.ts +7 -0
- package/doubles/double-usage-iterator-assertion.d.ts.map +1 -0
- package/doubles/double-usage-iterator-assertion.js +124 -0
- package/doubles/double-usage-iterator-assertion.js.map +1 -0
- package/doubles/double-usage-order-assertion.d.ts +3 -0
- package/doubles/double-usage-order-assertion.d.ts.map +1 -0
- package/doubles/double-usage-order-assertion.js +91 -0
- package/doubles/double-usage-order-assertion.js.map +1 -0
- package/doubles/double-usage.d.ts +81 -0
- package/doubles/double-usage.d.ts.map +1 -0
- package/doubles/double-usage.js +228 -0
- package/doubles/double-usage.js.map +1 -0
- package/doubles/protocol-disposable-double.d.ts +16 -0
- package/doubles/protocol-disposable-double.d.ts.map +1 -0
- package/doubles/protocol-disposable-double.js +37 -0
- package/doubles/protocol-disposable-double.js.map +1 -0
- package/doubles/protocol-double-metadata.d.ts +15 -0
- package/doubles/protocol-double-metadata.d.ts.map +1 -0
- package/doubles/protocol-double-metadata.js +30 -0
- package/doubles/protocol-double-metadata.js.map +1 -0
- package/doubles/protocol-double.d.ts +50 -0
- package/doubles/protocol-double.d.ts.map +1 -0
- package/doubles/protocol-double.js +76 -0
- package/doubles/protocol-double.js.map +1 -0
- package/doubles/protocol-iterator-double.d.ts +93 -0
- package/doubles/protocol-iterator-double.d.ts.map +1 -0
- package/doubles/protocol-iterator-double.js +512 -0
- package/doubles/protocol-iterator-double.js.map +1 -0
- package/doubles/test-double.d.ts +62 -0
- package/doubles/test-double.d.ts.map +1 -0
- package/doubles/test-double.js +192 -0
- package/doubles/test-double.js.map +1 -0
- package/package.json +36 -6
- package/packages/doubles/doubles.entry-point.d.ts +13 -0
- package/packages/doubles/doubles.entry-point.d.ts.map +1 -0
- package/packages/doubles/doubles.entry-point.js +5 -0
- package/packages/doubles/doubles.entry-point.js.map +1 -0
- package/readme.md +423 -5
- package/sbom.cdx.json +30 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
type CollectionTruncationReason = 'array-entries' | 'object-entries';
|
|
2
|
+
type ValueTruncationReason = 'depth' | 'serialized-bytes' | 'string-bytes' | 'visited-nodes';
|
|
3
|
+
type SerializationTruncationReason = CollectionTruncationReason | ValueTruncationReason;
|
|
4
|
+
export type SerializationTruncation = {
|
|
5
|
+
readonly budget: number;
|
|
6
|
+
readonly reason: SerializationTruncationReason;
|
|
7
|
+
};
|
|
8
|
+
type SerializedStringPropertyKey = {
|
|
9
|
+
readonly kind: 'string';
|
|
10
|
+
readonly value: string;
|
|
11
|
+
};
|
|
12
|
+
type SerializedSymbolPropertyKey = {
|
|
13
|
+
readonly kind: 'symbol';
|
|
14
|
+
readonly value: string;
|
|
15
|
+
};
|
|
16
|
+
export type SerializedPropertyKey = SerializedStringPropertyKey | SerializedSymbolPropertyKey;
|
|
17
|
+
export type SerializedProperty = {
|
|
18
|
+
readonly key: SerializedPropertyKey;
|
|
19
|
+
readonly value: SerializedValue;
|
|
20
|
+
};
|
|
21
|
+
export type SerializedMapEntry = {
|
|
22
|
+
readonly key: SerializedValue;
|
|
23
|
+
readonly value: SerializedValue;
|
|
24
|
+
};
|
|
25
|
+
export type SerializedBytes = {
|
|
26
|
+
readonly bytes: readonly number[];
|
|
27
|
+
readonly byteLength: number;
|
|
28
|
+
readonly truncation: SerializationTruncation | null;
|
|
29
|
+
};
|
|
30
|
+
type SerializedObjectValue = {
|
|
31
|
+
readonly constructorName: string;
|
|
32
|
+
readonly entries: readonly SerializedProperty[];
|
|
33
|
+
readonly kind: 'object';
|
|
34
|
+
readonly truncation: SerializationTruncation | null;
|
|
35
|
+
};
|
|
36
|
+
type SerializedErrorValue = {
|
|
37
|
+
readonly entries: readonly SerializedProperty[];
|
|
38
|
+
readonly kind: 'error';
|
|
39
|
+
readonly message: string;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly truncation: SerializationTruncation | null;
|
|
42
|
+
};
|
|
43
|
+
type SerializedArrayValue = {
|
|
44
|
+
readonly entries: readonly SerializedProperty[];
|
|
45
|
+
readonly kind: 'array';
|
|
46
|
+
readonly length: number;
|
|
47
|
+
readonly truncation: SerializationTruncation | null;
|
|
48
|
+
};
|
|
49
|
+
type SerializedMapValue = {
|
|
50
|
+
readonly entries: readonly SerializedMapEntry[];
|
|
51
|
+
readonly kind: 'map';
|
|
52
|
+
readonly size: number;
|
|
53
|
+
readonly truncation: SerializationTruncation | null;
|
|
54
|
+
};
|
|
55
|
+
type SerializedSetValue = {
|
|
56
|
+
readonly kind: 'set';
|
|
57
|
+
readonly size: number;
|
|
58
|
+
readonly truncation: SerializationTruncation | null;
|
|
59
|
+
readonly values: readonly SerializedValue[];
|
|
60
|
+
};
|
|
61
|
+
type SerializedCollectionValue = SerializedArrayValue | SerializedMapValue | SerializedObjectValue | SerializedSetValue;
|
|
62
|
+
type SerializedFunctionValue = {
|
|
63
|
+
readonly id: number;
|
|
64
|
+
readonly kind: 'function';
|
|
65
|
+
readonly name: string | null;
|
|
66
|
+
};
|
|
67
|
+
type SerializedBigIntValue = {
|
|
68
|
+
readonly kind: 'bigint';
|
|
69
|
+
readonly value: string;
|
|
70
|
+
};
|
|
71
|
+
type SerializedBooleanValue = {
|
|
72
|
+
readonly kind: 'boolean';
|
|
73
|
+
readonly value: boolean;
|
|
74
|
+
};
|
|
75
|
+
type SerializedNullValue = {
|
|
76
|
+
readonly kind: 'null';
|
|
77
|
+
};
|
|
78
|
+
type SerializedNumberValue = {
|
|
79
|
+
readonly kind: 'number';
|
|
80
|
+
readonly value: number | '-0' | '-Infinity' | 'Infinity' | 'NaN';
|
|
81
|
+
};
|
|
82
|
+
type SerializedStringValue = {
|
|
83
|
+
readonly kind: 'string';
|
|
84
|
+
readonly truncation: SerializationTruncation | null;
|
|
85
|
+
readonly value: string;
|
|
86
|
+
};
|
|
87
|
+
type SerializedSymbolValue = {
|
|
88
|
+
readonly kind: 'symbol';
|
|
89
|
+
readonly value: string;
|
|
90
|
+
};
|
|
91
|
+
type SerializedUndefinedValue = {
|
|
92
|
+
readonly kind: 'undefined';
|
|
93
|
+
};
|
|
94
|
+
type SerializedNullishValue = SerializedNullValue | SerializedUndefinedValue;
|
|
95
|
+
type SerializedNumericValue = SerializedBigIntValue | SerializedNumberValue;
|
|
96
|
+
type SerializedScalarValue = SerializedBooleanValue | SerializedNullishValue | SerializedNumericValue;
|
|
97
|
+
type SerializedTextValue = SerializedStringValue | SerializedSymbolValue | SerializedUndefinedValue;
|
|
98
|
+
type SerializedPrimitiveValue = SerializedScalarValue | SerializedTextValue;
|
|
99
|
+
type SerializedCircularValue = {
|
|
100
|
+
readonly kind: 'circular';
|
|
101
|
+
readonly reference: number;
|
|
102
|
+
};
|
|
103
|
+
type SerializedDateValue = {
|
|
104
|
+
readonly kind: 'date';
|
|
105
|
+
readonly value: string | null;
|
|
106
|
+
};
|
|
107
|
+
type SerializedOpaqueValue = {
|
|
108
|
+
readonly kind: 'opaque';
|
|
109
|
+
readonly type: 'promise' | 'weak-map' | 'weak-set';
|
|
110
|
+
};
|
|
111
|
+
type SerializedRegExpValue = {
|
|
112
|
+
readonly kind: 'regexp';
|
|
113
|
+
readonly flags: string;
|
|
114
|
+
readonly source: string;
|
|
115
|
+
};
|
|
116
|
+
type SerializedUnavailableValue = {
|
|
117
|
+
readonly kind: 'unavailable';
|
|
118
|
+
readonly reason: string;
|
|
119
|
+
};
|
|
120
|
+
type SerializedBuiltInCoreValue = SerializedCircularValue | SerializedDateValue | SerializedOpaqueValue;
|
|
121
|
+
type SerializedBuiltInValue = SerializedBuiltInCoreValue | SerializedRegExpValue | SerializedUnavailableValue;
|
|
122
|
+
type SerializedTypedArrayValue = SerializedBytes & {
|
|
123
|
+
readonly constructorName: string;
|
|
124
|
+
readonly kind: 'typed-array';
|
|
125
|
+
readonly length: number;
|
|
126
|
+
};
|
|
127
|
+
type SerializedByteViewValue = SerializedBytes & {
|
|
128
|
+
readonly kind: 'array-buffer' | 'data-view';
|
|
129
|
+
};
|
|
130
|
+
type SerializedReferenceValue = SerializedByteViewValue | SerializedCollectionValue | SerializedTypedArrayValue;
|
|
131
|
+
type SerializedRuntimeValue = SerializedBuiltInValue | SerializedErrorValue | SerializedFunctionValue;
|
|
132
|
+
export type SerializedValue = SerializedPrimitiveValue | SerializedReferenceValue | SerializedRuntimeValue;
|
|
133
|
+
export type SerializationBudget = {
|
|
134
|
+
readonly arrayEntries: number;
|
|
135
|
+
readonly depth: number;
|
|
136
|
+
readonly objectEntries: number;
|
|
137
|
+
readonly operandBytes: number;
|
|
138
|
+
readonly stringBytes: number;
|
|
139
|
+
readonly visitedNodes: number;
|
|
140
|
+
};
|
|
141
|
+
export declare const defaultSerializationBudget: SerializationBudget;
|
|
142
|
+
export {};
|
|
143
|
+
//# sourceMappingURL=serialized-value-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialized-value-shape.d.ts","sourceRoot":"","sources":["../../../../source/compare/serialized-value-shape.ts"],"names":[],"mappings":"AAAA,KAAK,0BAA0B,GAAG,eAAe,GAAG,gBAAgB,CAAC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EF,KAAK,wBAAwB,GAAG,uBAAuB,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAEhH,KAAK,sBAAsB,GAAG,sBAAsB,GAAG,oBAAoB,GAAG,uBAAuB,CAAC;AAEtG,MAAM,MAAM,eAAe,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,sBAAsB,CAAC;AAE3G,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CACjC,CAAC;AAMF,eAAO,MAAM,0BAA0B,EAAE,mBAOxC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SerializationBudget as SerializationBudgetShape, type SerializationTruncation as SerializationTruncationShape, type SerializedMapEntry as SerializedMapEntryShape, type SerializedProperty as SerializedPropertyShape, type SerializedPropertyKey as SerializedPropertyKeyShape, type SerializedValue as SerializedValueShape } from './serialized-value-shape.ts';
|
|
2
|
+
export type SerializationTruncation = SerializationTruncationShape;
|
|
3
|
+
export type SerializedPropertyKey = SerializedPropertyKeyShape;
|
|
4
|
+
export type SerializedProperty = SerializedPropertyShape;
|
|
5
|
+
export type SerializedMapEntry = SerializedMapEntryShape;
|
|
6
|
+
export type SerializedValue = SerializedValueShape;
|
|
7
|
+
export type SerializationBudget = SerializationBudgetShape;
|
|
8
|
+
export declare const defaultSerializationBudget: SerializationBudget;
|
|
9
|
+
export declare function serializeValue(value: unknown): SerializedValue;
|
|
10
|
+
export declare function serializeValueWithBudget(value: unknown, budget: SerializationBudget): SerializedValue;
|
|
11
|
+
//# sourceMappingURL=serialized-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialized-value.d.ts","sourceRoot":"","sources":["../../../../source/compare/serialized-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,mBAAmB,IAAI,wBAAwB,EACpD,KAAK,uBAAuB,IAAI,4BAA4B,EAE5D,KAAK,kBAAkB,IAAI,uBAAuB,EAClD,KAAK,kBAAkB,IAAI,uBAAuB,EAClD,KAAK,qBAAqB,IAAI,0BAA0B,EACxD,KAAK,eAAe,IAAI,oBAAoB,EAC/C,MAAM,6BAA6B,CAAC;AAuBrC,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AACnE,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAC/D,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AACzD,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACnD,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAE3D,eAAO,MAAM,0BAA0B,EAAE,mBAA2C,CAAC;AA+iBrF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAE9D;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,GAAG,eAAe,CAErG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ByteSource = ArrayBuffer | ArrayBufferView;
|
|
2
|
+
type ByteSourcePair = {
|
|
3
|
+
readonly actual: ByteSource;
|
|
4
|
+
readonly expected: ByteSource;
|
|
5
|
+
};
|
|
6
|
+
type MapPair = {
|
|
7
|
+
readonly actual: ReadonlyMap<unknown, unknown>;
|
|
8
|
+
readonly expected: ReadonlyMap<unknown, unknown>;
|
|
9
|
+
};
|
|
10
|
+
type SetPair = {
|
|
11
|
+
readonly actual: ReadonlySet<unknown>;
|
|
12
|
+
readonly expected: ReadonlySet<unknown>;
|
|
13
|
+
};
|
|
14
|
+
export declare function isByteSource(value: unknown): value is ByteSource;
|
|
15
|
+
export declare function byteSourcePair(actual: unknown, expected: unknown): ByteSourcePair | null;
|
|
16
|
+
export declare function isDateValue(value: unknown): value is Date;
|
|
17
|
+
export declare function isRegExpValue(value: unknown): value is RegExp;
|
|
18
|
+
export declare function isErrorValue(value: unknown): value is Error;
|
|
19
|
+
export declare function mapPair(actual: unknown, expected: unknown): MapPair | null;
|
|
20
|
+
export declare function setPair(actual: unknown, expected: unknown): SetPair | null;
|
|
21
|
+
export declare const isMapCandidate: (value: unknown) => boolean;
|
|
22
|
+
export declare const isSetCandidate: (value: unknown) => boolean;
|
|
23
|
+
export declare function isOpaqueIdentityValue(value: unknown): boolean;
|
|
24
|
+
export declare function prototypeOf(value: unknown): unknown;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=value-classification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-classification.d.ts","sourceRoot":"","sources":["../../../../source/compare/value-classification.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,eAAe,CAAC;AAEvD,KAAK,cAAc,GAAG;IAClB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;CACjC,CAAC;AAEF,KAAK,OAAO,GAAG;IACX,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;CACpD,CAAC;AAEF,KAAK,OAAO,GAAG;IACX,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC3C,CAAC;AAkBF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAQxF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAMzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAM7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAM3D;AAkBD,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAE1E;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAE1E;AAED,eAAO,MAAM,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAoB,CAAC;AAEtE,eAAO,MAAM,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAoB,CAAC;AA0BtE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQnD"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function isArrayBufferValue(value) {
|
|
2
|
+
try {
|
|
3
|
+
return value instanceof ArrayBuffer;
|
|
4
|
+
}
|
|
5
|
+
catch {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function isArrayBufferView(value) {
|
|
10
|
+
try {
|
|
11
|
+
return ArrayBuffer.isView(value);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function byteSourcePair(actual, expected) {
|
|
19
|
+
if (isArrayBufferValue(actual) && isArrayBufferValue(expected)) {
|
|
20
|
+
return { actual, expected };
|
|
21
|
+
}
|
|
22
|
+
return isArrayBufferView(actual) && isArrayBufferView(expected) && actual.constructor === expected.constructor
|
|
23
|
+
? { actual, expected }
|
|
24
|
+
: null;
|
|
25
|
+
}
|
|
26
|
+
export function isDateValue(value) {
|
|
27
|
+
try {
|
|
28
|
+
return value instanceof Date;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function isRegExpValue(value) {
|
|
35
|
+
try {
|
|
36
|
+
return value instanceof RegExp;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function isErrorValue(value) {
|
|
43
|
+
try {
|
|
44
|
+
return value instanceof Error;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function isMapValue(value) {
|
|
51
|
+
try {
|
|
52
|
+
return Object.getPrototypeOf(value) === Map.prototype;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function isSetValue(value) {
|
|
59
|
+
try {
|
|
60
|
+
return Object.getPrototypeOf(value) === Set.prototype;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export function mapPair(actual, expected) {
|
|
67
|
+
return isMapValue(actual) && isMapValue(expected) ? { actual, expected } : null;
|
|
68
|
+
}
|
|
69
|
+
export function setPair(actual, expected) {
|
|
70
|
+
return isSetValue(actual) && isSetValue(expected) ? { actual, expected } : null;
|
|
71
|
+
}
|
|
72
|
+
export const isMapCandidate = isMapValue;
|
|
73
|
+
export const isSetCandidate = isSetValue;
|
|
74
|
+
function isPromiseValue(value) {
|
|
75
|
+
try {
|
|
76
|
+
return value instanceof Promise;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function isWeakMapValue(value) {
|
|
83
|
+
try {
|
|
84
|
+
return value instanceof WeakMap;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function isWeakSetValue(value) {
|
|
91
|
+
try {
|
|
92
|
+
return value instanceof WeakSet;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export function isOpaqueIdentityValue(value) {
|
|
99
|
+
return isPromiseValue(value) || isWeakMapValue(value) || isWeakSetValue(value);
|
|
100
|
+
}
|
|
101
|
+
export function prototypeOf(value) {
|
|
102
|
+
try {
|
|
103
|
+
const prototype = Object.getPrototypeOf(value);
|
|
104
|
+
return prototype;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=value-classification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-classification.js","sourceRoot":"","sources":["../../../../source/compare/value-classification.ts"],"names":[],"mappings":"AAiBA,SAAS,kBAAkB,CAAC,KAAc;IACtC,IAAI,CAAC;QACD,OAAO,KAAK,YAAY,WAAW,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL;AAEA,SAAS,iBAAiB,CAAC,KAAc;IACrC,IAAI,CAAC;QACD,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL;;AAMA,MAAM,UAAU,cAAc,CAAC,MAAe,EAAE,QAAiB;IAC7D,IAAI,kBAAkB,CAAC,MAAM,C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OAAO,IAAI,CAAC;IAChB,CAAC;AACL"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { SerializedPropertyKey, SerializedValue } from '../compare/serialized-value.ts';
|
|
2
|
+
type BytePathSegment = {
|
|
3
|
+
readonly kind: 'byte';
|
|
4
|
+
readonly offset: number;
|
|
5
|
+
};
|
|
6
|
+
type IndexPathSegment = {
|
|
7
|
+
readonly index: number;
|
|
8
|
+
readonly kind: 'index';
|
|
9
|
+
};
|
|
10
|
+
type MapPathSegment = {
|
|
11
|
+
readonly key: SerializedValue;
|
|
12
|
+
readonly kind: 'map-key' | 'map-value';
|
|
13
|
+
};
|
|
14
|
+
type PropertyPathSegment = {
|
|
15
|
+
readonly key: SerializedPropertyKey;
|
|
16
|
+
readonly kind: 'property';
|
|
17
|
+
};
|
|
18
|
+
type SetValuePathSegment = {
|
|
19
|
+
readonly kind: 'set-value';
|
|
20
|
+
readonly value: SerializedValue;
|
|
21
|
+
};
|
|
22
|
+
type IndexedPathSegment = BytePathSegment | IndexPathSegment;
|
|
23
|
+
type KeyedPathSegment = MapPathSegment | PropertyPathSegment | SetValuePathSegment;
|
|
24
|
+
export type DiffPathSegment = IndexedPathSegment | KeyedPathSegment;
|
|
25
|
+
type ReplaceOperation = {
|
|
26
|
+
readonly from: SerializedValue;
|
|
27
|
+
readonly operation: 'replace';
|
|
28
|
+
readonly path: readonly DiffPathSegment[];
|
|
29
|
+
readonly to: SerializedValue;
|
|
30
|
+
};
|
|
31
|
+
type AddOperation = {
|
|
32
|
+
readonly operation: 'add';
|
|
33
|
+
readonly path: readonly DiffPathSegment[];
|
|
34
|
+
readonly value: SerializedValue;
|
|
35
|
+
};
|
|
36
|
+
type RemoveOperation = {
|
|
37
|
+
readonly operation: 'remove';
|
|
38
|
+
readonly path: readonly DiffPathSegment[];
|
|
39
|
+
readonly value: SerializedValue;
|
|
40
|
+
};
|
|
41
|
+
type MissingPropertyOperation = {
|
|
42
|
+
readonly operation: 'missing-property';
|
|
43
|
+
readonly path: readonly DiffPathSegment[];
|
|
44
|
+
readonly value: SerializedValue;
|
|
45
|
+
};
|
|
46
|
+
type MissingIndexOperation = {
|
|
47
|
+
readonly index: number;
|
|
48
|
+
readonly operation: 'missing-index';
|
|
49
|
+
readonly value: SerializedValue;
|
|
50
|
+
};
|
|
51
|
+
type MissingArrayMemberOperation = {
|
|
52
|
+
readonly operation: 'missing-member';
|
|
53
|
+
readonly value: SerializedValue;
|
|
54
|
+
};
|
|
55
|
+
type MissingEntryOperation = {
|
|
56
|
+
readonly key: SerializedValue;
|
|
57
|
+
readonly operation: 'missing-entry';
|
|
58
|
+
readonly value: SerializedValue;
|
|
59
|
+
};
|
|
60
|
+
type MissingMemberOperation = {
|
|
61
|
+
readonly operation: 'missing-member';
|
|
62
|
+
readonly value: SerializedValue;
|
|
63
|
+
};
|
|
64
|
+
type ArrayPresenceOperation = MissingArrayMemberOperation | MissingIndexOperation;
|
|
65
|
+
export type ArrayDiffOperation = AddOperation | ArrayPresenceOperation | RemoveOperation | ReplaceOperation;
|
|
66
|
+
export type MapDiffOperation = AddOperation | MissingEntryOperation | RemoveOperation | ReplaceOperation;
|
|
67
|
+
export type ObjectDiffOperation = AddOperation | MissingPropertyOperation | RemoveOperation | ReplaceOperation;
|
|
68
|
+
export type SetDiffOperation = AddOperation | MissingMemberOperation | RemoveOperation;
|
|
69
|
+
export type ByteDiffRange = {
|
|
70
|
+
readonly actual: readonly number[];
|
|
71
|
+
readonly expected: readonly number[];
|
|
72
|
+
readonly offset: number;
|
|
73
|
+
};
|
|
74
|
+
export type Hunk = {
|
|
75
|
+
readonly actualStart: number;
|
|
76
|
+
readonly added: readonly string[];
|
|
77
|
+
readonly expectedStart: number;
|
|
78
|
+
readonly removed: readonly string[];
|
|
79
|
+
};
|
|
80
|
+
type ArrayDiff = {
|
|
81
|
+
readonly kind: 'array';
|
|
82
|
+
readonly operations: readonly ArrayDiffOperation[];
|
|
83
|
+
};
|
|
84
|
+
type BinaryDiff = {
|
|
85
|
+
readonly actualHash: string;
|
|
86
|
+
readonly actualSize: number;
|
|
87
|
+
readonly expectedHash: string;
|
|
88
|
+
readonly expectedSize: number;
|
|
89
|
+
readonly kind: 'binary';
|
|
90
|
+
readonly ranges: readonly ByteDiffRange[];
|
|
91
|
+
};
|
|
92
|
+
type MapDiff = {
|
|
93
|
+
readonly kind: 'map';
|
|
94
|
+
readonly operations: readonly MapDiffOperation[];
|
|
95
|
+
};
|
|
96
|
+
type ObjectDiff = {
|
|
97
|
+
readonly kind: 'object';
|
|
98
|
+
readonly operations: readonly ObjectDiffOperation[];
|
|
99
|
+
};
|
|
100
|
+
type SetDiff = {
|
|
101
|
+
readonly kind: 'set';
|
|
102
|
+
readonly operations: readonly SetDiffOperation[];
|
|
103
|
+
};
|
|
104
|
+
type StringDiff = {
|
|
105
|
+
readonly actual: string;
|
|
106
|
+
readonly expected: string;
|
|
107
|
+
readonly hunks: readonly Hunk[];
|
|
108
|
+
readonly kind: 'string';
|
|
109
|
+
};
|
|
110
|
+
type ValueDiff = {
|
|
111
|
+
readonly actual: SerializedValue;
|
|
112
|
+
readonly expected: SerializedValue;
|
|
113
|
+
readonly kind: 'value';
|
|
114
|
+
};
|
|
115
|
+
export type Diff = ArrayDiff | BinaryDiff | MapDiff | ObjectDiff | SetDiff | StringDiff | ValueDiff;
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=diff-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-shape.d.ts","sourceRoot":"","sources":["../../../../source/diff/diff-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE7F,KAAK,eAAe,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACpB,QAAQ,CAA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CAAC;CACpD,CAAC;AAEF,KAAK,UAAU,GAAG;IACd,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CAC3B,CAAC;AAEF,KAAK,SAAS,GAAG;IACb,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposal-symbol.d.ts","sourceRoot":"","sources":["../../../../source/doubles/disposal-symbol.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB,QAA0C,CAAC;AAC1E,eAAO,MAAM,aAAa,QAAqC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function requiredWellKnownSymbol(name) {
|
|
2
|
+
const value = Reflect.get(Symbol, name);
|
|
3
|
+
if (typeof value !== 'symbol') {
|
|
4
|
+
throw new TypeError(`Runtime does not provide Symbol.${name}.`);
|
|
5
|
+
}
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
export const asyncDisposeSymbol = requiredWellKnownSymbol('asyncDispose');
|
|
9
|
+
export const disposeSymbol = requiredWellKnownSymbol('dispose');
|
|
10
|
+
//# sourceMappingURL=disposal-symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposal-symbol.js","sourceRoot":"","sources":["../../../../source/doubles/disposal-symbol.ts"],"names":[],"mappings":"AAAA,SAAS,uBAAuB,CAAC,IAAgC;IAC7D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAExC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,SAAS,CAAC,mCAAmC,IAAI,GAAG,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,cAAc,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,aAAa,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export type CallableSignature = (...arguments_: readonly never[]) => unknown;
|
|
2
|
+
export type ConstructorSignature = new (...arguments_: readonly never[]) => unknown;
|
|
3
|
+
export type UnknownFunction<Result> = (...arguments_: readonly unknown[]) => Result;
|
|
4
|
+
export type UnknownConstructor<Instance> = new (...arguments_: readonly unknown[]) => Instance;
|
|
5
|
+
export type InvocationKind = 'call' | 'construction';
|
|
6
|
+
export type BehaviorMode = InvocationKind | 'both';
|
|
7
|
+
type RuleMatchKind = 'arguments' | 'index';
|
|
8
|
+
export type DoubleInvocation<Arguments extends readonly unknown[]> = {
|
|
9
|
+
readonly arguments: Arguments;
|
|
10
|
+
readonly index: number;
|
|
11
|
+
readonly kind: InvocationKind;
|
|
12
|
+
};
|
|
13
|
+
export type Invocation<Arguments extends readonly unknown[] = readonly unknown[]> = DoubleInvocation<Arguments>;
|
|
14
|
+
type CallInvocation = DoubleInvocation<readonly unknown[]> & {
|
|
15
|
+
readonly kind: 'call';
|
|
16
|
+
};
|
|
17
|
+
export type BehaviorAnswer = {
|
|
18
|
+
readonly answered: false;
|
|
19
|
+
} | {
|
|
20
|
+
readonly answered: true;
|
|
21
|
+
readonly value: unknown;
|
|
22
|
+
};
|
|
23
|
+
type FixedBehaviorKindByName = {
|
|
24
|
+
readonly calls: 'calls';
|
|
25
|
+
readonly callsCallback: 'calls-callback';
|
|
26
|
+
readonly callsCallbackAsync: 'calls-callback-async';
|
|
27
|
+
readonly constructs: 'constructs';
|
|
28
|
+
readonly rejects: 'rejects';
|
|
29
|
+
readonly resolves: 'resolves';
|
|
30
|
+
readonly returns: 'returns';
|
|
31
|
+
readonly throws: 'throws';
|
|
32
|
+
readonly yields: 'yields';
|
|
33
|
+
readonly yieldsAsync: 'yields-async';
|
|
34
|
+
readonly yieldsAsyncFrom: 'yields-async-from';
|
|
35
|
+
readonly yieldsFrom: 'yields-from';
|
|
36
|
+
};
|
|
37
|
+
export type FixedBehaviorKind = FixedBehaviorKindByName[keyof FixedBehaviorKindByName];
|
|
38
|
+
export type CallbackBehaviorKind = 'calls-callback' | 'calls-callback-async';
|
|
39
|
+
export type RuntimeFixedBehavior<Mode extends BehaviorMode, Result, Kind extends FixedBehaviorKind = FixedBehaviorKind> = {
|
|
40
|
+
readonly behaviorKind: Kind;
|
|
41
|
+
readonly mode: Mode;
|
|
42
|
+
produce: (invocation: Invocation, runtime: BehaviorRuntime) => unknown;
|
|
43
|
+
result: () => Result;
|
|
44
|
+
};
|
|
45
|
+
export type RuntimeSequenceBehavior<Mode extends BehaviorMode, Result, Entries extends readonly unknown[] = readonly unknown[]> = {
|
|
46
|
+
readonly behaviorKind: 'sequence';
|
|
47
|
+
readonly entries: Entries;
|
|
48
|
+
readonly mode: Mode;
|
|
49
|
+
result: () => Result;
|
|
50
|
+
};
|
|
51
|
+
type RuntimeBehaviorVariants<Mode extends BehaviorMode, Result, Kind extends FixedBehaviorKind, Entries extends readonly unknown[]> = {
|
|
52
|
+
readonly fixed: RuntimeFixedBehavior<Mode, Result, Kind>;
|
|
53
|
+
readonly sequence: RuntimeSequenceBehavior<Mode, Result, Entries>;
|
|
54
|
+
};
|
|
55
|
+
export type RuntimeBehavior<Mode extends BehaviorMode = BehaviorMode, Result = unknown, Kind extends FixedBehaviorKind = FixedBehaviorKind, Entries extends readonly unknown[] = readonly unknown[]> = RuntimeBehaviorVariants<Mode, Result, Kind, Entries>[keyof RuntimeBehaviorVariants<Mode, Result, Kind, Entries>];
|
|
56
|
+
type ArgumentCriterion<Kind extends InvocationKind, ArgumentPattern extends readonly unknown[]> = {
|
|
57
|
+
readonly expectedArguments: ArgumentPattern;
|
|
58
|
+
readonly invocationKind: Kind;
|
|
59
|
+
readonly kind: 'arguments';
|
|
60
|
+
};
|
|
61
|
+
type IndexCriterion<Kind extends InvocationKind> = {
|
|
62
|
+
readonly index: number;
|
|
63
|
+
readonly invocationKind: Kind;
|
|
64
|
+
readonly kind: 'index';
|
|
65
|
+
};
|
|
66
|
+
type RuleCriterion<Kind extends InvocationKind, ArgumentPattern extends readonly unknown[], MatchKind extends RuleMatchKind> = MatchKind extends 'arguments' ? ArgumentCriterion<Kind, ArgumentPattern> : IndexCriterion<Kind>;
|
|
67
|
+
export type RuntimeRule<Kind extends InvocationKind = InvocationKind, ArgumentPattern extends readonly unknown[] = readonly unknown[], Result = unknown, MatchKind extends RuleMatchKind = RuleMatchKind, Behavior extends RuntimeBehavior<BehaviorMode, Result> = RuntimeBehavior<BehaviorMode, Result>> = {
|
|
68
|
+
readonly behavior: Behavior;
|
|
69
|
+
readonly criterion: RuleCriterion<Kind, ArgumentPattern, MatchKind>;
|
|
70
|
+
};
|
|
71
|
+
export type RuntimeFallback = RuntimeBehavior | {
|
|
72
|
+
readonly call?: RuntimeBehavior;
|
|
73
|
+
readonly construction?: RuntimeBehavior;
|
|
74
|
+
};
|
|
75
|
+
export type RuntimeConfiguration = {
|
|
76
|
+
readonly answer: UnknownFunction<unknown> | null;
|
|
77
|
+
readonly fallback: RuntimeFallback | null;
|
|
78
|
+
readonly rules: readonly RuntimeRule[];
|
|
79
|
+
};
|
|
80
|
+
export type ConstructorReturnValue = CallableSignature | Readonly<Record<PropertyKey, unknown>>;
|
|
81
|
+
export type BehaviorRuntime = {
|
|
82
|
+
readonly nextSequenceEntry: (behavior: RuntimeBehavior) => unknown;
|
|
83
|
+
readonly trackAsyncIterator: (invocation: CallInvocation, source: () => AsyncIterator<unknown, unknown, unknown> | Iterator<unknown, unknown, unknown>) => AsyncIterableIterator<unknown>;
|
|
84
|
+
readonly trackSyncIterator: (invocation: CallInvocation, source: () => Iterator<unknown, unknown, unknown>) => IterableIterator<unknown>;
|
|
85
|
+
};
|
|
86
|
+
export declare function isUnknownFunction(value: unknown): value is UnknownFunction<unknown>;
|
|
87
|
+
export declare function isConstructorInstance(value: unknown): value is ConstructorReturnValue;
|
|
88
|
+
export declare function ensureConstructorInstance(instance: unknown, source: string): void;
|
|
89
|
+
export declare function returnsBehavior<Value>(value: Value): RuntimeFixedBehavior<'call', Value, 'returns'>;
|
|
90
|
+
export declare function resolvesBehavior<Value>(value: Value): RuntimeFixedBehavior<'call', Promise<Value>, 'resolves'>;
|
|
91
|
+
export declare function rejectsBehavior(reason: unknown): RuntimeFixedBehavior<'call', Promise<never>, 'rejects'>;
|
|
92
|
+
export declare function throwsBehavior(thrown: unknown): RuntimeFixedBehavior<'both', never, 'throws'>;
|
|
93
|
+
export declare function constructsBehavior<Instance>(instance: Instance): RuntimeFixedBehavior<'construction', Instance, 'constructs'>;
|
|
94
|
+
export declare function callsBehavior<Answer extends UnknownFunction<unknown>>(answer: Answer): RuntimeFixedBehavior<'both', ReturnType<Answer>, 'calls'>;
|
|
95
|
+
export declare function yieldsBehavior<YieldValue, ReturnValue>(values: readonly YieldValue[], returnValue: ReturnValue): RuntimeFixedBehavior<'call', Generator<YieldValue, ReturnValue, unknown>, 'yields'>;
|
|
96
|
+
export declare function yieldsFromBehavior<SourceFactory extends (...arguments_: readonly unknown[]) => Iterable<unknown>>(sourceFactory: SourceFactory): RuntimeFixedBehavior<'call', ReturnType<SourceFactory>, 'yields-from'>;
|
|
97
|
+
export declare function yieldsAsyncBehavior<YieldValue, ReturnValue>(values: readonly YieldValue[], returnValue: ReturnValue): RuntimeFixedBehavior<'call', AsyncGenerator<YieldValue, ReturnValue, unknown>, 'yields-async'>;
|
|
98
|
+
export declare function yieldsAsyncFromBehavior<SourceFactory extends (...arguments_: readonly unknown[]) => AsyncIterable<unknown> | Iterable<unknown>>(sourceFactory: SourceFactory): RuntimeFixedBehavior<'call', ReturnType<SourceFactory>, 'yields-async-from'>;
|
|
99
|
+
export declare function sequenceBehavior<Entries extends readonly [unknown, unknown, ...unknown[]], Result = unknown>(entries: Entries): RuntimeSequenceBehavior<'both', Result, Entries>;
|
|
100
|
+
export declare function isRuntimeBehavior(value: unknown): value is RuntimeBehavior;
|
|
101
|
+
export declare function isRuntimeRule(value: unknown): value is RuntimeRule;
|
|
102
|
+
export declare function answerFromBehavior(behavior: RuntimeBehavior, invocation: Invocation, runtime: BehaviorRuntime): BehaviorAnswer;
|
|
103
|
+
export declare function ruleMatches(configuredRule: RuntimeRule, invocation: Invocation): boolean;
|
|
104
|
+
export declare function fallbackForInvocation(fallback: RuntimeFallback, invocation: Invocation): RuntimeBehavior | null;
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=double-behavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"double-behavior.d.ts","sourceRoot":"","sources":["../../../../source/doubles/double-behavior.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,UAAU,EAAE,SAAS,KAAK,EAAE,KAAK,OAAO,CAAC;AAC7E,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,UAAU,EAAE,SAAS,KAAK,EAAE,KAAK,OAAO,CAAC;AACpF,MAAM,MAAM,eAAe,CAAC,MAAM,IAAI,CAAC,GAAG,UAAU,EAAE,SAAS,OAAO,EAAE,KAAK,MAAM,CAAC;AACpF,MAAM,MAAM,kBAAkB,CAAC,QAAQ,IAAI,KAAK,GAAG,UAAU,EAAE,SAAS,OAAO,EAAE,KAAK,QAAQ,CAAC;AAE/F,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,cAAc,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,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