@tb-dev/utils 3.0.0 → 3.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/index.cjs
CHANGED
|
@@ -53,11 +53,11 @@ function splitWhitespace(value) {
|
|
|
53
53
|
function sleep(ms) {
|
|
54
54
|
return new Promise((resolve) => void setTimeout(resolve, ms));
|
|
55
55
|
}
|
|
56
|
-
class
|
|
56
|
+
class PromiseSet {
|
|
57
57
|
constructor() {
|
|
58
58
|
__publicField(this, "promises", /* @__PURE__ */ new Set());
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
and(promise) {
|
|
61
61
|
this.promises.add(promise);
|
|
62
62
|
return this;
|
|
63
63
|
}
|
|
@@ -65,9 +65,6 @@ class PromiseChain {
|
|
|
65
65
|
await Promise.all(this.promises);
|
|
66
66
|
this.promises.clear();
|
|
67
67
|
}
|
|
68
|
-
static create() {
|
|
69
|
-
return new PromiseChain();
|
|
70
|
-
}
|
|
71
68
|
}
|
|
72
69
|
function flushPromises() {
|
|
73
70
|
return new Promise((resolve) => void setTimeout(resolve, 0));
|
|
@@ -95,7 +92,7 @@ function toPixel(value) {
|
|
|
95
92
|
}
|
|
96
93
|
return value;
|
|
97
94
|
}
|
|
98
|
-
exports.
|
|
95
|
+
exports.PromiseSet = PromiseSet;
|
|
99
96
|
exports.flushPromises = flushPromises;
|
|
100
97
|
exports.isEmpty = isEmpty;
|
|
101
98
|
exports.isNullish = isNullish;
|
package/dist/index.js
CHANGED
|
@@ -51,11 +51,11 @@ function splitWhitespace(value) {
|
|
|
51
51
|
function sleep(ms) {
|
|
52
52
|
return new Promise((resolve) => void setTimeout(resolve, ms));
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class PromiseSet {
|
|
55
55
|
constructor() {
|
|
56
56
|
__publicField(this, "promises", /* @__PURE__ */ new Set());
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
and(promise) {
|
|
59
59
|
this.promises.add(promise);
|
|
60
60
|
return this;
|
|
61
61
|
}
|
|
@@ -63,9 +63,6 @@ class PromiseChain {
|
|
|
63
63
|
await Promise.all(this.promises);
|
|
64
64
|
this.promises.clear();
|
|
65
65
|
}
|
|
66
|
-
static create() {
|
|
67
|
-
return new PromiseChain();
|
|
68
|
-
}
|
|
69
66
|
}
|
|
70
67
|
function flushPromises() {
|
|
71
68
|
return new Promise((resolve) => void setTimeout(resolve, 0));
|
|
@@ -94,7 +91,7 @@ function toPixel(value) {
|
|
|
94
91
|
return value;
|
|
95
92
|
}
|
|
96
93
|
export {
|
|
97
|
-
|
|
94
|
+
PromiseSet,
|
|
98
95
|
flushPromises,
|
|
99
96
|
isEmpty,
|
|
100
97
|
isNullish,
|
package/dist/promise/index.d.ts
CHANGED
package/package.json
CHANGED