@tb-dev/prototype-dom 6.1.6 → 6.1.8
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.js +15 -15
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -93,26 +93,26 @@
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
function waitChild() {
|
|
96
|
-
return function (selector, timeoutMillis =
|
|
96
|
+
return function (selector, timeoutMillis = 60_000) {
|
|
97
97
|
let element = this.querySelector(selector);
|
|
98
98
|
if (element)
|
|
99
99
|
return Promise.resolve(element);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
clearInterval(interval);
|
|
107
|
-
clearTimeout(timeout);
|
|
108
|
-
resolve(element);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function onTimeout() {
|
|
100
|
+
const { promise, resolve, reject } = Promise.withResolvers();
|
|
101
|
+
const timeout = setTimeout(onTimeout, timeoutMillis);
|
|
102
|
+
const interval = setInterval(onInterval.bind(this), 20);
|
|
103
|
+
function onInterval() {
|
|
104
|
+
element = this.querySelector(selector);
|
|
105
|
+
if (element) {
|
|
112
106
|
clearInterval(interval);
|
|
113
|
-
|
|
107
|
+
clearTimeout(timeout);
|
|
108
|
+
resolve(element);
|
|
114
109
|
}
|
|
115
|
-
}
|
|
110
|
+
}
|
|
111
|
+
function onTimeout() {
|
|
112
|
+
clearInterval(interval);
|
|
113
|
+
reject(new Error(`timeout waiting for element: ${selector}`));
|
|
114
|
+
}
|
|
115
|
+
return promise;
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
const element = {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tb-dev/prototype-dom",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.8",
|
|
4
4
|
"description": "Adds prototype methods to DOM objects",
|
|
5
|
-
"packageManager": "pnpm@8.15.
|
|
5
|
+
"packageManager": "pnpm@8.15.7",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"author": {
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
27
|
-
"@tb-dev/eslint-config": "^3.
|
|
27
|
+
"@tb-dev/eslint-config": "^3.4.0",
|
|
28
28
|
"eslint": "^8.57.0",
|
|
29
29
|
"husky": "^9.0.11",
|
|
30
30
|
"lint-staged": "^15.2.2",
|
|
31
31
|
"prettier": "^3.2.5",
|
|
32
|
-
"rollup": "^4.
|
|
32
|
+
"rollup": "^4.14.3",
|
|
33
33
|
"tslib": "^2.6.2",
|
|
34
|
-
"typedoc": "^0.25.
|
|
35
|
-
"typedoc-plugin-mdn-links": "^3.1.
|
|
36
|
-
"typescript": "^5.4.
|
|
34
|
+
"typedoc": "^0.25.13",
|
|
35
|
+
"typedoc-plugin-mdn-links": "^3.1.21",
|
|
36
|
+
"typescript": "^5.4.5"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist/**/*"
|