get-promisable-result 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.d.ts +1 -3
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -1
- package/package.json +16 -10
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
declare const DEFAULT_RETRIES = 10;
|
|
2
|
-
declare const DEFAULT_DELAY = 10;
|
|
3
1
|
interface PromisableOptions {
|
|
4
2
|
retries?: number;
|
|
5
3
|
delay?: number;
|
|
@@ -7,4 +5,4 @@ interface PromisableOptions {
|
|
|
7
5
|
rejectMessage?: string;
|
|
8
6
|
}
|
|
9
7
|
declare const getPromisableResult: <T>(getResultFunction: () => T, checkResult: (result: T) => boolean, options?: PromisableOptions) => Promise<T>;
|
|
10
|
-
export {
|
|
8
|
+
export { PromisableOptions, getPromisableResult };
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=
|
|
1
|
+
var e=function(e,r,t){var o;void 0===t&&(t={});var i=t.retries,n=void 0===i?10:i,s=t.delay,a=void 0===s?10:s,v=t.shouldReject,u=void 0===v||v,c=null!==(o=t.rejectMessage)&&void 0!==o?o:"Could not get the result after {{ retries }} retries";return new Promise((function(t,o){var i=0,s=function(){var v=e();r(v)?t(v):++i<n?setTimeout(s,a):u?o(new Error(c.replace(/\{\{\s*retries\s*\}\}/g,"".concat(n)))):t(v)};s()}))};export{e as getPromisableResult};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
declare const DEFAULT_RETRIES = 10;
|
|
2
|
-
declare const DEFAULT_DELAY = 10;
|
|
3
1
|
interface PromisableOptions {
|
|
4
2
|
retries?: number;
|
|
5
3
|
delay?: number;
|
|
@@ -7,4 +5,4 @@ interface PromisableOptions {
|
|
|
7
5
|
rejectMessage?: string;
|
|
8
6
|
}
|
|
9
7
|
declare const getPromisableResult: <T>(getResultFunction: () => T, checkResult: (result: T) => boolean, options?: PromisableOptions) => Promise<T>;
|
|
10
|
-
export {
|
|
8
|
+
export { PromisableOptions, getPromisableResult };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.
|
|
1
|
+
"use strict";exports.getPromisableResult=function(e,r,t){var o;void 0===t&&(t={});var s=t.retries,i=void 0===s?10:s,n=t.delay,u=void 0===n?10:n,a=t.shouldReject,c=void 0===a||a,l=null!==(o=t.rejectMessage)&&void 0!==o?o:"Could not get the result after {{ retries }} retries";return new Promise((function(t,o){var s=0,n=function(){var a=e();r(a)?t(a):++s<i?setTimeout(n,u):c?o(new Error(l.replace(/\{\{\s*retries\s*\}\}/g,"".concat(i)))):t(a)};n()}))};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "get-promisable-result",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A very small JavaScript utility to check and retry a function a limited number of times abstracting it in a Promise",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"promise",
|
|
@@ -51,16 +51,22 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@rollup/plugin-terser": "^0.4.4",
|
|
53
53
|
"@types/eslint": "^9.6.1",
|
|
54
|
-
"@types/jest": "^
|
|
55
|
-
"@types/node": "^
|
|
56
|
-
"eslint": "^9.
|
|
57
|
-
"globals": "^
|
|
58
|
-
"jest": "^
|
|
59
|
-
"rollup": "4.
|
|
54
|
+
"@types/jest": "^30.0.0",
|
|
55
|
+
"@types/node": "^25.0.10",
|
|
56
|
+
"eslint": "^9.39.2",
|
|
57
|
+
"globals": "^17.1.0",
|
|
58
|
+
"jest": "^30.2.0",
|
|
59
|
+
"rollup": "4.56.0",
|
|
60
60
|
"rollup-plugin-ts": "^3.4.5",
|
|
61
|
-
"ts-jest": "^29.
|
|
61
|
+
"ts-jest": "^29.4.6",
|
|
62
62
|
"tslib": "^2.7.0",
|
|
63
|
-
"typescript": "^5.
|
|
64
|
-
"typescript-eslint": "^8.
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"typescript-eslint": "^8.53.1"
|
|
65
|
+
},
|
|
66
|
+
"pnpm": {
|
|
67
|
+
"overrides": {
|
|
68
|
+
"glob@>=10.3.7 <=11.0.3": ">=11.1.0",
|
|
69
|
+
"js-yaml@<4.1.1": ">=4.1.1"
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
}
|