@effectionx/converge 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/converge.test.ts +304 -0
- package/dist/mod.d.ts +109 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +152 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/mod.ts +214 -0
- package/package.json +35 -0
- package/tsconfig.json +17 -0
package/converge.test.ts
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import assert from "node:assert";
|
|
2
|
+
import { describe, it } from "@effectionx/bdd";
|
|
3
|
+
import { sleep, spawn } from "effection";
|
|
4
|
+
import { expect } from "expect";
|
|
5
|
+
|
|
6
|
+
import { always, when } from "./mod.ts";
|
|
7
|
+
|
|
8
|
+
describe("@effectionx/converge", () => {
|
|
9
|
+
describe("when", () => {
|
|
10
|
+
it("resolves when the assertion passes within the timeout", function* () {
|
|
11
|
+
let total = 0;
|
|
12
|
+
yield* spawn(function* () {
|
|
13
|
+
yield* sleep(30);
|
|
14
|
+
total = 5;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
let start = Date.now();
|
|
18
|
+
let stats = yield* when(
|
|
19
|
+
function* () {
|
|
20
|
+
if (total !== 5) throw new Error(`expected 5, got ${total}`);
|
|
21
|
+
return total;
|
|
22
|
+
},
|
|
23
|
+
{ timeout: 100 },
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
expect(Date.now() - start).toBeGreaterThanOrEqual(30);
|
|
27
|
+
expect(Date.now() - start).toBeLessThan(100);
|
|
28
|
+
expect(stats.value).toEqual(5);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("rejects when the assertion does not pass within the timeout", function* () {
|
|
32
|
+
let total = 0;
|
|
33
|
+
|
|
34
|
+
let start = Date.now();
|
|
35
|
+
try {
|
|
36
|
+
yield* when(
|
|
37
|
+
function* () {
|
|
38
|
+
if (total !== 5) throw new Error(`expected 5, got ${total}`);
|
|
39
|
+
},
|
|
40
|
+
{ timeout: 50 },
|
|
41
|
+
);
|
|
42
|
+
assert.fail("should have thrown");
|
|
43
|
+
} catch (e) {
|
|
44
|
+
expect((e as Error).message).toEqual("expected 5, got 0");
|
|
45
|
+
}
|
|
46
|
+
expect(Date.now() - start).toBeGreaterThanOrEqual(50);
|
|
47
|
+
expect(Date.now() - start).toBeLessThan(80);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("resolves immediately if assertion passes on first try", function* () {
|
|
51
|
+
let start = Date.now();
|
|
52
|
+
let stats = yield* when(
|
|
53
|
+
function* () {
|
|
54
|
+
return 42;
|
|
55
|
+
},
|
|
56
|
+
{ timeout: 100 },
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
expect(Date.now() - start).toBeLessThan(20);
|
|
60
|
+
expect(stats.value).toEqual(42);
|
|
61
|
+
expect(stats.runs).toEqual(1);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("resolves with a stats object", function* () {
|
|
65
|
+
let total = 0;
|
|
66
|
+
yield* spawn(function* () {
|
|
67
|
+
yield* sleep(30);
|
|
68
|
+
total = 5;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
let start = Date.now();
|
|
72
|
+
let stats = yield* when(
|
|
73
|
+
function* () {
|
|
74
|
+
if (total !== 5) throw new Error("expected 5");
|
|
75
|
+
return total * 100;
|
|
76
|
+
},
|
|
77
|
+
{ timeout: 100, interval: 10 },
|
|
78
|
+
);
|
|
79
|
+
let end = Date.now();
|
|
80
|
+
|
|
81
|
+
expect(stats.start).toBeGreaterThanOrEqual(start);
|
|
82
|
+
expect(stats.start).toBeLessThanOrEqual(start + 5);
|
|
83
|
+
expect(stats.end).toBeGreaterThanOrEqual(end - 5);
|
|
84
|
+
expect(stats.end).toBeLessThanOrEqual(end);
|
|
85
|
+
expect(stats.elapsed).toBeGreaterThanOrEqual(30);
|
|
86
|
+
expect(stats.elapsed).toBeLessThan(100);
|
|
87
|
+
expect(stats.runs).toBeGreaterThanOrEqual(3);
|
|
88
|
+
expect(stats.timeout).toEqual(100);
|
|
89
|
+
expect(stats.interval).toEqual(10);
|
|
90
|
+
expect(stats.value).toEqual(500);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe("when the assertion returns false", () => {
|
|
94
|
+
it("rejects if false was continually returned", function* () {
|
|
95
|
+
try {
|
|
96
|
+
yield* when(
|
|
97
|
+
function* () {
|
|
98
|
+
return false;
|
|
99
|
+
},
|
|
100
|
+
{ timeout: 50 },
|
|
101
|
+
);
|
|
102
|
+
assert.fail("should have thrown");
|
|
103
|
+
} catch (e) {
|
|
104
|
+
expect((e as Error).message).toEqual(
|
|
105
|
+
"convergent assertion returned `false`",
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("resolves when false is no longer returned", function* () {
|
|
111
|
+
let total = 0;
|
|
112
|
+
yield* spawn(function* () {
|
|
113
|
+
yield* sleep(30);
|
|
114
|
+
total = 10;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
let stats = yield* when(
|
|
118
|
+
function* () {
|
|
119
|
+
return total >= 10;
|
|
120
|
+
},
|
|
121
|
+
{ timeout: 100 },
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
expect(stats.value).toEqual(true);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("uses the configured interval", function* () {
|
|
129
|
+
let runs = 0;
|
|
130
|
+
yield* spawn(function* () {
|
|
131
|
+
yield* sleep(50);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
yield* when(
|
|
136
|
+
function* () {
|
|
137
|
+
runs++;
|
|
138
|
+
throw new Error("always fail");
|
|
139
|
+
},
|
|
140
|
+
{ timeout: 50, interval: 20 },
|
|
141
|
+
);
|
|
142
|
+
} catch {
|
|
143
|
+
// expected
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// With 50ms timeout and 20ms interval, we should get ~3 runs
|
|
147
|
+
expect(runs).toBeGreaterThanOrEqual(2);
|
|
148
|
+
expect(runs).toBeLessThanOrEqual(4);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("uses default timeout of 2000ms", function* () {
|
|
152
|
+
let stats = yield* when(function* () {
|
|
153
|
+
return 42;
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
expect(stats.timeout).toEqual(2000);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("uses default interval of 10ms", function* () {
|
|
160
|
+
let stats = yield* when(function* () {
|
|
161
|
+
return 42;
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
expect(stats.interval).toEqual(10);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
describe("always", () => {
|
|
169
|
+
it("resolves if the assertion does not fail throughout the timeout", function* () {
|
|
170
|
+
let total = 5;
|
|
171
|
+
|
|
172
|
+
let start = Date.now();
|
|
173
|
+
let stats = yield* always(
|
|
174
|
+
function* () {
|
|
175
|
+
if (total !== 5) throw new Error("expected 5");
|
|
176
|
+
return total;
|
|
177
|
+
},
|
|
178
|
+
{ timeout: 50 },
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
expect(Date.now() - start).toBeGreaterThanOrEqual(50);
|
|
182
|
+
expect(stats.value).toEqual(5);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it("rejects immediately when the assertion fails within the timeout", function* () {
|
|
186
|
+
let total = 5;
|
|
187
|
+
yield* spawn(function* () {
|
|
188
|
+
yield* sleep(30);
|
|
189
|
+
total = 0;
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
let start = Date.now();
|
|
193
|
+
try {
|
|
194
|
+
yield* always(
|
|
195
|
+
function* () {
|
|
196
|
+
if (total !== 5) throw new Error(`expected 5, got ${total}`);
|
|
197
|
+
},
|
|
198
|
+
{ timeout: 100 },
|
|
199
|
+
);
|
|
200
|
+
assert.fail("should have thrown");
|
|
201
|
+
} catch (e) {
|
|
202
|
+
expect((e as Error).message).toEqual("expected 5, got 0");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Should fail around 30ms, not wait until 100ms
|
|
206
|
+
// Allow generous upper bound for slower CI environments
|
|
207
|
+
expect(Date.now() - start).toBeGreaterThanOrEqual(30);
|
|
208
|
+
expect(Date.now() - start).toBeLessThan(90);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("resolves with a stats object", function* () {
|
|
212
|
+
let total = 5;
|
|
213
|
+
|
|
214
|
+
let start = Date.now();
|
|
215
|
+
let stats = yield* always(
|
|
216
|
+
function* () {
|
|
217
|
+
if (total !== 5) throw new Error("expected 5");
|
|
218
|
+
return total * 10;
|
|
219
|
+
},
|
|
220
|
+
{ timeout: 50, interval: 10 },
|
|
221
|
+
);
|
|
222
|
+
let end = Date.now();
|
|
223
|
+
|
|
224
|
+
expect(stats.start).toBeGreaterThanOrEqual(start);
|
|
225
|
+
expect(stats.start).toBeLessThanOrEqual(start + 5);
|
|
226
|
+
expect(stats.end).toBeGreaterThanOrEqual(end - 5);
|
|
227
|
+
expect(stats.end).toBeLessThanOrEqual(end);
|
|
228
|
+
expect(stats.elapsed).toBeGreaterThanOrEqual(50);
|
|
229
|
+
expect(stats.runs).toBeGreaterThanOrEqual(3); // ~50ms / 10ms interval = ~5 runs, allow for timing variance on slower CI
|
|
230
|
+
expect(stats.timeout).toEqual(50);
|
|
231
|
+
expect(stats.interval).toEqual(10);
|
|
232
|
+
expect(stats.value).toEqual(50);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
describe("when the assertion returns false", () => {
|
|
236
|
+
it("resolves if false was never returned", function* () {
|
|
237
|
+
let total = 5;
|
|
238
|
+
|
|
239
|
+
let stats = yield* always(
|
|
240
|
+
function* () {
|
|
241
|
+
return total < 10;
|
|
242
|
+
},
|
|
243
|
+
{ timeout: 50 },
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
expect(stats.value).toEqual(true);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it("rejects when false is returned", function* () {
|
|
250
|
+
let total = 5;
|
|
251
|
+
yield* spawn(function* () {
|
|
252
|
+
yield* sleep(30);
|
|
253
|
+
total = 10;
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
try {
|
|
257
|
+
yield* always(
|
|
258
|
+
function* () {
|
|
259
|
+
return total < 10;
|
|
260
|
+
},
|
|
261
|
+
{ timeout: 100 },
|
|
262
|
+
);
|
|
263
|
+
assert.fail("should have thrown");
|
|
264
|
+
} catch (e) {
|
|
265
|
+
expect((e as Error).message).toEqual(
|
|
266
|
+
"convergent assertion returned `false`",
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("uses default timeout of 200ms", function* () {
|
|
273
|
+
let stats = yield* always(function* () {
|
|
274
|
+
return 42;
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
expect(stats.timeout).toEqual(200);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it("uses default interval of 10ms", function* () {
|
|
281
|
+
let stats = yield* always(function* () {
|
|
282
|
+
return 42;
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
expect(stats.interval).toEqual(10);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it("uses the configured interval", function* () {
|
|
289
|
+
let runs = 0;
|
|
290
|
+
|
|
291
|
+
let stats = yield* always(
|
|
292
|
+
function* () {
|
|
293
|
+
runs++;
|
|
294
|
+
return true;
|
|
295
|
+
},
|
|
296
|
+
{ timeout: 50, interval: 20 },
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
// With 50ms timeout and 20ms interval, we should get ~3 runs
|
|
300
|
+
expect(stats.runs).toBeGreaterThanOrEqual(2);
|
|
301
|
+
expect(stats.runs).toBeLessThanOrEqual(4);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
});
|
package/dist/mod.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Operation } from "effection";
|
|
2
|
+
/**
|
|
3
|
+
* Options for convergence operations.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConvergeOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Maximum time to wait for convergence in milliseconds.
|
|
8
|
+
* Default: 2000ms for `when`, 200ms for `always`
|
|
9
|
+
*/
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Interval between assertion retries in milliseconds.
|
|
13
|
+
* Default: 10ms
|
|
14
|
+
*/
|
|
15
|
+
interval?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Statistics about a convergence operation.
|
|
19
|
+
*/
|
|
20
|
+
export interface ConvergeStats<T> {
|
|
21
|
+
/** Timestamp when convergence started */
|
|
22
|
+
start: number;
|
|
23
|
+
/** Timestamp when convergence ended */
|
|
24
|
+
end: number;
|
|
25
|
+
/** Milliseconds the convergence took */
|
|
26
|
+
elapsed: number;
|
|
27
|
+
/** Number of times the assertion was executed */
|
|
28
|
+
runs: number;
|
|
29
|
+
/** The timeout that was configured */
|
|
30
|
+
timeout: number;
|
|
31
|
+
/** The interval that was configured */
|
|
32
|
+
interval: number;
|
|
33
|
+
/** The return value from the assertion */
|
|
34
|
+
value: T;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Converges on an assertion by resolving when the given assertion
|
|
38
|
+
* passes within the timeout period. The assertion will run repeatedly
|
|
39
|
+
* at the specified interval and is considered to be passing when it
|
|
40
|
+
* does not throw or return `false`.
|
|
41
|
+
*
|
|
42
|
+
* If the assertion never passes within the timeout period, then the
|
|
43
|
+
* operation will throw with the last error received.
|
|
44
|
+
*
|
|
45
|
+
* @example Basic usage
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Wait for a value to become true
|
|
48
|
+
* yield* when(function*() {
|
|
49
|
+
* if (total !== 100) throw new Error(`expected 100, got ${total}`);
|
|
50
|
+
* return total;
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example With custom timeout
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Wait up to 5 seconds for file to exist
|
|
57
|
+
* yield* when(function*() {
|
|
58
|
+
* let exists = yield* until(access(filePath).then(() => true, () => false));
|
|
59
|
+
* if (!exists) throw new Error("file not found");
|
|
60
|
+
* return true;
|
|
61
|
+
* }, { timeout: 5000 });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Using the stats
|
|
65
|
+
* ```ts
|
|
66
|
+
* let stats = yield* when(function*() {
|
|
67
|
+
* return yield* until(readFile(path, "utf-8"));
|
|
68
|
+
* }, { timeout: 1000 });
|
|
69
|
+
*
|
|
70
|
+
* console.log(`Converged in ${stats.elapsed}ms after ${stats.runs} attempts`);
|
|
71
|
+
* console.log(stats.value); // file content
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param assertion - The assertion to converge on. Can be a generator function.
|
|
75
|
+
* @param options - Configuration options
|
|
76
|
+
* @returns Statistics about the convergence including the final value
|
|
77
|
+
*/
|
|
78
|
+
export declare function when<T>(assertion: () => Operation<T>, options?: ConvergeOptions): Operation<ConvergeStats<T>>;
|
|
79
|
+
/**
|
|
80
|
+
* Converges on an assertion by resolving when the given assertion
|
|
81
|
+
* passes consistently throughout the timeout period. The assertion
|
|
82
|
+
* will run repeatedly at the specified interval and is considered
|
|
83
|
+
* to be passing when it does not throw or return `false`.
|
|
84
|
+
*
|
|
85
|
+
* If the assertion fails at any point during the timeout period,
|
|
86
|
+
* the operation will throw immediately with that error.
|
|
87
|
+
*
|
|
88
|
+
* @example Basic usage
|
|
89
|
+
* ```ts
|
|
90
|
+
* // Ensure a value stays below 100 for 200ms
|
|
91
|
+
* yield* always(function*() {
|
|
92
|
+
* if (counter >= 100) throw new Error("counter exceeded limit");
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example With custom timeout
|
|
97
|
+
* ```ts
|
|
98
|
+
* // Verify connection stays alive for 5 seconds
|
|
99
|
+
* yield* always(function*() {
|
|
100
|
+
* if (!isConnected) throw new Error("connection lost");
|
|
101
|
+
* }, { timeout: 5000 });
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @param assertion - The assertion to converge on. Can be a generator function.
|
|
105
|
+
* @param options - Configuration options
|
|
106
|
+
* @returns Statistics about the convergence including the final value
|
|
107
|
+
*/
|
|
108
|
+
export declare function always<T>(assertion: () => Operation<T>, options?: ConvergeOptions): Operation<ConvergeStats<T>>;
|
|
109
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IAEd,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IAEZ,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAEhB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IAEb,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAEhB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IAEjB,0CAA0C;IAC1C,KAAK,EAAE,CAAC,CAAC;CACV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,IAAI,CAAC,CAAC,EACpB,SAAS,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,EAC7B,OAAO,GAAE,eAAoB,GAC5B,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAE7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,SAAS,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,EAC7B,OAAO,GAAE,eAAoB,GAC5B,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAE7B"}
|
package/dist/mod.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { timebox } from "@effectionx/timebox";
|
|
2
|
+
import { sleep } from "effection";
|
|
3
|
+
/**
|
|
4
|
+
* Converges on an assertion by resolving when the given assertion
|
|
5
|
+
* passes within the timeout period. The assertion will run repeatedly
|
|
6
|
+
* at the specified interval and is considered to be passing when it
|
|
7
|
+
* does not throw or return `false`.
|
|
8
|
+
*
|
|
9
|
+
* If the assertion never passes within the timeout period, then the
|
|
10
|
+
* operation will throw with the last error received.
|
|
11
|
+
*
|
|
12
|
+
* @example Basic usage
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Wait for a value to become true
|
|
15
|
+
* yield* when(function*() {
|
|
16
|
+
* if (total !== 100) throw new Error(`expected 100, got ${total}`);
|
|
17
|
+
* return total;
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example With custom timeout
|
|
22
|
+
* ```ts
|
|
23
|
+
* // Wait up to 5 seconds for file to exist
|
|
24
|
+
* yield* when(function*() {
|
|
25
|
+
* let exists = yield* until(access(filePath).then(() => true, () => false));
|
|
26
|
+
* if (!exists) throw new Error("file not found");
|
|
27
|
+
* return true;
|
|
28
|
+
* }, { timeout: 5000 });
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Using the stats
|
|
32
|
+
* ```ts
|
|
33
|
+
* let stats = yield* when(function*() {
|
|
34
|
+
* return yield* until(readFile(path, "utf-8"));
|
|
35
|
+
* }, { timeout: 1000 });
|
|
36
|
+
*
|
|
37
|
+
* console.log(`Converged in ${stats.elapsed}ms after ${stats.runs} attempts`);
|
|
38
|
+
* console.log(stats.value); // file content
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param assertion - The assertion to converge on. Can be a generator function.
|
|
42
|
+
* @param options - Configuration options
|
|
43
|
+
* @returns Statistics about the convergence including the final value
|
|
44
|
+
*/
|
|
45
|
+
export function when(assertion, options = {}) {
|
|
46
|
+
return convergeOn(assertion, options, false);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Converges on an assertion by resolving when the given assertion
|
|
50
|
+
* passes consistently throughout the timeout period. The assertion
|
|
51
|
+
* will run repeatedly at the specified interval and is considered
|
|
52
|
+
* to be passing when it does not throw or return `false`.
|
|
53
|
+
*
|
|
54
|
+
* If the assertion fails at any point during the timeout period,
|
|
55
|
+
* the operation will throw immediately with that error.
|
|
56
|
+
*
|
|
57
|
+
* @example Basic usage
|
|
58
|
+
* ```ts
|
|
59
|
+
* // Ensure a value stays below 100 for 200ms
|
|
60
|
+
* yield* always(function*() {
|
|
61
|
+
* if (counter >= 100) throw new Error("counter exceeded limit");
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example With custom timeout
|
|
66
|
+
* ```ts
|
|
67
|
+
* // Verify connection stays alive for 5 seconds
|
|
68
|
+
* yield* always(function*() {
|
|
69
|
+
* if (!isConnected) throw new Error("connection lost");
|
|
70
|
+
* }, { timeout: 5000 });
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param assertion - The assertion to converge on. Can be a generator function.
|
|
74
|
+
* @param options - Configuration options
|
|
75
|
+
* @returns Statistics about the convergence including the final value
|
|
76
|
+
*/
|
|
77
|
+
export function always(assertion, options = {}) {
|
|
78
|
+
return convergeOn(assertion, options, true);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Internal convergence implementation.
|
|
82
|
+
*
|
|
83
|
+
* @param assertion - The assertion to run
|
|
84
|
+
* @param options - Configuration options
|
|
85
|
+
* @param alwaysMode - If true, assertion must pass throughout timeout (always behavior).
|
|
86
|
+
* If false, assertion must pass at least once (when behavior).
|
|
87
|
+
*/
|
|
88
|
+
function* convergeOn(assertion, options, alwaysMode) {
|
|
89
|
+
let timeout = options.timeout ?? (alwaysMode ? 200 : 2000);
|
|
90
|
+
let interval = options.interval ?? 10;
|
|
91
|
+
let start = Date.now();
|
|
92
|
+
let runs = 0;
|
|
93
|
+
let lastError = new Error("convergent assertion never ran");
|
|
94
|
+
let lastValue;
|
|
95
|
+
let result = yield* timebox(timeout, function* () {
|
|
96
|
+
while (true) {
|
|
97
|
+
runs++;
|
|
98
|
+
try {
|
|
99
|
+
let value = yield* assertion();
|
|
100
|
+
if (value === false) {
|
|
101
|
+
let error = new Error("convergent assertion returned `false`");
|
|
102
|
+
if (alwaysMode) {
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
lastError = error;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
lastValue = value;
|
|
109
|
+
if (!alwaysMode) {
|
|
110
|
+
// For `when`, success on first pass
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (alwaysMode) {
|
|
117
|
+
// For `always`, fail immediately on error
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
lastError = error;
|
|
121
|
+
}
|
|
122
|
+
yield* sleep(interval);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
let end = Date.now();
|
|
126
|
+
if (result.timeout) {
|
|
127
|
+
if (alwaysMode) {
|
|
128
|
+
// For `always`, reaching timeout without error means success
|
|
129
|
+
return {
|
|
130
|
+
start,
|
|
131
|
+
end,
|
|
132
|
+
elapsed: end - start,
|
|
133
|
+
runs,
|
|
134
|
+
timeout,
|
|
135
|
+
interval,
|
|
136
|
+
value: lastValue,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// For `when`, timeout means failure - throw the last error
|
|
140
|
+
throw lastError;
|
|
141
|
+
}
|
|
142
|
+
// Timebox completed without timeout (only happens for `when` on success)
|
|
143
|
+
return {
|
|
144
|
+
start,
|
|
145
|
+
end,
|
|
146
|
+
elapsed: end - start,
|
|
147
|
+
runs,
|
|
148
|
+
timeout,
|
|
149
|
+
interval,
|
|
150
|
+
value: result.value,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.scripthost.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.full.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/result.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/types.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/action.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/context.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/scope.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/suspend.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/sleep.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/interval.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/run.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/spawn.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/resource.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/call.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/race.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/all.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/lift.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/queue.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/signal.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/channel.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/each.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/ensure.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/events.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/abort-signal.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/main.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/with-resolvers.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/async.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/scoped.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/until.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/lib/mod.d.ts","../../node_modules/.pnpm/effection@4.0.0/node_modules/effection/esm/mod.d.ts","../../timebox/dist/mod.d.ts","../mod.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/compatibility/index.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/globals.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/web-globals/events.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/assert.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/assert/strict.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/async_hooks.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/buffer.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/child_process.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/cluster.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/console.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/constants.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/crypto.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/dgram.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/dns.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/dns/promises.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/domain.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/events.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/fs.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/fs/promises.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/http.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/http2.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/https.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/inspector.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/inspector.generated.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/module.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/net.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/os.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/path.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/perf_hooks.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/process.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/punycode.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/querystring.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/readline.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/readline/promises.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/repl.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/sea.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/sqlite.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/stream.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/stream/promises.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/stream/consumers.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/stream/web.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/string_decoder.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/test.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/timers.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/timers/promises.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/tls.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/trace_events.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/tty.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/url.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/util.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/v8.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/vm.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/wasi.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/worker_threads.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/zlib.d.ts","../../node_modules/.pnpm/@types+node@22.19.7/node_modules/@types/node/index.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/inc.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/classes/semver.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/parse.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/valid.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/clean.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/diff.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/major.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/minor.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/patch.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/compare.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/sort.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/gt.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/lt.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/eq.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/neq.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/gte.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/lte.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/classes/range.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/.pnpm/@types+semver@7.7.1/node_modules/@types/semver/index.d.ts"],"fileIdsList":[[92,93,100,148,165,166],[100,145,146,148,165,166],[100,147,148,165,166],[148,165,166],[100,148,153,165,166,183],[100,148,149,154,159,165,166,168,180,191],[100,148,149,150,159,165,166,168],[100,148,165,166],[95,96,97,100,148,165,166],[100,148,151,165,166,192],[100,148,152,153,160,165,166,169],[100,148,153,165,166,180,188],[100,148,154,156,159,165,166,168],[100,147,148,155,165,166],[100,148,156,157,165,166],[100,148,158,159,165,166],[100,147,148,159,165,166],[100,148,159,160,161,165,166,180,191],[100,148,159,160,161,165,166,175,180,183],[100,141,148,156,159,162,165,166,168,180,191],[100,148,159,160,162,163,165,166,168,180,188,191],[100,148,162,164,165,166,180,188,191],[98,99,100,101,102,103,104,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[100,148,159,165,166],[100,148,165,166,167,191],[100,148,156,159,165,166,168,180],[100,148,165,166,169],[100,148,165,166,170],[100,147,148,165,166,171],[100,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[100,148,165,166,173],[100,148,165,166,174],[100,148,159,165,166,175,176],[100,148,165,166,175,177,192,194],[100,148,160,165,166],[100,148,159,165,166,180,181,183],[100,148,165,166,182,183],[100,148,165,166,180,181],[100,148,165,166,183],[100,148,165,166,184],[100,145,148,165,166,180,185],[100,148,159,165,166,186,187],[100,148,165,166,186,187],[100,148,153,165,166,168,180,188],[100,148,165,166,189],[100,148,165,166,168,190],[100,148,162,165,166,174,191],[100,148,153,165,166,192],[100,148,165,166,180,193],[100,148,165,166,167,194],[100,148,165,166,195],[100,141,148,165,166],[100,141,148,159,161,165,166,171,180,183,191,193,194,196],[100,148,165,166,180,197],[100,148,165,166,200,238],[100,148,165,166,200,223,238],[100,148,165,166,199,238],[100,148,165,166,238],[100,148,165,166,200],[100,148,165,166,200,224,238],[100,148,165,166,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237],[100,148,165,166,224,238],[65,100,148,165,166],[64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,100,148,165,166],[65,79,100,148,165,166],[64,100,148,165,166],[91,100,148,165,166],[100,113,117,148,165,166,191],[100,113,148,165,166,180,191],[100,108,148,165,166],[100,110,113,148,165,166,188,191],[100,148,165,166,168,188],[100,148,165,166,198],[100,108,148,165,166,198],[100,110,113,148,165,166,168,191],[100,105,106,109,112,148,159,165,166,180,191],[100,113,120,148,165,166],[100,105,111,148,165,166],[100,113,134,135,148,165,166],[100,109,113,148,165,166,183,191,198],[100,134,148,165,166,198],[100,107,108,148,165,166,198],[100,113,148,165,166],[100,107,108,109,110,111,112,113,114,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,135,136,137,138,139,140,148,165,166],[100,113,128,148,165,166],[100,113,120,121,148,165,166],[100,111,113,121,122,148,165,166],[100,112,148,165,166],[100,105,108,113,148,165,166],[100,113,117,121,122,148,165,166],[100,117,148,165,166],[100,111,113,116,148,165,166,191],[100,105,110,113,120,148,165,166],[100,148,165,166,180],[100,108,113,134,148,165,166,196,198],[92,100,148,165,166]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3cbad9a1ba4453443026ed38e4b8be018abb26565fa7c944376463ad9df07c41","impliedFormat":1},{"version":"e32de52f3ffc3f0215daff1a7659206129d27ff9ad6d9d238d8690f617320ae1","impliedFormat":99},{"version":"3576d56b68bbb031b5b3272df4ad1dd8c4dcabcf74a8adb7c991aab25f791e9c","impliedFormat":99},{"version":"fab327816ac28cf1416dc55d8a7a11379cf3389d041feab1705a45fa32833d37","impliedFormat":99},{"version":"ca457ee0d78324892b4c8620c0f9b98997f82b8961f001839666a0d517f05f9d","impliedFormat":99},{"version":"70300a19bf0d810196c877fc850b877f7f76c35ac0f833bd27faf1099c43a70b","impliedFormat":99},{"version":"5876b0820db56ccac866e3cdc65fc1831b45adfa4cf60a96ac241a0033b9e5f9","impliedFormat":99},{"version":"384c14dba2c101c16907a016718c5810d803141f7e387016944ff097b724f772","impliedFormat":99},{"version":"138f9e90609b865bc32a00ef663515f5cf1f99194b108fc6e7457ff9ea2c67ba","impliedFormat":99},{"version":"9b3df5b39bd7b05de2bad2de1705d91751de4bf890dc89e49907fda39b5e3985","impliedFormat":99},{"version":"681e219477b42f2d28a448385579ebade44f2c69eec101560f504a01f44caf77","impliedFormat":99},{"version":"fc2f142af29f7c4579af8767a1a042ef9a8f8ee3c7f4de4129709017c3e4d37b","impliedFormat":99},{"version":"263698308657a3a163a3902f15c649fec9d1f3a0149b3788d86e85470b37d528","impliedFormat":99},{"version":"cc597920aca8d41fa235c5b6e740c493736cedcc6018da86e4cff58f1cc07013","impliedFormat":99},{"version":"4d80236469a38bda46fca261abb6e1b1280f46a60627bdfc28bf01281fc1108c","impliedFormat":99},{"version":"0a6fd4f2fc2a8f8859b9684aefef052bdd16ac4578491de39683a17afaa92921","impliedFormat":99},{"version":"07e3a5afd9c77935503c00a777665c9da5f7c507bbd22ef9d15f58373d6d815c","impliedFormat":99},{"version":"dbf0ec15156f1f18a94cfcbe0e5ff132bf5cddd3d3715705acd92b5405e94b56","impliedFormat":99},{"version":"adac9de93c7bbb078d85defc6a14f801fabeefce49121ef57c98d57b7140047f","impliedFormat":99},{"version":"f144ec90d6d2cc4799dd69bd651102816a62445b196c302d64f3c9af780a93b8","impliedFormat":99},{"version":"ad9eb36e4ec484a4111649db56daeeb926b1ab0d10104efdedd9197f7073809f","impliedFormat":99},{"version":"e9dcace6b450961972ed1ae9737be0aa3d6e72b49301536d7fe2a39b01224730","impliedFormat":99},{"version":"83b0cc7dad96cdc9591d57b858e4af4ecacac33d55dff4b92ea6f91baa356e4d","impliedFormat":99},{"version":"cd2952ebecad4d1eaab1150ff561064bff40e4e25903ddffbdedd3643415228b","impliedFormat":99},{"version":"76e3eccb2104ea0b8aa63ab70a00c1a74a5c6aa02cb475f05dadb85fb7d237af","impliedFormat":99},{"version":"02c6ee8bad964f26fc1397aa3172aae0c17a12ba921b045811ed2ce24c3fcc41","impliedFormat":99},{"version":"997863a7254d8eadb6b9993b9c50ba196aa7510a50585dc61bcb64acad68097d","impliedFormat":99},{"version":"54ba5885d706c6cf1c98a3856a9894919cca7d38aa23839f5e76a128ea723004","impliedFormat":99},{"version":"68fda81abab3797d5e1c5ea465e621995ef711a9c0939afdb923e1b8c421e407","impliedFormat":99},{"version":"009ac8daf7b0e45eecc7856ff1302ecc1d52d9cc63e8396129e1baabf967e1a8","impliedFormat":99},{"version":"22a9c6e4cc56bfabc1f8fa13a5aa9add370d83648356a4a32b0da88b8f782ea9","impliedFormat":99},{"version":"6057dc723074bf96219ed78d020b42ea8b1adce18b03efc7455a56326596cb69","signature":"7bcc2dd419f4953b6eedb31a048d81976c359160c40960256bb0ed04c9e4c911","impliedFormat":99},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"ce6a3f09b8db73a7e9701aca91a04b4fabaf77436dd35b24482f9ee816016b17","impliedFormat":1},{"version":"20e086e5b64fdd52396de67761cc0e94693494deadb731264aac122adf08de3f","impliedFormat":1},{"version":"6e78f75403b3ec65efb41c70d392aeda94360f11cedc9fb2c039c9ea23b30962","impliedFormat":1},{"version":"c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","impliedFormat":1},{"version":"8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","impliedFormat":1},{"version":"42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","impliedFormat":1},{"version":"ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","impliedFormat":1},{"version":"83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","impliedFormat":1},{"version":"1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","impliedFormat":1},{"version":"0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","impliedFormat":1},{"version":"cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","impliedFormat":1},{"version":"c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","impliedFormat":1},{"version":"eefd2bbc8edb14c3bd1246794e5c070a80f9b8f3730bd42efb80df3cc50b9039","impliedFormat":1},{"version":"0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","impliedFormat":1},{"version":"7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","impliedFormat":1},{"version":"bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","impliedFormat":1},{"version":"52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","impliedFormat":1},{"version":"770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","impliedFormat":1},{"version":"d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","impliedFormat":1},{"version":"799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","impliedFormat":1},{"version":"2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","impliedFormat":1},{"version":"9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","impliedFormat":1},{"version":"397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","impliedFormat":1},{"version":"a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","impliedFormat":1},{"version":"a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","impliedFormat":1},{"version":"c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","impliedFormat":1},{"version":"4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","impliedFormat":1},{"version":"f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","impliedFormat":1},{"version":"cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","impliedFormat":1},{"version":"b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","impliedFormat":1},{"version":"c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","impliedFormat":1},{"version":"14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","impliedFormat":1},{"version":"a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","impliedFormat":1},{"version":"f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","impliedFormat":1},{"version":"3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","impliedFormat":1},{"version":"662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","impliedFormat":1},{"version":"c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","impliedFormat":1},{"version":"2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","impliedFormat":1},{"version":"34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","impliedFormat":1},{"version":"a56fe175741cc8841835eb72e61fa5a34adcbc249ede0e3494c229f0750f6b85","impliedFormat":1}],"root":[94],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":199,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"..","skipLibCheck":true,"strict":true,"target":9},"referencedMap":[[94,1],[145,2],[146,2],[147,3],[100,4],[148,5],[149,6],[150,7],[95,8],[98,9],[96,8],[97,8],[151,10],[152,11],[153,12],[154,13],[155,14],[156,15],[157,15],[158,16],[159,17],[160,18],[161,19],[101,8],[99,8],[162,20],[163,21],[164,22],[198,23],[165,24],[166,8],[167,25],[168,26],[169,27],[170,28],[171,29],[172,30],[173,31],[174,32],[175,33],[176,33],[177,34],[178,8],[179,35],[180,36],[182,37],[181,38],[183,39],[184,40],[185,41],[186,42],[187,43],[188,44],[189,45],[190,46],[191,47],[192,48],[193,49],[194,50],[195,51],[102,8],[103,8],[104,8],[142,52],[143,8],[144,8],[196,53],[197,54],[223,55],[224,56],[200,57],[203,58],[221,55],[222,55],[212,55],[211,59],[209,55],[204,55],[217,55],[215,55],[219,55],[199,55],[216,55],[220,55],[205,55],[206,55],[218,55],[201,55],[207,55],[208,55],[210,55],[214,55],[225,60],[213,55],[202,55],[238,61],[237,8],[232,60],[234,62],[233,60],[226,60],[227,60],[229,60],[231,60],[235,62],[236,62],[228,62],[230,62],[85,63],[66,63],[77,63],[88,63],[75,63],[81,63],[67,63],[82,63],[83,63],[84,63],[71,63],[78,63],[86,63],[91,64],[79,63],[76,63],[74,63],[64,8],[72,63],[68,63],[89,63],[80,65],[70,63],[73,63],[69,63],[65,66],[90,63],[87,63],[92,67],[61,8],[62,8],[12,8],[10,8],[11,8],[16,8],[15,8],[2,8],[17,8],[18,8],[19,8],[20,8],[21,8],[22,8],[23,8],[24,8],[3,8],[25,8],[26,8],[4,8],[27,8],[31,8],[28,8],[29,8],[30,8],[32,8],[33,8],[34,8],[5,8],[35,8],[36,8],[37,8],[38,8],[6,8],[42,8],[39,8],[40,8],[41,8],[43,8],[7,8],[44,8],[49,8],[50,8],[45,8],[46,8],[47,8],[48,8],[8,8],[54,8],[51,8],[52,8],[53,8],[55,8],[9,8],[56,8],[63,8],[57,8],[58,8],[60,8],[59,8],[1,8],[14,8],[13,8],[120,68],[130,69],[119,68],[140,70],[111,71],[110,72],[139,73],[133,74],[138,75],[113,76],[127,77],[112,78],[136,79],[108,80],[107,73],[137,81],[109,82],[114,83],[115,8],[118,83],[105,8],[141,84],[131,85],[122,86],[123,87],[125,88],[121,89],[124,90],[134,73],[116,91],[117,92],[126,93],[106,94],[129,85],[128,83],[132,8],[135,95],[93,96]],"latestChangedDtsFile":"./mod.d.ts","version":"5.9.3"}
|
package/mod.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { timebox } from "@effectionx/timebox";
|
|
2
|
+
import type { Operation } from "effection";
|
|
3
|
+
import { sleep } from "effection";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Options for convergence operations.
|
|
7
|
+
*/
|
|
8
|
+
export interface ConvergeOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum time to wait for convergence in milliseconds.
|
|
11
|
+
* Default: 2000ms for `when`, 200ms for `always`
|
|
12
|
+
*/
|
|
13
|
+
timeout?: number;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Interval between assertion retries in milliseconds.
|
|
17
|
+
* Default: 10ms
|
|
18
|
+
*/
|
|
19
|
+
interval?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Statistics about a convergence operation.
|
|
24
|
+
*/
|
|
25
|
+
export interface ConvergeStats<T> {
|
|
26
|
+
/** Timestamp when convergence started */
|
|
27
|
+
start: number;
|
|
28
|
+
|
|
29
|
+
/** Timestamp when convergence ended */
|
|
30
|
+
end: number;
|
|
31
|
+
|
|
32
|
+
/** Milliseconds the convergence took */
|
|
33
|
+
elapsed: number;
|
|
34
|
+
|
|
35
|
+
/** Number of times the assertion was executed */
|
|
36
|
+
runs: number;
|
|
37
|
+
|
|
38
|
+
/** The timeout that was configured */
|
|
39
|
+
timeout: number;
|
|
40
|
+
|
|
41
|
+
/** The interval that was configured */
|
|
42
|
+
interval: number;
|
|
43
|
+
|
|
44
|
+
/** The return value from the assertion */
|
|
45
|
+
value: T;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Converges on an assertion by resolving when the given assertion
|
|
50
|
+
* passes within the timeout period. The assertion will run repeatedly
|
|
51
|
+
* at the specified interval and is considered to be passing when it
|
|
52
|
+
* does not throw or return `false`.
|
|
53
|
+
*
|
|
54
|
+
* If the assertion never passes within the timeout period, then the
|
|
55
|
+
* operation will throw with the last error received.
|
|
56
|
+
*
|
|
57
|
+
* @example Basic usage
|
|
58
|
+
* ```ts
|
|
59
|
+
* // Wait for a value to become true
|
|
60
|
+
* yield* when(function*() {
|
|
61
|
+
* if (total !== 100) throw new Error(`expected 100, got ${total}`);
|
|
62
|
+
* return total;
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @example With custom timeout
|
|
67
|
+
* ```ts
|
|
68
|
+
* // Wait up to 5 seconds for file to exist
|
|
69
|
+
* yield* when(function*() {
|
|
70
|
+
* let exists = yield* until(access(filePath).then(() => true, () => false));
|
|
71
|
+
* if (!exists) throw new Error("file not found");
|
|
72
|
+
* return true;
|
|
73
|
+
* }, { timeout: 5000 });
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example Using the stats
|
|
77
|
+
* ```ts
|
|
78
|
+
* let stats = yield* when(function*() {
|
|
79
|
+
* return yield* until(readFile(path, "utf-8"));
|
|
80
|
+
* }, { timeout: 1000 });
|
|
81
|
+
*
|
|
82
|
+
* console.log(`Converged in ${stats.elapsed}ms after ${stats.runs} attempts`);
|
|
83
|
+
* console.log(stats.value); // file content
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @param assertion - The assertion to converge on. Can be a generator function.
|
|
87
|
+
* @param options - Configuration options
|
|
88
|
+
* @returns Statistics about the convergence including the final value
|
|
89
|
+
*/
|
|
90
|
+
export function when<T>(
|
|
91
|
+
assertion: () => Operation<T>,
|
|
92
|
+
options: ConvergeOptions = {},
|
|
93
|
+
): Operation<ConvergeStats<T>> {
|
|
94
|
+
return convergeOn(assertion, options, false);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Converges on an assertion by resolving when the given assertion
|
|
99
|
+
* passes consistently throughout the timeout period. The assertion
|
|
100
|
+
* will run repeatedly at the specified interval and is considered
|
|
101
|
+
* to be passing when it does not throw or return `false`.
|
|
102
|
+
*
|
|
103
|
+
* If the assertion fails at any point during the timeout period,
|
|
104
|
+
* the operation will throw immediately with that error.
|
|
105
|
+
*
|
|
106
|
+
* @example Basic usage
|
|
107
|
+
* ```ts
|
|
108
|
+
* // Ensure a value stays below 100 for 200ms
|
|
109
|
+
* yield* always(function*() {
|
|
110
|
+
* if (counter >= 100) throw new Error("counter exceeded limit");
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @example With custom timeout
|
|
115
|
+
* ```ts
|
|
116
|
+
* // Verify connection stays alive for 5 seconds
|
|
117
|
+
* yield* always(function*() {
|
|
118
|
+
* if (!isConnected) throw new Error("connection lost");
|
|
119
|
+
* }, { timeout: 5000 });
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @param assertion - The assertion to converge on. Can be a generator function.
|
|
123
|
+
* @param options - Configuration options
|
|
124
|
+
* @returns Statistics about the convergence including the final value
|
|
125
|
+
*/
|
|
126
|
+
export function always<T>(
|
|
127
|
+
assertion: () => Operation<T>,
|
|
128
|
+
options: ConvergeOptions = {},
|
|
129
|
+
): Operation<ConvergeStats<T>> {
|
|
130
|
+
return convergeOn(assertion, options, true);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Internal convergence implementation.
|
|
135
|
+
*
|
|
136
|
+
* @param assertion - The assertion to run
|
|
137
|
+
* @param options - Configuration options
|
|
138
|
+
* @param alwaysMode - If true, assertion must pass throughout timeout (always behavior).
|
|
139
|
+
* If false, assertion must pass at least once (when behavior).
|
|
140
|
+
*/
|
|
141
|
+
function* convergeOn<T>(
|
|
142
|
+
assertion: () => Operation<T>,
|
|
143
|
+
options: ConvergeOptions,
|
|
144
|
+
alwaysMode: boolean,
|
|
145
|
+
): Operation<ConvergeStats<T>> {
|
|
146
|
+
let timeout = options.timeout ?? (alwaysMode ? 200 : 2000);
|
|
147
|
+
let interval = options.interval ?? 10;
|
|
148
|
+
let start = Date.now();
|
|
149
|
+
let runs = 0;
|
|
150
|
+
let lastError: Error = new Error("convergent assertion never ran");
|
|
151
|
+
let lastValue: T | undefined;
|
|
152
|
+
|
|
153
|
+
let result = yield* timebox(timeout, function* () {
|
|
154
|
+
while (true) {
|
|
155
|
+
runs++;
|
|
156
|
+
try {
|
|
157
|
+
let value = yield* assertion();
|
|
158
|
+
|
|
159
|
+
if (value === false) {
|
|
160
|
+
let error = new Error("convergent assertion returned `false`");
|
|
161
|
+
if (alwaysMode) {
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
lastError = error;
|
|
165
|
+
} else {
|
|
166
|
+
lastValue = value;
|
|
167
|
+
|
|
168
|
+
if (!alwaysMode) {
|
|
169
|
+
// For `when`, success on first pass
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
} catch (error) {
|
|
174
|
+
if (alwaysMode) {
|
|
175
|
+
// For `always`, fail immediately on error
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
lastError = error as Error;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
yield* sleep(interval);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
let end = Date.now();
|
|
186
|
+
|
|
187
|
+
if (result.timeout) {
|
|
188
|
+
if (alwaysMode) {
|
|
189
|
+
// For `always`, reaching timeout without error means success
|
|
190
|
+
return {
|
|
191
|
+
start,
|
|
192
|
+
end,
|
|
193
|
+
elapsed: end - start,
|
|
194
|
+
runs,
|
|
195
|
+
timeout,
|
|
196
|
+
interval,
|
|
197
|
+
value: lastValue as T,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// For `when`, timeout means failure - throw the last error
|
|
201
|
+
throw lastError;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Timebox completed without timeout (only happens for `when` on success)
|
|
205
|
+
return {
|
|
206
|
+
start,
|
|
207
|
+
end,
|
|
208
|
+
elapsed: end - start,
|
|
209
|
+
runs,
|
|
210
|
+
timeout,
|
|
211
|
+
interval,
|
|
212
|
+
value: result.value,
|
|
213
|
+
};
|
|
214
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@effectionx/converge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/mod.js",
|
|
6
|
+
"types": "./dist/mod.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"development": "./mod.ts",
|
|
10
|
+
"default": "./dist/mod.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"effection": "^3 || ^4"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@effectionx/timebox": "workspace:*"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "engineering@frontside.com",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/thefrontside/effectionx.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/thefrontside/effectionx/issues"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">= 22"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@effectionx/bdd": "workspace:*"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"rootDir": "."
|
|
6
|
+
},
|
|
7
|
+
"include": ["**/*.ts"],
|
|
8
|
+
"exclude": ["**/*.test.ts", "dist"],
|
|
9
|
+
"references": [
|
|
10
|
+
{
|
|
11
|
+
"path": "../bdd"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "../timebox"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|