@handy-common-utils/promise-utils 1.6.0 → 1.7.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/README.md +478 -118
- package/dist/promise-utils.d.ts +248 -14
- package/dist/promise-utils.d.ts.map +1 -1
- package/dist/promise-utils.js +343 -22
- package/package.json +1 -1
package/dist/promise-utils.d.ts
CHANGED
|
@@ -149,21 +149,76 @@ export declare abstract class PromiseUtils {
|
|
|
149
149
|
static inParallel<Data, Result, TError = Result>(parallelism: number, jobs: Iterable<Data>, operation: (job: Data, index: number) => Promise<Result>, options?: {
|
|
150
150
|
abortOnError: boolean;
|
|
151
151
|
}): Promise<Array<Result | TError>>;
|
|
152
|
+
/**
|
|
153
|
+
* Creates a cancellable timer that will resolve after a specified number of milliseconds.
|
|
154
|
+
*
|
|
155
|
+
* The returned object contains:
|
|
156
|
+
* - `stop()` to cancel the scheduled resolution (if called before the timer fires). Calling
|
|
157
|
+
* `stop()` prevents the promise from being settled by this timer.
|
|
158
|
+
* - `promise` which will resolve with the supplied `result` (or the value returned by the
|
|
159
|
+
* `result` function) after `ms` milliseconds unless `stop()` is called first.
|
|
160
|
+
*
|
|
161
|
+
* Note: If the `result` is a function that returns a Promise, the returned `promise` will
|
|
162
|
+
* resolve with that Promise's resolution (i.e. it behaves like resolving with a PromiseLike).
|
|
163
|
+
*
|
|
164
|
+
* @param ms The number of milliseconds after which the scheduled resolution will occur.
|
|
165
|
+
* @param result The result to be resolved by the Promise, or a function that supplies the result.
|
|
166
|
+
* @returns An object with `stop()` and `promise`.
|
|
167
|
+
*/
|
|
168
|
+
static cancellableDelayedResolve<T>(ms: number, result?: T | PromiseLike<T> | (() => (T | PromiseLike<T>))): {
|
|
169
|
+
stop: () => void;
|
|
170
|
+
promise: Promise<T>;
|
|
171
|
+
};
|
|
152
172
|
/**
|
|
153
173
|
* Creates a Promise that resolves after a specified number of milliseconds.
|
|
154
174
|
*
|
|
175
|
+
* The `result` argument may be:
|
|
176
|
+
* - a value to resolve with,
|
|
177
|
+
* - a PromiseLike whose resolution will be adopted by the returned Promise, or
|
|
178
|
+
* - a function which is invoked when the timer fires and may return a value or a PromiseLike.
|
|
179
|
+
*
|
|
180
|
+
* If `result` is a function, it is called when the timer elapses; if it returns a Promise,
|
|
181
|
+
* the returned Promise will adopt that Promise's outcome.
|
|
182
|
+
*
|
|
155
183
|
* @param ms The number of milliseconds after which the created Promise will resolve.
|
|
156
184
|
* @param result The result to be resolved by the Promise, or a function that supplies the result.
|
|
157
|
-
* @returns A
|
|
185
|
+
* @returns A Promise that resolves with the specified result after the specified delay.
|
|
158
186
|
*/
|
|
159
187
|
static delayedResolve<T>(ms: number, result?: T | PromiseLike<T> | (() => (T | PromiseLike<T>))): Promise<T>;
|
|
188
|
+
/**
|
|
189
|
+
* Creates a cancellable timer that will reject after a specified number of milliseconds.
|
|
190
|
+
*
|
|
191
|
+
* The returned object contains:
|
|
192
|
+
* - `stop()` to cancel the scheduled rejection (if called before the timer fires). Calling
|
|
193
|
+
* `stop()` prevents the promise from being settled by this timer.
|
|
194
|
+
* - `promise` which will reject with the supplied `reason` (or the value returned by the
|
|
195
|
+
* `reason` function) after `ms` milliseconds unless `stop()` is called first.
|
|
196
|
+
*
|
|
197
|
+
* If the `reason` is a PromiseLike that rejects, its rejection value will be used as the rejection reason.
|
|
198
|
+
*
|
|
199
|
+
* @param ms The number of milliseconds after which the scheduled rejection will occur.
|
|
200
|
+
* @param reason The reason for the rejection, or a function that supplies the reason.
|
|
201
|
+
* @returns An object with `stop()` and `promise`.
|
|
202
|
+
*/
|
|
203
|
+
static cancellableDelayedReject<T = never, R = any>(ms: number, reason: R | PromiseLike<R> | (() => R | PromiseLike<R>)): {
|
|
204
|
+
stop: () => void;
|
|
205
|
+
promise: Promise<T>;
|
|
206
|
+
};
|
|
160
207
|
/**
|
|
161
208
|
* Creates a Promise that rejects after a specified number of milliseconds.
|
|
162
209
|
*
|
|
210
|
+
* The `reason` argument may be:
|
|
211
|
+
* - a value to reject with,
|
|
212
|
+
* - a PromiseLike whose rejection will be adopted by the returned Promise, or
|
|
213
|
+
* - a function which is invoked when the timer fires and may return a value or a PromiseLike.
|
|
214
|
+
*
|
|
215
|
+
* If `reason` is a function, it is called when the timer elapses; if it returns a Promise,
|
|
216
|
+
* the returned Promise will reject with that Promise's rejection reason (or reject with the
|
|
217
|
+
* returned value if it resolves).
|
|
218
|
+
*
|
|
163
219
|
* @param ms The number of milliseconds after which the created Promise will reject.
|
|
164
220
|
* @param reason The reason for the rejection, or a function that supplies the reason.
|
|
165
|
-
*
|
|
166
|
-
* @returns A new Promise that rejects with the specified reason after the specified delay.
|
|
221
|
+
* @returns A Promise that rejects with the specified reason after the specified delay.
|
|
167
222
|
*/
|
|
168
223
|
static delayedReject<T = never, R = any>(ms: number, reason: R | PromiseLike<R> | (() => R | PromiseLike<R>)): Promise<T>;
|
|
169
224
|
/**
|
|
@@ -222,49 +277,228 @@ export declare abstract class PromiseUtils {
|
|
|
222
277
|
* @returns The result of the operation function.
|
|
223
278
|
*/
|
|
224
279
|
static synchronised<T>(lock: any, operation: (previousState: PromiseState | undefined, previousSettledState: PromiseState | undefined, previousResult: any) => Promise<T>): Promise<T>;
|
|
280
|
+
/**
|
|
281
|
+
* Runs an operation periodically with configurable intervals and stopping conditions.
|
|
282
|
+
*
|
|
283
|
+
* - `interval` may be a single number (ms), an array of numbers, or a function
|
|
284
|
+
* that receives the iteration number (starting at 1) and returns the next
|
|
285
|
+
* interval in milliseconds or `undefined` to stop.
|
|
286
|
+
* - If the interval array runs out of elements or the function returns `undefined`
|
|
287
|
+
* (or a negative value), no further invocations will be scheduled.
|
|
288
|
+
*
|
|
289
|
+
* Options:
|
|
290
|
+
* - `maxExecutions` stop after N runs (inclusive).
|
|
291
|
+
* - `maxDurationMs` stop after elapsed ms since the first scheduled start.
|
|
292
|
+
* - `schedule` controls how the interval is measured:
|
|
293
|
+
* - `'delayAfterEnd'`: wait the interval after the previous operation completes
|
|
294
|
+
* before scheduling the next one (equivalent to a fixed delay between ends).
|
|
295
|
+
* - `'delayBetweenStarts'`: keep start times on a regular schedule (interval measured
|
|
296
|
+
* between the starts of successive operations).
|
|
297
|
+
* The default schedule is `'delayBetweenStarts'`.
|
|
298
|
+
*
|
|
299
|
+
* Returns an object with `stop()` to cancel further executions and `done` which
|
|
300
|
+
* resolves when the periodic runner stops. If the provided `operation` throws or
|
|
301
|
+
* rejects, the `done` promise will reject with that error so callers can handle it.
|
|
302
|
+
*
|
|
303
|
+
* Note: The first invocation of `operation` is scheduled after the first interval
|
|
304
|
+
* elapses (i.e. this function does NOT call `operation` immediately). If you need
|
|
305
|
+
* an immediate run, invoke `operation(1)` yourself before calling `runPeriodically`.
|
|
306
|
+
*
|
|
307
|
+
* @template T The operation return type (ignored by the runner; used for typing).
|
|
308
|
+
* @param operation Function to run each iteration. Receives the iteration index (1-based).
|
|
309
|
+
* @param interval Number | number[] | ((iteration: number) => number|undefined) defining waits.
|
|
310
|
+
* @param options Optional configuration.
|
|
311
|
+
* @returns An object containing `stop()` to cancel further executions and `done` Promise
|
|
312
|
+
* which resolves when the periodic runner stops (or rejects if the operation errors).
|
|
313
|
+
*/
|
|
314
|
+
static runPeriodically<T>(operation: (iteration: number) => Promise<T> | T, interval: number | Array<number> | ((iteration: number) => number | undefined), options?: {
|
|
315
|
+
maxExecutions?: number;
|
|
316
|
+
maxDurationMs?: number;
|
|
317
|
+
schedule?: 'delayAfterEnd' | 'delayBetweenStarts';
|
|
318
|
+
}): {
|
|
319
|
+
stop: () => void;
|
|
320
|
+
done: Promise<void>;
|
|
321
|
+
};
|
|
225
322
|
}
|
|
226
323
|
/**
|
|
227
|
-
*
|
|
324
|
+
* Executes an operation repeatedly and collects all the results.
|
|
325
|
+
* This function is very useful for many scenarios, such like client-side pagination.
|
|
326
|
+
*
|
|
327
|
+
* @param operation A function that takes a parameter as input and returns a result. Typically, the parameter has optional fields to control paging.
|
|
328
|
+
* @param nextParameter A function for calculating the next parameter from the operation result. Normally, this parameter controls paging. This function should return null when no further invocation of the operation function is desired. If further invocation is desired, the return value of this function can be a Promise or a non-Promise value.
|
|
329
|
+
* @param collect A function for merging the operation result into the collection.
|
|
330
|
+
* @param initialCollection The initial collection, which will be the first argument passed to the first invocation of the collect function.
|
|
331
|
+
* @param initialParameter The parameter for the first operation.
|
|
332
|
+
* @returns A promise that resolves to a collection of all the results returned by the operation function.
|
|
228
333
|
*/
|
|
229
334
|
export declare const repeat: typeof PromiseUtils.repeat;
|
|
230
335
|
/**
|
|
231
|
-
*
|
|
336
|
+
* Repeatedly performs an operation until a specified criteria is met.
|
|
337
|
+
*
|
|
338
|
+
* @param operation A function that outputs a Promise result. Typically, the operation does not use its arguments.
|
|
339
|
+
* @param backoff An array of retry backoff periods (in milliseconds) or a function for calculating them.
|
|
340
|
+
* @param shouldRetry A predicate function for deciding whether another call to the operation should occur.
|
|
341
|
+
* @returns A promise of the operation result, potentially with retries applied.
|
|
232
342
|
*/
|
|
233
343
|
export declare const withRetry: typeof PromiseUtils.withRetry;
|
|
234
344
|
/**
|
|
235
|
-
*
|
|
345
|
+
* Executes multiple jobs/operations with a specified level of concurrency.
|
|
346
|
+
*
|
|
347
|
+
* @param concurrency The number of jobs/operations to run concurrently.
|
|
348
|
+
* @param jobs The job data to be processed. This function can handle an infinite or unknown number of elements safely.
|
|
349
|
+
* @param operation The function that processes job data asynchronously.
|
|
350
|
+
* @returns A promise that resolves to an array containing the results from the operation function.
|
|
351
|
+
* The results in the returned array are in the same order as the corresponding elements in the jobs array.
|
|
236
352
|
*/
|
|
237
353
|
export declare const withConcurrency: typeof PromiseUtils.withConcurrency;
|
|
238
354
|
/**
|
|
239
|
-
*
|
|
355
|
+
* Executes multiple jobs/operations in parallel. By default, all operations are executed regardless of any failures.
|
|
356
|
+
* In most cases, using withConcurrency might be more convenient.
|
|
357
|
+
*
|
|
358
|
+
* By default, this function does not throw or reject an error when any job/operation fails.
|
|
359
|
+
* Errors from operations are returned alongside results in the returned array.
|
|
360
|
+
* This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
361
|
+
*
|
|
362
|
+
* If options.abortOnError is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
363
|
+
* In this mode, some jobs/operations may not be executed if one fails.
|
|
364
|
+
*
|
|
365
|
+
* @param parallelism The number of jobs/operations to run concurrently.
|
|
366
|
+
* @param jobs The job data to be processed. This function can safely handle an infinite or unknown number of elements.
|
|
367
|
+
* @param operation The function that processes job data asynchronously.
|
|
368
|
+
* @param options Options to control the function's behavior.
|
|
369
|
+
* @param options.abortOnError If true, the function aborts and throws an error on the first failed operation.
|
|
370
|
+
* @returns A promise that resolves to an array containing the results of the operations.
|
|
371
|
+
* Each element is either a fulfilled result or a rejected error/reason.
|
|
372
|
+
* The results or errors in the returned array are in the same order as the corresponding elements in the jobs array.
|
|
240
373
|
*/
|
|
241
374
|
export declare const inParallel: typeof PromiseUtils.inParallel;
|
|
242
375
|
/**
|
|
243
|
-
*
|
|
376
|
+
* Creates a Promise that resolves after a specified number of milliseconds.
|
|
377
|
+
*
|
|
378
|
+
* The result argument may be:
|
|
379
|
+
* - a value to resolve with,
|
|
380
|
+
* - a PromiseLike whose resolution will be adopted by the returned Promise, or
|
|
381
|
+
* - a function which is invoked when the timer fires and may return a value or a PromiseLike.
|
|
382
|
+
*
|
|
383
|
+
* If result is a function, it is called when the timer elapses; if it returns a Promise,
|
|
384
|
+
* the returned Promise will adopt that Promise's outcome.
|
|
385
|
+
*
|
|
386
|
+
* @param ms The number of milliseconds after which the created Promise will resolve.
|
|
387
|
+
* @param result The result to be resolved by the Promise, or a function that supplies the result.
|
|
388
|
+
* @returns A Promise that resolves with the specified result after the specified delay.
|
|
244
389
|
*/
|
|
245
390
|
export declare const delayedResolve: typeof PromiseUtils.delayedResolve;
|
|
246
391
|
/**
|
|
247
|
-
*
|
|
392
|
+
* Creates a Promise that rejects after a specified number of milliseconds.
|
|
393
|
+
*
|
|
394
|
+
* The reason argument may be:
|
|
395
|
+
* - a value to reject with,
|
|
396
|
+
* - a PromiseLike whose rejection will be adopted by the returned Promise, or
|
|
397
|
+
* - a function which is invoked when the timer fires and may return a value or a PromiseLike.
|
|
398
|
+
*
|
|
399
|
+
* If reason is a function, it is called when the timer elapses; if it returns a Promise,
|
|
400
|
+
* the returned Promise will reject with that Promise's rejection reason (or reject with the
|
|
401
|
+
* returned value if it resolves).
|
|
402
|
+
*
|
|
403
|
+
* @param ms The number of milliseconds after which the created Promise will reject.
|
|
404
|
+
* @param reason The reason for the rejection, or a function that supplies the reason.
|
|
405
|
+
* @returns A Promise that rejects with the specified reason after the specified delay.
|
|
248
406
|
*/
|
|
249
407
|
export declare const delayedReject: typeof PromiseUtils.delayedReject;
|
|
250
408
|
/**
|
|
251
|
-
*
|
|
409
|
+
* Creates a cancellable timer that will resolve after a specified number of milliseconds.
|
|
410
|
+
*
|
|
411
|
+
* The returned object contains:
|
|
412
|
+
* - stop() to cancel the scheduled resolution (if called before the timer fires). Calling
|
|
413
|
+
* stop() prevents the promise from being settled by this timer.
|
|
414
|
+
* - promise which will resolve with the supplied result (or the value returned by the
|
|
415
|
+
* result function) after ms milliseconds unless stop() is called first.
|
|
416
|
+
*
|
|
417
|
+
* If the result is a PromiseLike, its resolution value will be used as the resolved value.
|
|
418
|
+
*
|
|
419
|
+
* @param ms The number of milliseconds after which the scheduled resolution will occur.
|
|
420
|
+
* @param result The result to be resolved by the Promise, or a function that supplies the result.
|
|
421
|
+
* @returns An object with stop() and promise.
|
|
422
|
+
*/
|
|
423
|
+
export declare const cancellableDelayedResolve: typeof PromiseUtils.cancellableDelayedResolve;
|
|
424
|
+
/**
|
|
425
|
+
* Creates a cancellable timer that will reject after a specified number of milliseconds.
|
|
426
|
+
*
|
|
427
|
+
* The returned object contains:
|
|
428
|
+
* - stop() to cancel the scheduled rejection (if called before the timer fires). Calling
|
|
429
|
+
* stop() prevents the promise from being settled by this timer.
|
|
430
|
+
* - promise which will reject with the supplied reason (or the value returned by the
|
|
431
|
+
* reason function) after ms milliseconds unless stop() is called first.
|
|
432
|
+
*
|
|
433
|
+
* If the reason is a PromiseLike that rejects, its rejection value will be used as the rejection reason.
|
|
434
|
+
*
|
|
435
|
+
* @param ms The number of milliseconds after which the scheduled rejection will occur.
|
|
436
|
+
* @param reason The reason for the rejection, or a function that supplies the reason.
|
|
437
|
+
* @returns An object with stop() and promise.
|
|
438
|
+
*/
|
|
439
|
+
export declare const cancellableDelayedReject: typeof PromiseUtils.cancellableDelayedReject;
|
|
440
|
+
/**
|
|
441
|
+
* Applies a timeout to a Promise or a function that returns a Promise.
|
|
442
|
+
* If the timeout occurs, the returned Promise resolves to the specified result.
|
|
443
|
+
* If the timeout does not occur, the returned Promise resolves or rejects based on the outcome of the original Promise.
|
|
444
|
+
* If the result parameter is a function and the timeout does not occur, the function will not be called.
|
|
445
|
+
* Note: The rejection of the operation parameter is not handled by this function.
|
|
446
|
+
* You may want to handle it outside this function to avoid warnings like "(node:4330) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously."
|
|
447
|
+
*
|
|
448
|
+
* @param operation The original Promise or a function that returns a Promise to which the timeout will be applied.
|
|
449
|
+
* @param ms The number of milliseconds for the timeout.
|
|
450
|
+
* @param result The result to resolve with if the timeout occurs, or a function that supplies the result.
|
|
451
|
+
* @returns A new Promise that resolves to the specified result if the timeout occurs.
|
|
252
452
|
*/
|
|
253
453
|
export declare const timeoutResolve: typeof PromiseUtils.timeoutResolve;
|
|
254
454
|
/**
|
|
255
|
-
*
|
|
455
|
+
* Applies a timeout to a Promise or a function that returns a Promise.
|
|
456
|
+
* If the timeout occurs, the returned Promise rejects with the specified reason.
|
|
457
|
+
* If the timeout does not occur, the returned Promise resolves or rejects based on the outcome of the original Promise.
|
|
458
|
+
* If the rejectReason parameter is a function and the timeout does not occur, the function will not be called.
|
|
459
|
+
* Note: The rejection of the operation parameter is not handled by this function. You may want to handle it outside this function to avoid warnings like "(node:4330) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously."
|
|
460
|
+
*
|
|
461
|
+
* @param operation The original Promise or a function that returns a Promise to which the timeout will be applied.
|
|
462
|
+
* @param ms The number of milliseconds for the timeout.
|
|
463
|
+
* @param rejectReason The reason to reject with if the timeout occurs, or a function that supplies the reason.
|
|
464
|
+
* @returns A new Promise that rejects with the specified reason if the timeout occurs.
|
|
256
465
|
*/
|
|
257
466
|
export declare const timeoutReject: typeof PromiseUtils.timeoutReject;
|
|
258
467
|
/**
|
|
259
|
-
*
|
|
468
|
+
* Provides mutual exclusion similar to synchronized in Java.
|
|
469
|
+
* Ensures no concurrent execution of any operation function associated with the same lock.
|
|
470
|
+
* The operation function has access to the state (when synchronized is called),
|
|
471
|
+
* settledState (when the operation function is called),
|
|
472
|
+
* and result (either the fulfilled result or the rejected reason) of the previous operation.
|
|
473
|
+
* If there is no previous invocation, state, settledState, and result will all be undefined.
|
|
474
|
+
*
|
|
475
|
+
* @param lock The object (such as a string, a number, or this in a class) used to identify the lock.
|
|
476
|
+
* @param operation The function that performs the computation and returns a Promise.
|
|
477
|
+
* @returns The result of the operation function.
|
|
260
478
|
*/
|
|
261
479
|
export declare const synchronized: typeof PromiseUtils.synchronized;
|
|
262
480
|
/**
|
|
263
|
-
*
|
|
481
|
+
* This is just another spelling of synchronized.
|
|
482
|
+
* @param lock The object (such as a string, a number, or this in a class) used to identify the lock.
|
|
483
|
+
* @param operation The function that performs the computation and returns a Promise.
|
|
484
|
+
* @returns The result of the operation function.
|
|
264
485
|
*/
|
|
265
486
|
export declare const synchronised: typeof PromiseUtils.synchronised;
|
|
266
487
|
/**
|
|
267
|
-
*
|
|
488
|
+
* Retrieves the state of the specified Promise.
|
|
489
|
+
* Note: The returned value is a Promise that resolves immediately.
|
|
490
|
+
*
|
|
491
|
+
* @param p The Promise whose state is to be determined.
|
|
492
|
+
* @returns A Promise that resolves immediately with the state of the input Promise.
|
|
268
493
|
*/
|
|
269
494
|
export declare const promiseState: typeof PromiseUtils.promiseState;
|
|
495
|
+
/**
|
|
496
|
+
* Runs an operation periodically with configurable intervals and stopping conditions.
|
|
497
|
+
*
|
|
498
|
+
* @param operation The operation to run periodically.
|
|
499
|
+
* @param interval The interval (ms), array of intervals, or function returning interval per iteration.
|
|
500
|
+
* @param options Options for maxExecutions, maxDurationMs, and schedule type.
|
|
501
|
+
* @returns An object with stop() and done Promise which resolves when the periodic runner stops (or rejects if the operation errors).
|
|
502
|
+
*/
|
|
503
|
+
export declare const runPeriodically: typeof PromiseUtils.runPeriodically;
|
|
270
504
|
//# sourceMappingURL=promise-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-utils.d.ts","sourceRoot":"","sources":["../src/promise-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,UAAkJ,CAAC;AAElL;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,UAA6K,CAAC;AAE/M;;GAEG;AACH,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;CACtB;AAED,8BAAsB,YAAY;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;WACU,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAC3C,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,EACzD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,EACpF,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,UAAU,EAC/D,iBAAiB,EAAE,UAAU,EAC7B,gBAAgB,GAAE,OAAO,CAAC,KAAK,CAAM,GACpC,OAAO,CAAC,UAAU,CAAC;IAetB;;;;;;;;;;;;;;;;;;;;;OAqBG;WAC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