@dynamic-labs/utils 1.0.0-alpha.3 → 1.0.0-alpha.4
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 +3 -3
- package/src/DeferredPromise/DeferredPromise.cjs +21 -0
- package/src/DeferredPromise/DeferredPromise.d.ts +13 -0
- package/src/DeferredPromise/DeferredPromise.js +17 -0
- package/src/DeferredPromise/index.d.ts +1 -0
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-11-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* update zerodev provider initialization ([#4015](https://github.com/dynamic-labs/DynamicAuth/issues/4015)) ([8faca00](https://github.com/dynamic-labs/DynamicAuth/commit/8faca00d414677adc5fecde451ca01da53fe9641))
|
|
8
|
+
|
|
2
9
|
## [1.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2023-11-28)
|
|
3
10
|
|
|
4
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"viem": "^1.5.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dynamic-labs/logger": "1.0.0-alpha.
|
|
33
|
-
"@dynamic-labs/types": "1.0.0-alpha.
|
|
32
|
+
"@dynamic-labs/logger": "1.0.0-alpha.4",
|
|
33
|
+
"@dynamic-labs/types": "1.0.0-alpha.4"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A DeferredPromise provides methods to manually resolve or reject a Promise.
|
|
7
|
+
* This is useful in scenarios where you need to resolve or reject a Promise
|
|
8
|
+
* outside of the executor function.
|
|
9
|
+
*
|
|
10
|
+
* @template T The type of the value with which the promise will be resolved.
|
|
11
|
+
*/
|
|
12
|
+
class DeferredPromise {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.promise = new Promise((resolve, reject) => {
|
|
15
|
+
this.resolve = resolve;
|
|
16
|
+
this.reject = reject;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.DeferredPromise = DeferredPromise;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A DeferredPromise provides methods to manually resolve or reject a Promise.
|
|
3
|
+
* This is useful in scenarios where you need to resolve or reject a Promise
|
|
4
|
+
* outside of the executor function.
|
|
5
|
+
*
|
|
6
|
+
* @template T The type of the value with which the promise will be resolved.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DeferredPromise<T> {
|
|
9
|
+
promise: Promise<T>;
|
|
10
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
11
|
+
reject: (reason?: any) => void;
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A DeferredPromise provides methods to manually resolve or reject a Promise.
|
|
3
|
+
* This is useful in scenarios where you need to resolve or reject a Promise
|
|
4
|
+
* outside of the executor function.
|
|
5
|
+
*
|
|
6
|
+
* @template T The type of the value with which the promise will be resolved.
|
|
7
|
+
*/
|
|
8
|
+
class DeferredPromise {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.promise = new Promise((resolve, reject) => {
|
|
11
|
+
this.resolve = resolve;
|
|
12
|
+
this.reject = reject;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { DeferredPromise };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeferredPromise } from './DeferredPromise';
|
package/src/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var sleep = require('./sleep/sleep.cjs');
|
|
|
32
32
|
var getOrMapViemChain = require('./getOrMapViemChain.cjs');
|
|
33
33
|
var retryableFn = require('./retryableFn.cjs');
|
|
34
34
|
var wrapMethodWithCallback = require('./wrapMethodWithCallback/wrapMethodWithCallback.cjs');
|
|
35
|
+
var DeferredPromise = require('./DeferredPromise/DeferredPromise.cjs');
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
@@ -79,3 +80,4 @@ exports.mapChain = getOrMapViemChain.mapChain;
|
|
|
79
80
|
exports.FALLBACK_UNDEFINED = retryableFn.FALLBACK_UNDEFINED;
|
|
80
81
|
exports.retryableFn = retryableFn.retryableFn;
|
|
81
82
|
exports.wrapMethodWithCallback = wrapMethodWithCallback.wrapMethodWithCallback;
|
|
83
|
+
exports.DeferredPromise = DeferredPromise.DeferredPromise;
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -28,3 +28,4 @@ export { sleep } from './sleep/sleep.js';
|
|
|
28
28
|
export { getChain, getOrMapViemChain, mapChain } from './getOrMapViemChain.js';
|
|
29
29
|
export { FALLBACK_UNDEFINED, retryableFn } from './retryableFn.js';
|
|
30
30
|
export { wrapMethodWithCallback } from './wrapMethodWithCallback/wrapMethodWithCallback.js';
|
|
31
|
+
export { DeferredPromise } from './DeferredPromise/DeferredPromise.js';
|