@knime/utils 1.6.2 → 1.7.1
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 +14 -0
- package/package.json +7 -2
- package/src/promise/createUnwrappedPromise.ts +17 -0
- package/src/promise/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @knime/utils
|
|
2
2
|
|
|
3
|
+
## 1.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b6c2eb9: add repository link to package.json
|
|
8
|
+
- Updated dependencies [b6c2eb9]
|
|
9
|
+
- @knime/styles@1.14.3
|
|
10
|
+
|
|
11
|
+
## 1.7.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 34a4517: Add createUnwrappedPromise util
|
|
16
|
+
|
|
3
17
|
## 1.6.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Internal utility functions and constants shared across @knime packages.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/knime/webapps-common.git",
|
|
8
|
+
"directory": "packages/utils"
|
|
9
|
+
},
|
|
5
10
|
"homepage": "https://knime.github.io/webapps-common/",
|
|
6
11
|
"license": "GPL 3 and Additional Permissions according to Sec. 7 (SEE the file LICENSE)",
|
|
7
12
|
"author": "KNIME AG, Zurich, Switzerland",
|
|
@@ -10,7 +15,7 @@
|
|
|
10
15
|
"date-fns": "2.30.0",
|
|
11
16
|
"date-fns-tz": "2.0.0",
|
|
12
17
|
"dompurify": "^3.2.7",
|
|
13
|
-
"@knime/styles": "1.14.
|
|
18
|
+
"@knime/styles": "1.14.3"
|
|
14
19
|
},
|
|
15
20
|
"peerDependencies": {
|
|
16
21
|
"consola": "3.x"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type UnwrappedPromise<T = unknown> = {
|
|
2
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
3
|
+
reject: (reason?: unknown) => void;
|
|
4
|
+
promise: Promise<T>;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const createUnwrappedPromise = <T>(): UnwrappedPromise<T> => {
|
|
8
|
+
let resolve: (value: T | PromiseLike<T>) => void = () => {};
|
|
9
|
+
let reject: (reason?: unknown) => void = () => {};
|
|
10
|
+
|
|
11
|
+
const promise = new Promise<T>((res, rej) => {
|
|
12
|
+
resolve = res;
|
|
13
|
+
reject = rej;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return { resolve, reject, promise };
|
|
17
|
+
};
|
package/src/promise/index.ts
CHANGED