@vpmedia/simplify 1.73.0 → 1.74.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/util/async.js +3 -2
- package/types/util/async.d.ts +1 -1
- package/types/util/async.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/util/async.js
CHANGED
|
@@ -12,10 +12,11 @@ export const delayPromise = (delayMS) =>
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Async method call retry helper.
|
|
15
|
-
* @
|
|
15
|
+
* @template T
|
|
16
|
+
* @param {() => Promise<T>} method - Async function to call.
|
|
16
17
|
* @param {number} numTries - Max retries.
|
|
17
18
|
* @param {number} delayMs - Delay between attempts in ms.
|
|
18
|
-
* @returns {Promise<
|
|
19
|
+
* @returns {Promise<T>} Async function result.
|
|
19
20
|
*/
|
|
20
21
|
export const retryAsync = async (method, numTries = 1, delayMs = 100) => {
|
|
21
22
|
for (let attempt = 0; attempt <= numTries; attempt += 1) {
|
package/types/util/async.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export function delayPromise(delayMS: number): Promise<void>;
|
|
2
|
-
export function retryAsync(method:
|
|
2
|
+
export function retryAsync<T>(method: () => Promise<T>, numTries?: number, delayMs?: number): Promise<T>;
|
|
3
3
|
export function loadJSON(url: string): Promise<unknown>;
|
|
4
4
|
//# sourceMappingURL=async.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/util/async.js"],"names":[],"mappings":"AAOO,sCAHI,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAKtB;
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/util/async.js"],"names":[],"mappings":"AAOO,sCAHI,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAKtB;AAUG,2BANM,CAAC,UACH,MAAM,OAAO,CAAC,CAAC,CAAC,aAChB,MAAM,YACN,MAAM,GACJ,OAAO,CAAC,CAAC,CAAC,CAkBtB;AAOM,8BAHI,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAQ5B"}
|