@tb-dev/prototype-dom 6.1.0 → 6.1.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/dist/index.d.ts +14 -23
- package/dist/index.js +195 -256
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
declare global {
|
|
2
|
-
interface ArrayConstructor {
|
|
3
|
-
fromElements: <T extends Element[] | NodeList | string, V>(source: T, valueSelector: (element: Element) => V) => V[];
|
|
4
|
-
}
|
|
5
2
|
interface Document {
|
|
6
|
-
queryStrict: <T extends Element>(
|
|
7
|
-
queryAsArray: <T = Element>(selector: string,
|
|
8
|
-
queryAsSet: <T = Element>(selector: string,
|
|
9
|
-
queryAsMap: <T extends Element, K, V = T>(selector: string,
|
|
3
|
+
queryStrict: <T extends Element = Element>(selectors: string) => T;
|
|
4
|
+
queryAsArray: <T = Element>(selector: string, valueFn?: (element: Element) => T) => T[];
|
|
5
|
+
queryAsSet: <T = Element>(selector: string, valueFn?: (element: Element) => T) => Set<T>;
|
|
6
|
+
queryAsMap: <T extends Element, K, V = T>(selector: string, keyFn: (element: T) => K, valueFn?: (element: T) => V) => Map<K, V>;
|
|
10
7
|
waitChild: (selector: string, timeout?: number) => Promise<Element>;
|
|
11
8
|
}
|
|
12
9
|
interface Element {
|
|
13
|
-
getAttributeStrict:
|
|
14
|
-
getAttributeAsFloatStrict: (
|
|
15
|
-
getAttributeAsIntStrict: (
|
|
16
|
-
getTextStrict:
|
|
17
|
-
getTextAsIntStrict: (radix?: number
|
|
18
|
-
getTextAsFloatStrict: (
|
|
19
|
-
queryAsArray: <T = Element>(selector: string,
|
|
20
|
-
queryAsSet: <T = Element>(selector: string,
|
|
10
|
+
getAttributeStrict: (name: string) => string;
|
|
11
|
+
getAttributeAsFloatStrict: (name: string) => number;
|
|
12
|
+
getAttributeAsIntStrict: (name: string, radix?: number) => number;
|
|
13
|
+
getTextStrict: () => string;
|
|
14
|
+
getTextAsIntStrict: (radix?: number) => number;
|
|
15
|
+
getTextAsFloatStrict: () => number;
|
|
16
|
+
queryAsArray: <T = Element>(selector: string, valueFn?: (element: Element) => T) => T[];
|
|
17
|
+
queryAsSet: <T = Element>(selector: string, valueFn?: (element: Element) => T) => Set<T>;
|
|
21
18
|
queryStrict: <T extends Element>(selector: string) => T;
|
|
22
|
-
queryAsMap: <T extends Element, K, V = T>(selector: string,
|
|
19
|
+
queryAsMap: <T extends Element, K, V = T>(selector: string, keyFn: (element: T) => K, valueFn?: (element: T) => V) => Map<K, V>;
|
|
23
20
|
waitChild: (selector: string, timeout?: number) => Promise<Element>;
|
|
24
21
|
}
|
|
25
22
|
interface URLSearchParams {
|
|
26
|
-
getStrict:
|
|
23
|
+
getStrict: (name: string) => string;
|
|
27
24
|
getAsInteger: (name: string, radix?: number) => number | null;
|
|
28
25
|
getAsIntegerStrict: (name: string, radix?: number) => number;
|
|
29
26
|
}
|
|
30
|
-
interface MapConstructor {
|
|
31
|
-
fromElements: <T extends Element[] | NodeList | string, K, V>(source: T, keySelector: (element: Element) => K, valueSelector: (element: Element) => V) => Map<K, V>;
|
|
32
|
-
}
|
|
33
|
-
interface SetConstructor {
|
|
34
|
-
fromElements: <T extends Element[] | NodeList | string, K>(source: T, valueSelector: (element: Element) => K) => Set<K>;
|
|
35
|
-
}
|
|
36
27
|
}
|
|
37
28
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,273 +1,212 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
Document.prototype.queryAsArray = function (selector, valueSelector) {
|
|
11
|
-
valueSelector ??= (element) => element;
|
|
12
|
-
const elements = this.querySelectorAll(selector);
|
|
13
|
-
return Array.from(elements, valueSelector);
|
|
14
|
-
};
|
|
15
|
-
Document.prototype.queryAsSet = function (selector, valueSelector) {
|
|
16
|
-
valueSelector ??= (element) => element;
|
|
17
|
-
const elements = this.queryAsArray(selector, valueSelector);
|
|
18
|
-
return new Set(elements);
|
|
19
|
-
};
|
|
20
|
-
Document.prototype.queryAsMap = function (selector, keySelector, valueSelector = (el) => el) {
|
|
21
|
-
const elements = this.queryAsArray(selector);
|
|
22
|
-
const map = new Map();
|
|
23
|
-
for (const element of elements) {
|
|
24
|
-
const key = keySelector(element);
|
|
25
|
-
const value = valueSelector(element);
|
|
26
|
-
map.set(key, value);
|
|
27
|
-
}
|
|
28
|
-
return map;
|
|
29
|
-
};
|
|
30
|
-
Document.prototype.waitChild = function (selector, timeoutMillis = 300_000) {
|
|
31
|
-
const el = this.querySelector(selector);
|
|
32
|
-
if (el)
|
|
33
|
-
return Promise.resolve(el);
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
let timeout = null;
|
|
36
|
-
let interval = null;
|
|
37
|
-
const observer = new MutationObserver((mutations) => {
|
|
38
|
-
const element = this.querySelector(selector);
|
|
39
|
-
if (element) {
|
|
40
|
-
onElementFound(element);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
for (const mutation of mutations) {
|
|
44
|
-
if (mutation.type !== 'childList')
|
|
45
|
-
continue;
|
|
46
|
-
for (const node of Array.from(mutation.addedNodes)) {
|
|
47
|
-
if (node instanceof Element && node.matches(`:has(${selector})`)) {
|
|
48
|
-
onElementFound(node);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
function onElementFound(element) {
|
|
55
|
-
if (typeof timeout === 'number')
|
|
56
|
-
clearTimeout(timeout);
|
|
57
|
-
if (typeof interval === 'number')
|
|
58
|
-
clearInterval(interval);
|
|
59
|
-
observer.disconnect();
|
|
60
|
-
resolve(element);
|
|
4
|
+
function getAttributeStrict() {
|
|
5
|
+
return function (attribute) {
|
|
6
|
+
const attr = this.getAttribute(attribute)?.trim();
|
|
7
|
+
if (typeof attr !== 'string' || attr.length === 0) {
|
|
8
|
+
throw new Error(`attribute "${attribute}" not found`);
|
|
61
9
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
10
|
+
return attr;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function getAttributeAsFloatStrict() {
|
|
14
|
+
return function (attribute) {
|
|
15
|
+
const attr = this.getAttributeStrict(attribute);
|
|
16
|
+
const value = Number.parseFloat(attr.trim());
|
|
17
|
+
if (!Number.isFinite(value)) {
|
|
18
|
+
throw new TypeError(`could not parse attribute "${attribute}" as float`);
|
|
67
19
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
20
|
+
return value;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function getAttributeAsIntStrict() {
|
|
24
|
+
return function (attribute, radix = 10) {
|
|
25
|
+
const attr = this.getAttributeStrict(attribute);
|
|
26
|
+
const value = Number.parseInt(attr.trim(), radix);
|
|
27
|
+
if (!Number.isInteger(value)) {
|
|
28
|
+
throw new TypeError(`could not parse attribute "${attribute}" as integer`);
|
|
73
29
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
for (const mutation of mutations) {
|
|
164
|
-
if (mutation.type !== 'childList')
|
|
165
|
-
continue;
|
|
166
|
-
for (const node of Array.from(mutation.addedNodes)) {
|
|
167
|
-
if (node instanceof Element && node.matches(`:has(${selector})`)) {
|
|
168
|
-
onElementFound(node);
|
|
169
|
-
return;
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function getTextStrict() {
|
|
34
|
+
return function () {
|
|
35
|
+
const text = this.textContent?.trim();
|
|
36
|
+
if (typeof text !== 'string' || text.length === 0) {
|
|
37
|
+
throw new Error('element has no text content');
|
|
38
|
+
}
|
|
39
|
+
return text;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function getTextAsIntStrict() {
|
|
43
|
+
return function (radix = 10) {
|
|
44
|
+
const value = Number.parseInt(this.getTextStrict(), radix);
|
|
45
|
+
if (!Number.isInteger(value)) {
|
|
46
|
+
throw new TypeError('could not parse text content as integer');
|
|
47
|
+
}
|
|
48
|
+
return value;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function getTextAsFloatStrict() {
|
|
52
|
+
return function () {
|
|
53
|
+
const value = Number.parseFloat(this.getTextStrict());
|
|
54
|
+
if (!Number.isFinite(value)) {
|
|
55
|
+
throw new TypeError('could not parse text content as float');
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function queryStrict() {
|
|
61
|
+
return function (selector) {
|
|
62
|
+
const element = this.querySelector(selector);
|
|
63
|
+
if (!element)
|
|
64
|
+
throw new Error(`no element found for selector "${selector}"`);
|
|
65
|
+
return element;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function queryAsArray() {
|
|
69
|
+
return function (selector, valueFn) {
|
|
70
|
+
valueFn ??= (element) => element;
|
|
71
|
+
const elements = this.querySelectorAll(selector);
|
|
72
|
+
return Array.from(elements, valueFn);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function queryAsSet() {
|
|
76
|
+
return function (selector, valueFn) {
|
|
77
|
+
valueFn ??= (element) => element;
|
|
78
|
+
const elements = this.queryAsArray(selector, valueFn);
|
|
79
|
+
return new Set(elements);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function queryAsMap() {
|
|
83
|
+
return function (selector, keyFn, valueFn) {
|
|
84
|
+
valueFn ??= (element) => element;
|
|
85
|
+
const elements = this.queryAsArray(selector);
|
|
86
|
+
const map = new Map();
|
|
87
|
+
for (const element of elements) {
|
|
88
|
+
const key = keyFn(element);
|
|
89
|
+
const value = valueFn(element);
|
|
90
|
+
map.set(key, value);
|
|
91
|
+
}
|
|
92
|
+
return map;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function waitChild() {
|
|
96
|
+
return function (selector, timeoutMillis = 300_000) {
|
|
97
|
+
const el = this.querySelector(selector);
|
|
98
|
+
if (el)
|
|
99
|
+
return Promise.resolve(el);
|
|
100
|
+
return new Promise((resolve, reject) => {
|
|
101
|
+
let timeout = null;
|
|
102
|
+
let interval = null;
|
|
103
|
+
const observer = new MutationObserver((mutations) => {
|
|
104
|
+
const element = this.querySelector(selector);
|
|
105
|
+
if (element) {
|
|
106
|
+
onElementFound(element);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
for (const mutation of mutations) {
|
|
110
|
+
if (mutation.type !== 'childList')
|
|
111
|
+
continue;
|
|
112
|
+
for (const node of Array.from(mutation.addedNodes)) {
|
|
113
|
+
if (node instanceof Element && node.matches(`:has(${selector})`)) {
|
|
114
|
+
onElementFound(node);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
170
117
|
}
|
|
171
118
|
}
|
|
119
|
+
});
|
|
120
|
+
function onElementFound(element) {
|
|
121
|
+
if (typeof timeout === 'number')
|
|
122
|
+
clearTimeout(timeout);
|
|
123
|
+
if (typeof interval === 'number')
|
|
124
|
+
clearInterval(interval);
|
|
125
|
+
observer.disconnect();
|
|
126
|
+
resolve(element);
|
|
172
127
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (typeof interval === 'number')
|
|
178
|
-
clearInterval(interval);
|
|
179
|
-
observer.disconnect();
|
|
180
|
-
resolve(element);
|
|
181
|
-
}
|
|
182
|
-
function onInterval() {
|
|
183
|
-
const element = this.querySelector(selector);
|
|
184
|
-
if (element) {
|
|
185
|
-
onElementFound(element);
|
|
128
|
+
function onInterval() {
|
|
129
|
+
const element = this.querySelector(selector);
|
|
130
|
+
if (element)
|
|
131
|
+
onElementFound(element);
|
|
186
132
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
};
|
|
212
|
-
URLSearchParams.prototype.getAsIntegerStrict = function (name, radix = 10) {
|
|
213
|
-
const item = this.getStrict(name);
|
|
214
|
-
const parsed = Number.parseInt(item, radix);
|
|
215
|
-
if (!Number.isInteger(parsed)) {
|
|
216
|
-
throw new TypeError(`could not parse "${item}" as an integer`);
|
|
217
|
-
}
|
|
218
|
-
return parsed;
|
|
219
|
-
};
|
|
220
|
-
Array.fromElements = function (source, valueSelector) {
|
|
221
|
-
isValidElementSource(source);
|
|
222
|
-
const elements = parseElementSource(source);
|
|
223
|
-
return Array.from(elements, valueSelector);
|
|
133
|
+
function onTimeout() {
|
|
134
|
+
if (typeof interval === 'number')
|
|
135
|
+
clearInterval(interval);
|
|
136
|
+
observer.disconnect();
|
|
137
|
+
reject(new Error(`timeout waiting for element: ${selector}`));
|
|
138
|
+
}
|
|
139
|
+
interval = setInterval(onInterval.bind(this), 100);
|
|
140
|
+
timeout = setTimeout(onTimeout, timeoutMillis);
|
|
141
|
+
observer.observe(this, { childList: true, subtree: true });
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const element = {
|
|
146
|
+
getAttributeStrict,
|
|
147
|
+
getAttributeAsFloatStrict,
|
|
148
|
+
getAttributeAsIntStrict,
|
|
149
|
+
getTextStrict,
|
|
150
|
+
getTextAsIntStrict,
|
|
151
|
+
getTextAsFloatStrict,
|
|
152
|
+
queryStrict,
|
|
153
|
+
queryAsArray,
|
|
154
|
+
queryAsSet,
|
|
155
|
+
queryAsMap,
|
|
156
|
+
waitChild
|
|
224
157
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
throw new TypeError('item in source array is not an element');
|
|
158
|
+
|
|
159
|
+
function getStrict() {
|
|
160
|
+
return function (name) {
|
|
161
|
+
const item = this.get(name);
|
|
162
|
+
if (typeof item !== 'string') {
|
|
163
|
+
throw new TypeError(`key "${name}" not found in URL search parameters`);
|
|
232
164
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const elements = parseElementSource(source);
|
|
242
|
-
const set = new Set();
|
|
243
|
-
for (const element of elements) {
|
|
244
|
-
if (!(element instanceof Element)) {
|
|
245
|
-
throw new TypeError('item in source array is not an element');
|
|
165
|
+
return item;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function getAsInteger() {
|
|
169
|
+
return function (name, radix = 10) {
|
|
170
|
+
const item = this.get(name);
|
|
171
|
+
if (typeof item !== 'string') {
|
|
172
|
+
return null;
|
|
246
173
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
return set;
|
|
251
|
-
};
|
|
252
|
-
function isValidElementSource(source) {
|
|
253
|
-
if (!Array.isArray(source) &&
|
|
254
|
-
!(source instanceof NodeList) &&
|
|
255
|
-
(typeof source !== 'string' || source.length === 0)) {
|
|
256
|
-
throw new TypeError('source must be an array, a NodeList or a string');
|
|
257
|
-
}
|
|
258
|
-
return true;
|
|
174
|
+
return Number.parseInt(item, radix);
|
|
175
|
+
};
|
|
259
176
|
}
|
|
260
|
-
function
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return Array.from(source);
|
|
269
|
-
}
|
|
270
|
-
throw new TypeError('source must be an array, a NodeList or a string');
|
|
177
|
+
function getAsIntegerStrict() {
|
|
178
|
+
return function (name, radix = 10) {
|
|
179
|
+
const value = Number.parseInt(this.getStrict(name), radix);
|
|
180
|
+
if (!Number.isInteger(value)) {
|
|
181
|
+
throw new TypeError(`could not parse "${name}" as an integer`);
|
|
182
|
+
}
|
|
183
|
+
return value;
|
|
184
|
+
};
|
|
271
185
|
}
|
|
186
|
+
const urlSearchParams = {
|
|
187
|
+
getStrict,
|
|
188
|
+
getAsInteger,
|
|
189
|
+
getAsIntegerStrict
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
Document.prototype.queryStrict = element.queryStrict();
|
|
193
|
+
Document.prototype.queryAsArray = element.queryAsArray();
|
|
194
|
+
Document.prototype.queryAsSet = element.queryAsSet();
|
|
195
|
+
Document.prototype.queryAsMap = element.queryAsMap();
|
|
196
|
+
Document.prototype.waitChild = element.waitChild();
|
|
197
|
+
Element.prototype.getAttributeStrict = element.getAttributeStrict();
|
|
198
|
+
Element.prototype.getAttributeAsFloatStrict = element.getAttributeAsFloatStrict();
|
|
199
|
+
Element.prototype.getAttributeAsIntStrict = element.getAttributeAsIntStrict();
|
|
200
|
+
Element.prototype.getTextStrict = element.getTextStrict();
|
|
201
|
+
Element.prototype.getTextAsIntStrict = element.getTextAsIntStrict();
|
|
202
|
+
Element.prototype.getTextAsFloatStrict = element.getTextAsFloatStrict();
|
|
203
|
+
Element.prototype.queryStrict = element.queryStrict();
|
|
204
|
+
Element.prototype.queryAsArray = element.queryAsArray();
|
|
205
|
+
Element.prototype.queryAsSet = element.queryAsSet();
|
|
206
|
+
Element.prototype.queryAsMap = element.queryAsMap();
|
|
207
|
+
Element.prototype.waitChild = element.waitChild();
|
|
208
|
+
URLSearchParams.prototype.getStrict = urlSearchParams.getStrict();
|
|
209
|
+
URLSearchParams.prototype.getAsInteger = urlSearchParams.getAsInteger();
|
|
210
|
+
URLSearchParams.prototype.getAsIntegerStrict = urlSearchParams.getAsIntegerStrict();
|
|
272
211
|
|
|
273
212
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tb-dev/prototype-dom",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Adds prototype methods to DOM objects",
|
|
5
5
|
"packageManager": "pnpm@8.15.4",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
27
|
-
"@tb-dev/eslint-config": "^2.
|
|
27
|
+
"@tb-dev/eslint-config": "^2.1.1",
|
|
28
28
|
"@vitest/ui": "^1.3.1",
|
|
29
29
|
"eslint": "^8.57.0",
|
|
30
30
|
"husky": "^9.0.11",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prettier": "^3.2.5",
|
|
33
33
|
"rollup": "^4.12.0",
|
|
34
34
|
"tslib": "^2.6.2",
|
|
35
|
-
"typedoc": "^0.25.
|
|
35
|
+
"typedoc": "^0.25.9",
|
|
36
36
|
"typedoc-plugin-mdn-links": "^3.1.17",
|
|
37
37
|
"typescript": "5.3.3",
|
|
38
38
|
"vitest": "^1.3.1"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"main": "./dist/index.js",
|
|
44
44
|
"types": "./dist/index.d.ts",
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "rollup --config rollup.config.js",
|
|
46
|
+
"build": "rollup --config rollup.config.js && node scripts/delete-artifacts.mjs",
|
|
47
47
|
"docs": "typedoc --plugin typedoc-plugin-mdn-links",
|
|
48
48
|
"format": "prettier . --write",
|
|
49
49
|
"format-check": "prettier . --check",
|