@flemist/simple-utils 2.1.6 → 2.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/build/browser/index.cjs +1 -1
- package/build/browser/index.mjs +150 -147
- package/build/common/converter/converterBufferToGzip.d.ts +4 -0
- package/build/common/converter/converterErrorToBuffer.d.ts +2 -2
- package/build/common/converter/converterErrorToGzip.d.ts +4 -0
- package/build/common/converter/converterJsonBuffer.d.ts +2 -2
- package/build/common/converter/converterJsonGzip.d.ts +4 -0
- package/build/common/converter/index.d.ts +3 -0
- package/build/common/index.cjs +1 -1
- package/build/common/index.mjs +150 -147
- package/build/node/cache/FileStorage.d.ts +3 -1
- package/build/node/cache/createFileCacheOptions.d.ts +5 -1
- package/build/node/index.cjs +5 -5
- package/build/node/index.mjs +474 -471
- package/build/{urlGet-OHY_Qdk-.mjs → urlGet-BtyqjC2r.mjs} +731 -695
- package/build/urlGet-BukRa7Gq.js +17 -0
- package/package.json +36 -33
- package/build/urlGet-BoqnOos7.js +0 -17
package/build/node/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as Le, b as Fe,
|
|
3
|
-
import * as
|
|
1
|
+
import { at as ut, aq as St, v as xt, s as Ot, a as Tt, am as Ct, ak as _t, a8 as kt } from "../urlGet-BtyqjC2r.mjs";
|
|
2
|
+
import { C as Le, b as Fe, aI as Ie, af as Re, an as Ne, ao as $e, ap as We, ai as ze, aP as Be, ay as Je, az as Ue, bB as Ge, bC as Ke, bD as He, bE as Ve, bF as Ye, bG as qe, bH as Xe, bQ as Qe, bI as Ze, bJ as tr, bK as er, bL as rr, bM as sr, bN as nr, bO as ar, bP as or, M as ir, R as cr, av as lr, aw as ur, U as fr, ae as hr, aa as dr, aC as mr, aJ as pr, aK as wr, B as yr, ad as br, ab as gr, ag as Er, Y as Sr, u as xr, o as Or, q as Tr, p as Cr, r as _r, aG as kr, aF as vr, aE as Pr, as as Dr, V as Ar, W as Mr, E as jr, a4 as Lr, a5 as Fr, a6 as Ir, a7 as Rr, Z as Nr, _ as $r, aB as Wr, aM as zr, aL as Br, aj as Jr, $ as Ur, a0 as Gr, a1 as Kr, ac as Hr, X as Vr, g as Yr, a2 as qr, K as Xr, J as Qr, D as Zr, aA as ts, au as es, w as rs, aH as ss, bb as ns, bd as as, aS as os, aQ as is, bA as cs, aR as ls, aV as us, bf as fs, bi as hs, b7 as ds, b6 as ms, aW as ps, bt as ws, b1 as ys, bs, a$ as gs, br as Es, b4 as Ss, a_ as xs, bu as Os, aY as Ts, aX as Cs, aU as _s, bx as ks, b9 as vs, b8 as Ps, aZ as Ds, b0 as As, bl as Ms, bm as js, bn as Ls, bp as Fs, bj as Is, bq as Rs, b2 as Ns, bo as $s, bk as Ws, bh as zs, be as Bs, ba as Js, bc as Us, bv as Gs, bw as Ks, aT as Hs, aN as Vs, aO as Ys, b3 as qs, bg as Xs, b5 as Qs, by as Zs, bz as tn, G as en, F as rn, H as sn, I as nn, O as an, T as on, L as cn, P as ln, N as un, Q as fn, S as hn, x as dn, a9 as mn, z as pn, y as wn, al as yn, k as bn, j as gn, e as En, d as Sn, n as xn, m as On, l as Tn, i as Cn, h as _n, f as kn, c as vn, t as Pn, A as Dn, a3 as An, bW as Mn, bY as jn, bX as Ln, bR as Fn, bV as In, bS as Rn, bU as Nn, bT as $n, aD as Wn, ax as zn, ah as Bn, ar as Jn } from "../urlGet-BtyqjC2r.mjs";
|
|
3
|
+
import * as v from "path";
|
|
4
4
|
import I from "path";
|
|
5
|
-
import { Pool as
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
5
|
+
import { Pool as vt, poolRunWait as A } from "@flemist/time-limits";
|
|
6
|
+
import Pt from "node:os";
|
|
7
|
+
import * as D from "fs";
|
|
8
8
|
import $ from "fs";
|
|
9
|
-
import { priorityCreate as
|
|
10
|
-
import { useAbortController as
|
|
9
|
+
import { priorityCreate as U } from "@flemist/priority-queue";
|
|
10
|
+
import { useAbortController as Dt, combineAbortSignals as rt, delay as ft } from "@flemist/async-utils";
|
|
11
11
|
import At from "picomatch";
|
|
12
|
-
import { spawn as
|
|
13
|
-
import { AbortControllerFast as ht, AbortError as
|
|
12
|
+
import { spawn as K } from "child_process";
|
|
13
|
+
import { AbortControllerFast as ht, AbortError as nt } from "@flemist/abort-controller-fast";
|
|
14
14
|
import { createTestVariants as Mt } from "@flemist/test-variants";
|
|
15
|
-
const R = new Pt
|
|
16
|
-
async function jt(t, e,
|
|
15
|
+
const R = new vt(Pt.cpus().length);
|
|
16
|
+
async function jt(t, e, s, n) {
|
|
17
17
|
t = I.resolve(t), e = I.resolve(e), await A({
|
|
18
|
-
pool:
|
|
18
|
+
pool: n ?? R,
|
|
19
19
|
count: 1,
|
|
20
20
|
func: async () => {
|
|
21
21
|
let r = !1;
|
|
@@ -23,7 +23,7 @@ async function jt(t, e, n, s) {
|
|
|
23
23
|
await ut([
|
|
24
24
|
$.promises.mkdir(I.dirname(t), { recursive: !0 }),
|
|
25
25
|
(async () => {
|
|
26
|
-
await $.promises.mkdir(I.dirname(e), { recursive: !0 }), await $.promises.writeFile(e,
|
|
26
|
+
await $.promises.mkdir(I.dirname(e), { recursive: !0 }), await $.promises.writeFile(e, s), r = !0;
|
|
27
27
|
})()
|
|
28
28
|
]), await $.promises.rename(e, t);
|
|
29
29
|
} catch (a) {
|
|
@@ -41,13 +41,13 @@ function F(t) {
|
|
|
41
41
|
}
|
|
42
42
|
const Ft = new St();
|
|
43
43
|
function be(t) {
|
|
44
|
-
const { filePath: e, func:
|
|
44
|
+
const { filePath: e, func: s } = t;
|
|
45
45
|
return Ft.lock(
|
|
46
46
|
F(e),
|
|
47
47
|
() => A({
|
|
48
48
|
pool: R,
|
|
49
49
|
count: 1,
|
|
50
|
-
func:
|
|
50
|
+
func: s
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
53
|
}
|
|
@@ -58,7 +58,7 @@ function Rt(t, e) {
|
|
|
58
58
|
return It(t) + "|" + e.ino;
|
|
59
59
|
}
|
|
60
60
|
function Nt(t) {
|
|
61
|
-
return t.endsWith(":") && (t += "/"),
|
|
61
|
+
return t.endsWith(":") && (t += "/"), v.resolve(t);
|
|
62
62
|
}
|
|
63
63
|
function at(t, e) {
|
|
64
64
|
t.totalSize += e.totalSize, t.maxFileDateModified = Math.max(
|
|
@@ -79,15 +79,15 @@ function dt(t) {
|
|
|
79
79
|
countDirs: 0,
|
|
80
80
|
countLinks: 0
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const s = t.level ?? 0, n = t.walkedIds ?? /* @__PURE__ */ new Set(), r = t.abortSignal, a = t.pool ?? R, o = t.handleError, i = t.priority ?? U(0), c = t.walkLinks ?? !1, l = t.log, g = t.handlePath, d = t.matchPath;
|
|
83
83
|
async function h(f) {
|
|
84
84
|
if (!(o && await o(f)) && !$t(f))
|
|
85
85
|
throw f;
|
|
86
86
|
}
|
|
87
87
|
function x(f) {
|
|
88
|
-
return !(!l || l.minTotalContentSize != null && f < l.minTotalContentSize || l.maxNestedLevel != null &&
|
|
88
|
+
return !(!l || l.minTotalContentSize != null && f < l.minTotalContentSize || l.maxNestedLevel != null && s > l.maxNestedLevel);
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return Dt(async (f) => {
|
|
91
91
|
const m = rt(r, f), p = {
|
|
92
92
|
totalSize: 0,
|
|
93
93
|
maxFileDateModified: 0,
|
|
@@ -95,21 +95,21 @@ function dt(t) {
|
|
|
95
95
|
countDirs: 0,
|
|
96
96
|
countLinks: 0
|
|
97
97
|
};
|
|
98
|
-
function
|
|
99
|
-
if (x(
|
|
100
|
-
const O = `${
|
|
98
|
+
function _(w, C) {
|
|
99
|
+
if (x(C.totalSize)) {
|
|
100
|
+
const O = `${C.totalSize.toLocaleString("en-US").replace(/,/g, " ").padStart(19)}: ${w}`;
|
|
101
101
|
l?.handleLog ? l.handleLog(O) : console.log(O);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
async function u(w,
|
|
104
|
+
async function u(w, C, S, O) {
|
|
105
105
|
return g ? await A({
|
|
106
106
|
pool: a,
|
|
107
107
|
func: async () => {
|
|
108
108
|
try {
|
|
109
109
|
return await g({
|
|
110
|
-
level:
|
|
110
|
+
level: s,
|
|
111
111
|
path: w,
|
|
112
|
-
stat:
|
|
112
|
+
stat: C,
|
|
113
113
|
itemStat: S,
|
|
114
114
|
totalStat: p,
|
|
115
115
|
abortSignal: m
|
|
@@ -123,21 +123,21 @@ function dt(t) {
|
|
|
123
123
|
abortSignal: m
|
|
124
124
|
}) : !0;
|
|
125
125
|
}
|
|
126
|
-
async function y(w,
|
|
126
|
+
async function y(w, C, S, O) {
|
|
127
127
|
O || (O = w);
|
|
128
128
|
const T = await A({
|
|
129
129
|
pool: a,
|
|
130
|
-
func: () =>
|
|
130
|
+
func: () => D.promises.lstat(w).catch(h),
|
|
131
131
|
count: 1,
|
|
132
|
-
priority:
|
|
132
|
+
priority: U(C, U(1, i)),
|
|
133
133
|
abortSignal: m
|
|
134
134
|
});
|
|
135
135
|
if (!T || !S && T.isFile())
|
|
136
136
|
return null;
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
137
|
+
const P = Rt(w, T);
|
|
138
|
+
if (n.has(P))
|
|
139
139
|
return null;
|
|
140
|
-
|
|
140
|
+
n.add(P);
|
|
141
141
|
let b = {
|
|
142
142
|
totalSize: T.size,
|
|
143
143
|
maxFileDateModified: T.isDirectory() ? 0 : T.mtimeMs,
|
|
@@ -145,23 +145,23 @@ function dt(t) {
|
|
|
145
145
|
countDirs: 0,
|
|
146
146
|
countLinks: 0
|
|
147
147
|
};
|
|
148
|
-
const M =
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
const M = U(
|
|
149
|
+
C,
|
|
150
|
+
U(T.isDirectory() ? 2 : 3, i)
|
|
151
151
|
);
|
|
152
152
|
if (T.isSymbolicLink()) {
|
|
153
153
|
if (c) {
|
|
154
|
-
const
|
|
154
|
+
const k = await A({
|
|
155
155
|
pool: a,
|
|
156
|
-
func: () =>
|
|
156
|
+
func: () => D.promises.readlink(w).catch(h).then((L) => L ?? null),
|
|
157
157
|
count: 1,
|
|
158
158
|
priority: M,
|
|
159
159
|
abortSignal: m
|
|
160
160
|
});
|
|
161
|
-
if (
|
|
162
|
-
const L =
|
|
161
|
+
if (k) {
|
|
162
|
+
const L = v.isAbsolute(k) ? k : v.resolve(v.dirname(O), k), N = await y(
|
|
163
163
|
L,
|
|
164
|
-
|
|
164
|
+
C,
|
|
165
165
|
S,
|
|
166
166
|
O
|
|
167
167
|
);
|
|
@@ -173,25 +173,25 @@ function dt(t) {
|
|
|
173
173
|
T,
|
|
174
174
|
b,
|
|
175
175
|
M
|
|
176
|
-
) && (at(p, b),
|
|
176
|
+
) && (at(p, b), _(O, b))), b;
|
|
177
177
|
} else if (T.isDirectory()) {
|
|
178
|
-
const
|
|
178
|
+
const k = await A({
|
|
179
179
|
pool: a,
|
|
180
|
-
func: () =>
|
|
180
|
+
func: () => D.promises.readdir(w).catch(h),
|
|
181
181
|
count: 1,
|
|
182
182
|
priority: i,
|
|
183
183
|
abortSignal: m
|
|
184
184
|
});
|
|
185
|
-
if (
|
|
186
|
-
for (let L = 0, N =
|
|
187
|
-
|
|
185
|
+
if (k) {
|
|
186
|
+
for (let L = 0, N = k.length; L < N; L++)
|
|
187
|
+
k[L] = v.join(O, k[L]);
|
|
188
188
|
b = await dt({
|
|
189
189
|
...t,
|
|
190
|
-
paths:
|
|
190
|
+
paths: k,
|
|
191
191
|
abortSignal: m,
|
|
192
192
|
priority: M,
|
|
193
|
-
level:
|
|
194
|
-
walkedIds:
|
|
193
|
+
level: s + 1,
|
|
194
|
+
walkedIds: n
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -200,10 +200,10 @@ function dt(t) {
|
|
|
200
200
|
T,
|
|
201
201
|
b,
|
|
202
202
|
M
|
|
203
|
-
) && (at(p, b),
|
|
203
|
+
) && (at(p, b), _(O, b))), b;
|
|
204
204
|
}
|
|
205
205
|
const E = [];
|
|
206
|
-
for (let w = 0,
|
|
206
|
+
for (let w = 0, C = e.length; w < C; w++) {
|
|
207
207
|
const S = Nt(e[w]), O = d ? d(S) : !0;
|
|
208
208
|
O !== !1 && E.push(y(S, w, O));
|
|
209
209
|
}
|
|
@@ -216,9 +216,9 @@ function ge(t) {
|
|
|
216
216
|
function Ee({
|
|
217
217
|
globs: t,
|
|
218
218
|
rootDir: e,
|
|
219
|
-
noCase:
|
|
219
|
+
noCase: s
|
|
220
220
|
}) {
|
|
221
|
-
const
|
|
221
|
+
const n = [];
|
|
222
222
|
return t.forEach((r) => {
|
|
223
223
|
r = F(r).trim();
|
|
224
224
|
const a = r.startsWith("^");
|
|
@@ -229,13 +229,13 @@ function Ee({
|
|
|
229
229
|
`Invalid glob pattern: "${r}". The syntax '${r.substring(0, 2)}' is not supported. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class), ! (negate pattern), ^ (exclude if included). Examples of valid patterns: "*.js", "src/**/*.ts", "!node_modules", "^dist". Avoid starting with '!' after '^' or multiple special prefixes.`
|
|
230
230
|
);
|
|
231
231
|
r.startsWith("/") && (r = "." + r);
|
|
232
|
-
const i = F(e ?
|
|
232
|
+
const i = F(e ? v.resolve(e, r) : r);
|
|
233
233
|
if (!i)
|
|
234
234
|
return;
|
|
235
235
|
let c;
|
|
236
236
|
try {
|
|
237
237
|
c = At(i, {
|
|
238
|
-
nocase:
|
|
238
|
+
nocase: s ?? !1,
|
|
239
239
|
dot: !0,
|
|
240
240
|
strictBrackets: !0
|
|
241
241
|
// Validate bracket balance for patterns like "["
|
|
@@ -245,7 +245,7 @@ function Ee({
|
|
|
245
245
|
`Invalid glob pattern: "${r}". ${l instanceof Error ? l.message : "Unknown error"}. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class with balanced brackets), ! (negate pattern), ^ (exclude if included). Examples: "*.js", "src/**/*.ts", "!node_modules", "[abc]def.txt". Ensure all brackets [ ] are properly closed and balanced.`
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
|
-
|
|
248
|
+
n.push({
|
|
249
249
|
exclude: a,
|
|
250
250
|
negative: o,
|
|
251
251
|
debugInfo: i,
|
|
@@ -254,8 +254,8 @@ function Ee({
|
|
|
254
254
|
}), function(a) {
|
|
255
255
|
a = F(a);
|
|
256
256
|
let o = null, i = !1;
|
|
257
|
-
for (let c = 0, l =
|
|
258
|
-
const g =
|
|
257
|
+
for (let c = 0, l = n.length; c < l; c++) {
|
|
258
|
+
const g = n[c];
|
|
259
259
|
g.match(a) && (g.exclude ? i = !g.negative : (o = !g.negative, i = !1));
|
|
260
260
|
}
|
|
261
261
|
return i ? !1 : o;
|
|
@@ -268,56 +268,56 @@ function Wt(t) {
|
|
|
268
268
|
function zt(t, e) {
|
|
269
269
|
if (!e || e === ".")
|
|
270
270
|
return t;
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
return
|
|
271
|
+
const s = t.startsWith("^");
|
|
272
|
+
s && (t = t.substring(1));
|
|
273
|
+
const n = t.startsWith("!");
|
|
274
|
+
return n && (t = t.substring(1)), t.startsWith("/") ? (e.endsWith("/") && (e = e.substring(0, e.length - 1)), t = e + t) : (e.endsWith("/") || (e += "/"), t.startsWith("./") ? t = e + t.substring(2) : t.startsWith("../") ? t = e + t : (e.startsWith("..") && (e = ""), t.startsWith("**") ? t = e + t : t = e + "**/" + t)), t = F(v.normalize(t)), n && (t = "!" + t), s && (t = "^" + t), t;
|
|
275
275
|
}
|
|
276
276
|
function ot(t) {
|
|
277
277
|
return "^" + t;
|
|
278
278
|
}
|
|
279
279
|
async function Bt(t) {
|
|
280
|
-
const
|
|
281
|
-
`),
|
|
282
|
-
return
|
|
283
|
-
r = r.trim(), !(!r || r.startsWith("#")) &&
|
|
284
|
-
}),
|
|
280
|
+
const s = (await D.promises.readFile(t, "utf-8")).split(`
|
|
281
|
+
`), n = [];
|
|
282
|
+
return s.forEach((r) => {
|
|
283
|
+
r = r.trim(), !(!r || r.startsWith("#")) && n.push(r);
|
|
284
|
+
}), n;
|
|
285
285
|
}
|
|
286
286
|
async function Se(t) {
|
|
287
|
-
const e = t.rootDir ?? ".",
|
|
287
|
+
const e = t.rootDir ?? ".", s = [];
|
|
288
288
|
if (!t.globs?.length)
|
|
289
|
-
return
|
|
290
|
-
const
|
|
289
|
+
return s;
|
|
290
|
+
const n = [];
|
|
291
291
|
return t.globs.forEach((r) => {
|
|
292
|
-
r.value && (r.valueType === "file-contains-patterns" ?
|
|
293
|
-
}),
|
|
294
|
-
|
|
292
|
+
r.value && (r.valueType === "file-contains-patterns" ? n.push(r) : r.valueType === "pattern" && s.push(r.exclude ? ot(r.value) : r.value));
|
|
293
|
+
}), n.length && await Promise.all(
|
|
294
|
+
n.map(async (r) => {
|
|
295
295
|
await A({
|
|
296
296
|
pool: R,
|
|
297
297
|
count: 1,
|
|
298
298
|
func: async () => {
|
|
299
|
-
const a =
|
|
299
|
+
const a = v.resolve(e, r.value), o = await Bt(a), i = v.relative(e, v.dirname(a));
|
|
300
300
|
o.forEach((c) => {
|
|
301
|
-
c = Wt(c), c = zt(c, i),
|
|
301
|
+
c = Wt(c), c = zt(c, i), s.push(r.exclude ? ot(c) : c);
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
})
|
|
306
|
-
),
|
|
306
|
+
), s;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Jt(t, e) {
|
|
309
309
|
return A({
|
|
310
310
|
pool: e ?? R,
|
|
311
311
|
count: 1,
|
|
312
|
-
func: () =>
|
|
312
|
+
func: () => D.promises.readdir(t, { withFileTypes: !0 })
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
|
-
async function
|
|
316
|
-
const
|
|
317
|
-
async function
|
|
315
|
+
async function Ut(t, e) {
|
|
316
|
+
const s = [];
|
|
317
|
+
async function n(r, a) {
|
|
318
318
|
let o;
|
|
319
319
|
try {
|
|
320
|
-
o = await
|
|
320
|
+
o = await Jt(r, e);
|
|
321
321
|
} catch (c) {
|
|
322
322
|
if (a !== "" && c.code === "ENOENT")
|
|
323
323
|
return;
|
|
@@ -325,13 +325,13 @@ async function Jt(t, e) {
|
|
|
325
325
|
}
|
|
326
326
|
let i = null;
|
|
327
327
|
o.forEach((c) => {
|
|
328
|
-
const l =
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
const l = v.join(a, c.name);
|
|
329
|
+
s.push([F(l), c]), c.isDirectory() && (i == null && (i = []), i.push(
|
|
330
|
+
n(v.join(r, c.name), l)
|
|
331
331
|
));
|
|
332
332
|
}), i != null && await Promise.all(i);
|
|
333
333
|
}
|
|
334
|
-
return await
|
|
334
|
+
return await n(t, ""), s;
|
|
335
335
|
}
|
|
336
336
|
class it {
|
|
337
337
|
_options;
|
|
@@ -341,17 +341,17 @@ class it {
|
|
|
341
341
|
get options() {
|
|
342
342
|
return this._options;
|
|
343
343
|
}
|
|
344
|
-
async set(e,
|
|
345
|
-
const
|
|
346
|
-
await jt(r, o,
|
|
344
|
+
async set(e, s) {
|
|
345
|
+
const n = this._options.converterSubPath.to(e), r = v.join(this._options.dir, n), a = this._options.getTempFileName ? this._options.getTempFileName(e) : Lt(), o = v.join(this._options.tmpDir, a);
|
|
346
|
+
await jt(r, o, s, this._options.pool);
|
|
347
347
|
}
|
|
348
348
|
async get(e) {
|
|
349
|
-
const
|
|
349
|
+
const s = this._options.converterSubPath.to(e), n = v.join(this._options.dir, s);
|
|
350
350
|
try {
|
|
351
351
|
const r = await A({
|
|
352
352
|
pool: this._options.pool ?? R,
|
|
353
353
|
count: 1,
|
|
354
|
-
func: () =>
|
|
354
|
+
func: () => D.promises.readFile(n)
|
|
355
355
|
});
|
|
356
356
|
return new Uint8Array(r);
|
|
357
357
|
} catch (r) {
|
|
@@ -361,12 +361,12 @@ class it {
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
async delete(e) {
|
|
364
|
-
const
|
|
364
|
+
const s = this._options.converterSubPath.to(e), n = v.join(this._options.dir, s);
|
|
365
365
|
try {
|
|
366
366
|
await A({
|
|
367
367
|
pool: this._options.pool ?? R,
|
|
368
368
|
count: 1,
|
|
369
|
-
func: () =>
|
|
369
|
+
func: () => D.promises.unlink(n)
|
|
370
370
|
});
|
|
371
371
|
} catch (r) {
|
|
372
372
|
if (r.code === "ENOENT")
|
|
@@ -376,20 +376,20 @@ class it {
|
|
|
376
376
|
}
|
|
377
377
|
async clear() {
|
|
378
378
|
const e = await this.getKeys();
|
|
379
|
-
await ut(e.map((
|
|
379
|
+
await ut(e.map((s) => this.delete(s)));
|
|
380
380
|
}
|
|
381
381
|
async getKeys() {
|
|
382
382
|
try {
|
|
383
|
-
const e = await
|
|
383
|
+
const e = await Ut(
|
|
384
384
|
this._options.dir,
|
|
385
385
|
this._options.pool
|
|
386
|
-
),
|
|
387
|
-
return e.forEach(([
|
|
386
|
+
), s = [];
|
|
387
|
+
return e.forEach(([n, r]) => {
|
|
388
388
|
if (!r.isFile())
|
|
389
389
|
return;
|
|
390
|
-
const a = this._options.converterSubPath.from(
|
|
391
|
-
a != null &&
|
|
392
|
-
}),
|
|
390
|
+
const a = this._options.converterSubPath.from(n);
|
|
391
|
+
a != null && s.push(a);
|
|
392
|
+
}), s;
|
|
393
393
|
} catch (e) {
|
|
394
394
|
if (e.code === "ENOENT")
|
|
395
395
|
return [];
|
|
@@ -398,50 +398,50 @@ class it {
|
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function ct(t) {
|
|
401
|
-
const e = t.prefix ? F(t.prefix) : "",
|
|
401
|
+
const e = t.prefix ? F(t.prefix) : "", s = t.suffix ? F(t.suffix) : "", n = t.splitKeyLetters ?? 0;
|
|
402
402
|
return {
|
|
403
403
|
to(r) {
|
|
404
|
-
if (
|
|
405
|
-
return F(e + r +
|
|
406
|
-
const a = Math.min(
|
|
404
|
+
if (n <= 0)
|
|
405
|
+
return F(e + r + s);
|
|
406
|
+
const a = Math.min(n, r.length);
|
|
407
407
|
let o = e;
|
|
408
408
|
for (let i = 0; i < a; i++)
|
|
409
409
|
o += (i === 0 ? "" : "/") + r[i];
|
|
410
|
-
return a < r.length && (o += (a === 0 ? "" : "/") + r.slice(a)), F(o +
|
|
410
|
+
return a < r.length && (o += (a === 0 ? "" : "/") + r.slice(a)), F(o + s);
|
|
411
411
|
},
|
|
412
412
|
from(r) {
|
|
413
|
-
return
|
|
413
|
+
return n <= 0 ? !r.startsWith(e) || !r.endsWith(s) ? null : r.slice(e.length, r.length - s.length) : !r.startsWith(e) || !r.endsWith(s) ? null : r.slice(e.length, r.length - s.length).replace(/\//g, "");
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class Gt {
|
|
418
418
|
_options;
|
|
419
419
|
_entries = /* @__PURE__ */ new Map();
|
|
420
420
|
_entriesLoaded = !1;
|
|
421
421
|
constructor(e) {
|
|
422
422
|
this._options = e;
|
|
423
423
|
}
|
|
424
|
-
async set(e,
|
|
425
|
-
const
|
|
424
|
+
async set(e, s) {
|
|
425
|
+
const n = s.hasError ? this._options.storages.error : this._options.storages.value, r = n.options.converterSubPath.to(e), a = I.resolve(n.options.dir, r);
|
|
426
426
|
await A({
|
|
427
427
|
pool: this._options.pool ?? R,
|
|
428
428
|
count: 1,
|
|
429
429
|
func: async () => {
|
|
430
430
|
await $.promises.utimes(
|
|
431
431
|
a,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
), this._entries.set(e,
|
|
432
|
+
s.dateUsed / 1e3,
|
|
433
|
+
s.dateModified / 1e3
|
|
434
|
+
), this._entries.set(e, s);
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
438
|
async get(e) {
|
|
439
|
-
const
|
|
439
|
+
const s = this._options.storages.value.options.converterSubPath.to(e), n = this._options.storages.error.options.converterSubPath.to(e), r = I.resolve(
|
|
440
440
|
this._options.storages.value.options.dir,
|
|
441
|
-
|
|
441
|
+
s
|
|
442
442
|
), a = I.resolve(
|
|
443
443
|
this._options.storages.error.options.dir,
|
|
444
|
-
|
|
444
|
+
n
|
|
445
445
|
);
|
|
446
446
|
return await A({
|
|
447
447
|
pool: this._options.pool ?? R,
|
|
@@ -488,21 +488,21 @@ class Kt {
|
|
|
488
488
|
this._entries.clear();
|
|
489
489
|
}
|
|
490
490
|
async _getKeys() {
|
|
491
|
-
const [e,
|
|
491
|
+
const [e, s] = await Promise.all([
|
|
492
492
|
this._options.storages.value.getKeys(),
|
|
493
493
|
this._options.storages.error.getKeys()
|
|
494
494
|
]);
|
|
495
|
-
return [...e, ...
|
|
495
|
+
return [...e, ...s];
|
|
496
496
|
}
|
|
497
497
|
async getEntries() {
|
|
498
498
|
if (!this._entriesLoaded) {
|
|
499
499
|
const e = await this._getKeys();
|
|
500
500
|
await Promise.all(
|
|
501
|
-
e.map(async (
|
|
502
|
-
if (this._entries.has(
|
|
501
|
+
e.map(async (s) => {
|
|
502
|
+
if (this._entries.has(s))
|
|
503
503
|
return;
|
|
504
|
-
const
|
|
505
|
-
|
|
504
|
+
const n = await this.get(s);
|
|
505
|
+
n != null && this._entries.set(s, n);
|
|
506
506
|
})
|
|
507
507
|
), this._entriesLoaded = !0;
|
|
508
508
|
}
|
|
@@ -518,51 +518,51 @@ function xe(t) {
|
|
|
518
518
|
dir: t.dir,
|
|
519
519
|
tmpDir: t.tmpDir,
|
|
520
520
|
converterSubPath: ct({ suffix: ".value" })
|
|
521
|
-
}),
|
|
521
|
+
}), s = new it({
|
|
522
522
|
dir: t.dir,
|
|
523
523
|
tmpDir: t.tmpDir,
|
|
524
524
|
converterSubPath: ct({ suffix: ".error" })
|
|
525
|
-
});
|
|
525
|
+
}), n = t.compressOptions;
|
|
526
526
|
return {
|
|
527
527
|
converterInput: t.converterInput ?? Tt,
|
|
528
|
-
converterValue: t.converterValue ?? Ot,
|
|
529
|
-
converterError: xt,
|
|
528
|
+
converterValue: t.converterValue ?? Ot(n),
|
|
529
|
+
converterError: xt(n),
|
|
530
530
|
totalSize: t.totalSize,
|
|
531
531
|
getSize: {
|
|
532
|
-
value: (
|
|
533
|
-
error: (
|
|
532
|
+
value: (r) => r.byteLength,
|
|
533
|
+
error: (r) => r.byteLength,
|
|
534
534
|
stat: () => 0
|
|
535
535
|
},
|
|
536
536
|
isExpired: t.isExpired,
|
|
537
537
|
storages: {
|
|
538
538
|
value: e,
|
|
539
|
-
error:
|
|
540
|
-
stat: new
|
|
539
|
+
error: s,
|
|
540
|
+
stat: new Gt({
|
|
541
541
|
storages: {
|
|
542
542
|
value: e,
|
|
543
|
-
error:
|
|
543
|
+
error: s
|
|
544
544
|
}
|
|
545
545
|
})
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
return new Promise((
|
|
551
|
-
const r =
|
|
549
|
+
function Kt(t, e = {}) {
|
|
550
|
+
return new Promise((s, n) => {
|
|
551
|
+
const r = K(t, {
|
|
552
552
|
shell: !0,
|
|
553
553
|
...e
|
|
554
554
|
}), a = [];
|
|
555
555
|
r.stdout.on("data", (o) => {
|
|
556
556
|
a.push(o);
|
|
557
557
|
}), r.on("error", (o) => {
|
|
558
|
-
|
|
558
|
+
n(o);
|
|
559
559
|
}), r.on("exit", (o) => {
|
|
560
560
|
const i = Buffer.concat(a).toString("utf8");
|
|
561
561
|
if (o !== 0) {
|
|
562
|
-
|
|
562
|
+
n(new Error(`[exec][exit] code: ${o}`));
|
|
563
563
|
return;
|
|
564
564
|
}
|
|
565
|
-
|
|
565
|
+
s(i);
|
|
566
566
|
});
|
|
567
567
|
});
|
|
568
568
|
}
|
|
@@ -570,15 +570,15 @@ async function Oe() {
|
|
|
570
570
|
let t;
|
|
571
571
|
switch (process.platform) {
|
|
572
572
|
case "darwin":
|
|
573
|
-
t =
|
|
573
|
+
t = K("afplay", ["/System/Library/Sounds/Ping.aiff"], {
|
|
574
574
|
stdio: "ignore"
|
|
575
575
|
});
|
|
576
576
|
break;
|
|
577
577
|
case "linux":
|
|
578
|
-
t =
|
|
578
|
+
t = K("beep", [], { stdio: "ignore", shell: !0 });
|
|
579
579
|
break;
|
|
580
580
|
case "win32":
|
|
581
|
-
t =
|
|
581
|
+
t = K("powershell", ["-c", "[console]::beep(1000,300)"], {
|
|
582
582
|
stdio: "ignore"
|
|
583
583
|
});
|
|
584
584
|
break;
|
|
@@ -587,18 +587,18 @@ async function Oe() {
|
|
|
587
587
|
`[nodeBeep] Beep not supported on platform: ${process.platform}`
|
|
588
588
|
);
|
|
589
589
|
}
|
|
590
|
-
await new Promise((e,
|
|
591
|
-
t.on("error",
|
|
592
|
-
|
|
590
|
+
await new Promise((e, s) => {
|
|
591
|
+
t.on("error", s), t.on("close", (n) => {
|
|
592
|
+
n !== 0 ? s(new Error(`[nodeBeep] Beep process exited with code ${n}`)) : e();
|
|
593
593
|
});
|
|
594
594
|
});
|
|
595
595
|
}
|
|
596
596
|
async function Ht({
|
|
597
597
|
page: t,
|
|
598
598
|
urlFilters: e,
|
|
599
|
-
timeouts:
|
|
599
|
+
timeouts: s
|
|
600
600
|
}) {
|
|
601
|
-
return
|
|
601
|
+
return s || (s = {}), s.downloadInternal || (s.downloadInternal = 10 * 1e3), s.downloadExternal || (s.downloadExternal = 60 * 1e3), s.total || (s.total = 300 * 1e3), await Ct(
|
|
602
602
|
() => t.evaluate(
|
|
603
603
|
({
|
|
604
604
|
urlFilters: r,
|
|
@@ -652,13 +652,13 @@ async function Ht({
|
|
|
652
652
|
error: u.message
|
|
653
653
|
}));
|
|
654
654
|
g || (p = Promise.race([p, f]));
|
|
655
|
-
function
|
|
655
|
+
function _() {
|
|
656
656
|
m && clearTimeout(m);
|
|
657
657
|
}
|
|
658
658
|
return p.then(
|
|
659
|
-
(u) => (
|
|
659
|
+
(u) => (_(), u),
|
|
660
660
|
(u) => {
|
|
661
|
-
throw
|
|
661
|
+
throw _(), u;
|
|
662
662
|
}
|
|
663
663
|
);
|
|
664
664
|
}
|
|
@@ -675,32 +675,32 @@ async function Ht({
|
|
|
675
675
|
},
|
|
676
676
|
{
|
|
677
677
|
urlFilters: e,
|
|
678
|
-
timeouts:
|
|
678
|
+
timeouts: s
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
|
-
{ timeout:
|
|
681
|
+
{ timeout: s.total }
|
|
682
682
|
);
|
|
683
683
|
}
|
|
684
684
|
async function Vt({
|
|
685
685
|
page: t,
|
|
686
686
|
urlFilters: e,
|
|
687
|
-
errorFilter:
|
|
687
|
+
errorFilter: s
|
|
688
688
|
}) {
|
|
689
|
-
let
|
|
689
|
+
let n = await Ht({
|
|
690
690
|
page: t,
|
|
691
691
|
urlFilters: e
|
|
692
692
|
});
|
|
693
|
-
if (
|
|
693
|
+
if (n && (s && (n = n.filter(s)), n.length > 0))
|
|
694
694
|
throw new Error(
|
|
695
|
-
`[test][checkPageHttpErrors] Page has http errors: ${JSON.stringify(
|
|
695
|
+
`[test][checkPageHttpErrors] Page has http errors: ${JSON.stringify(n, null, 2)}`
|
|
696
696
|
);
|
|
697
697
|
}
|
|
698
|
-
async function
|
|
698
|
+
async function Yt({
|
|
699
699
|
page: t,
|
|
700
700
|
filter: e,
|
|
701
|
-
onError:
|
|
701
|
+
onError: s
|
|
702
702
|
}) {
|
|
703
|
-
const
|
|
703
|
+
const n = "callback_191b355ea6f64499a6607ad571da5d4d", r = t.context().browser()?.browserType().name(), a = _t();
|
|
704
704
|
function o(i) {
|
|
705
705
|
try {
|
|
706
706
|
if (e && !e({
|
|
@@ -716,12 +716,12 @@ async function qt({
|
|
|
716
716
|
`[test][subscribeJsErrors] BROWSER JS ERROR (${r}): ${i}`
|
|
717
717
|
);
|
|
718
718
|
const c = new Error(i);
|
|
719
|
-
c.stack = a,
|
|
719
|
+
c.stack = a, s(c);
|
|
720
720
|
} catch (c) {
|
|
721
721
|
console.error("[test][subscribeJsErrors] error", c);
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
await t.exposeFunction(
|
|
724
|
+
await t.exposeFunction(n, o), await t.addInitScript((i) => {
|
|
725
725
|
function c(d) {
|
|
726
726
|
if (Array.isArray(d))
|
|
727
727
|
return d.map(c).join(`\r
|
|
@@ -770,11 +770,11 @@ async function qt({
|
|
|
770
770
|
},
|
|
771
771
|
!0
|
|
772
772
|
);
|
|
773
|
-
},
|
|
773
|
+
}, n);
|
|
774
774
|
}
|
|
775
775
|
async function mt() {
|
|
776
776
|
try {
|
|
777
|
-
process.platform === "win32" && await
|
|
777
|
+
process.platform === "win32" && await Kt(
|
|
778
778
|
`wmic process where "commandline like '%ms-playwright%' and not commandline like '%wmic.exe%' and priority != 4" CALL setpriority "idle"`
|
|
779
779
|
);
|
|
780
780
|
} catch (t) {
|
|
@@ -788,27 +788,27 @@ let H = null, Z = null;
|
|
|
788
788
|
function Te(t) {
|
|
789
789
|
Z = t;
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function qt() {
|
|
792
792
|
if (H)
|
|
793
793
|
return;
|
|
794
794
|
const t = Z || (process.env.DELAY_ON_ERROR ? parseInt(process.env.DELAY_ON_ERROR, 10) : 0);
|
|
795
795
|
if (Z)
|
|
796
796
|
return console.log(`[test][delayOnError] Delay on error: ${t} ms`), H = ft(t), H;
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Ce() {
|
|
799
799
|
return H;
|
|
800
800
|
}
|
|
801
|
-
async function
|
|
802
|
-
const { page: e } = t,
|
|
803
|
-
|
|
801
|
+
async function Xt(t) {
|
|
802
|
+
const { page: e } = t, s = e.context().browser()?.browserType().name(), n = new ht(), r = rt(
|
|
803
|
+
n.signal,
|
|
804
804
|
t.abortSignal
|
|
805
805
|
), a = (i) => {
|
|
806
|
-
let c = `Error in (${
|
|
806
|
+
let c = `Error in (${s}) ${e.url()}
|
|
807
807
|
`;
|
|
808
808
|
t.pageFilePath && (c += ` at _ (${I.resolve(t.pageFilePath)}:0:0)
|
|
809
|
-
`), i.stack = c + (i.stack || i.message), i.message = c + i.message, console.error("[test][initPage] error", i),
|
|
809
|
+
`), i.stack = c + (i.stack || i.message), i.message = c + i.message, console.error("[test][initPage] error", i), n.abort(i);
|
|
810
810
|
};
|
|
811
|
-
return await
|
|
811
|
+
return await Yt({
|
|
812
812
|
page: e,
|
|
813
813
|
filter: t.filters?.js?.filter,
|
|
814
814
|
onError: a
|
|
@@ -823,22 +823,22 @@ async function Qt(t) {
|
|
|
823
823
|
}
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
|
-
async function
|
|
826
|
+
async function Qt({
|
|
827
827
|
page: t,
|
|
828
828
|
abortSignal: e,
|
|
829
|
-
filters:
|
|
830
|
-
func:
|
|
829
|
+
filters: s,
|
|
830
|
+
func: n,
|
|
831
831
|
pageFilePath: r
|
|
832
832
|
}) {
|
|
833
833
|
const a = t.context().browser()?.browserType().name();
|
|
834
834
|
try {
|
|
835
|
-
const { abortSignal: o, checkErrors: i } = await
|
|
835
|
+
const { abortSignal: o, checkErrors: i } = await Xt({
|
|
836
836
|
page: t,
|
|
837
837
|
abortSignal: e,
|
|
838
|
-
filters:
|
|
838
|
+
filters: s,
|
|
839
839
|
pageFilePath: r
|
|
840
840
|
});
|
|
841
|
-
await
|
|
841
|
+
await n({
|
|
842
842
|
page: t,
|
|
843
843
|
abortSignal: o,
|
|
844
844
|
checkErrors: i
|
|
@@ -850,14 +850,14 @@ async function Xt({
|
|
|
850
850
|
`), o.stack = i + (o.stack || o.message), o.message = i + o.message, o;
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function _e({
|
|
854
854
|
browserType: t,
|
|
855
855
|
options: e
|
|
856
856
|
}) {
|
|
857
|
-
return async function(
|
|
857
|
+
return async function(n) {
|
|
858
858
|
const r = await t.launch(e ?? void 0);
|
|
859
859
|
try {
|
|
860
|
-
return await
|
|
860
|
+
return await n(r);
|
|
861
861
|
} finally {
|
|
862
862
|
await r.close();
|
|
863
863
|
}
|
|
@@ -867,29 +867,29 @@ function Zt({
|
|
|
867
867
|
browser: t,
|
|
868
868
|
options: e
|
|
869
869
|
}) {
|
|
870
|
-
return async function(
|
|
870
|
+
return async function(n) {
|
|
871
871
|
const r = await t.newContext(e ?? void 0);
|
|
872
872
|
await mt();
|
|
873
873
|
try {
|
|
874
|
-
const a = await
|
|
874
|
+
const a = await n(r);
|
|
875
875
|
return await r.close(), a;
|
|
876
876
|
} catch (a) {
|
|
877
|
-
const o =
|
|
877
|
+
const o = qt?.();
|
|
878
878
|
throw o ? (console.error("[test][useBrowserContext] error", a), o.finally(() => r.close())) : await r.close(), a;
|
|
879
879
|
}
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
|
-
async function
|
|
883
|
-
const
|
|
884
|
-
for (const
|
|
885
|
-
await
|
|
882
|
+
async function ke(t, e) {
|
|
883
|
+
const s = await t.$$(e);
|
|
884
|
+
for (const n of s)
|
|
885
|
+
await n.click();
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const X = new ht();
|
|
888
888
|
let te = 0;
|
|
889
889
|
function ee(t) {
|
|
890
890
|
return async function({
|
|
891
|
-
browser:
|
|
892
|
-
contextOptions:
|
|
891
|
+
browser: s,
|
|
892
|
+
contextOptions: n,
|
|
893
893
|
name: r,
|
|
894
894
|
url: a,
|
|
895
895
|
pool: o,
|
|
@@ -898,7 +898,7 @@ function ee(t) {
|
|
|
898
898
|
...l
|
|
899
899
|
}, g) {
|
|
900
900
|
const d = rt(
|
|
901
|
-
|
|
901
|
+
X.signal,
|
|
902
902
|
g
|
|
903
903
|
);
|
|
904
904
|
try {
|
|
@@ -909,13 +909,13 @@ function ee(t) {
|
|
|
909
909
|
abortSignal: d,
|
|
910
910
|
func: async (h, x) => {
|
|
911
911
|
x.throwIfAborted(), await Zt({
|
|
912
|
-
browser:
|
|
913
|
-
options:
|
|
912
|
+
browser: s,
|
|
913
|
+
options: n
|
|
914
914
|
})(async (f) => {
|
|
915
915
|
x.throwIfAborted();
|
|
916
916
|
const m = await f.newPage();
|
|
917
917
|
await mt();
|
|
918
|
-
const p =
|
|
918
|
+
const p = s.browserType().name(), _ = x.subscribe(() => {
|
|
919
919
|
m.isClosed() || (m.close({
|
|
920
920
|
// reason: reason?.message,
|
|
921
921
|
runBeforeUnload: !1
|
|
@@ -924,7 +924,7 @@ function ee(t) {
|
|
|
924
924
|
}));
|
|
925
925
|
});
|
|
926
926
|
try {
|
|
927
|
-
console.log(`START ${r} (${p}): ${a}`), await
|
|
927
|
+
console.log(`START ${r} (${p}): ${a}`), await Qt({
|
|
928
928
|
page: m,
|
|
929
929
|
abortSignal: x,
|
|
930
930
|
filters: c,
|
|
@@ -941,28 +941,28 @@ function ee(t) {
|
|
|
941
941
|
`END [${te++}] ${r} (${p}): ${a}`
|
|
942
942
|
);
|
|
943
943
|
} catch (u) {
|
|
944
|
-
if (x.aborted || u instanceof
|
|
944
|
+
if (x.aborted || u instanceof nt) {
|
|
945
945
|
console.log(`ABORTED ${r} (${p}): ${a}`);
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
|
-
throw console.log(`ERROR ${r} (${p}): ${a}`),
|
|
948
|
+
throw console.log(`ERROR ${r} (${p}): ${a}`), X.signal.aborted || (console.log("unsubscribe on first error"), _()), X.abort(), u;
|
|
949
949
|
}
|
|
950
950
|
});
|
|
951
951
|
}
|
|
952
952
|
});
|
|
953
953
|
} catch (h) {
|
|
954
|
-
if (h instanceof
|
|
954
|
+
if (h instanceof nt)
|
|
955
955
|
return;
|
|
956
956
|
throw h;
|
|
957
957
|
}
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function ve(t) {
|
|
961
961
|
const e = ee(t);
|
|
962
|
-
return Mt(async (
|
|
962
|
+
return Mt(async (s) => await e(s));
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
const
|
|
964
|
+
function Pe(t, e) {
|
|
965
|
+
const s = e.stableTime, n = e.timeout, r = e.mutation ? {
|
|
966
966
|
childList: !!e.mutation.childList,
|
|
967
967
|
attributes: !!e.mutation.attributes,
|
|
968
968
|
characterData: !!e.mutation.characterData,
|
|
@@ -978,14 +978,14 @@ function De(t, e) {
|
|
|
978
978
|
({ stableTime: o, timeout: i, mutation: c, resource: l }) => {
|
|
979
979
|
return new Promise((h, x) => {
|
|
980
980
|
let f = Date.now(), m = null, p = null;
|
|
981
|
-
const
|
|
981
|
+
const _ = [];
|
|
982
982
|
function u() {
|
|
983
983
|
f = Date.now();
|
|
984
984
|
}
|
|
985
985
|
function y() {
|
|
986
986
|
m != null && (clearTimeout(m), m = null), p != null && (clearTimeout(p), p = null);
|
|
987
|
-
for (let w = 0,
|
|
988
|
-
|
|
987
|
+
for (let w = 0, C = _.length; w < C; w++)
|
|
988
|
+
_[w]();
|
|
989
989
|
}
|
|
990
990
|
function E() {
|
|
991
991
|
const w = o - (Date.now() - f);
|
|
@@ -993,11 +993,11 @@ function De(t, e) {
|
|
|
993
993
|
}
|
|
994
994
|
if (c) {
|
|
995
995
|
const w = g(c, u);
|
|
996
|
-
|
|
996
|
+
_.push(w);
|
|
997
997
|
}
|
|
998
998
|
if (l) {
|
|
999
999
|
const w = d(l, u);
|
|
1000
|
-
|
|
1000
|
+
_.push(w);
|
|
1001
1001
|
}
|
|
1002
1002
|
m = setTimeout(E, o), p = setTimeout(() => {
|
|
1003
1003
|
y(), x(
|
|
@@ -1032,62 +1032,62 @@ function De(t, e) {
|
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
1034
|
},
|
|
1035
|
-
{ stableTime:
|
|
1035
|
+
{ stableTime: s, timeout: n, mutation: r, resource: a }
|
|
1036
1036
|
);
|
|
1037
1037
|
}
|
|
1038
|
-
async function
|
|
1039
|
-
const
|
|
1040
|
-
await
|
|
1038
|
+
async function Q(t, e) {
|
|
1039
|
+
const s = v.dirname(t);
|
|
1040
|
+
await D.promises.stat(s).catch(() => null) || await D.promises.mkdir(s, { recursive: !0 }), await D.promises.writeFile(t, JSON.stringify(e, null, 4), {
|
|
1041
1041
|
encoding: "utf-8"
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
async function re(t) {
|
|
1045
|
-
if (!await
|
|
1045
|
+
if (!await D.promises.stat(t).catch(() => null))
|
|
1046
1046
|
return null;
|
|
1047
|
-
const e = await
|
|
1047
|
+
const e = await D.promises.readFile(t, { encoding: "utf-8" });
|
|
1048
1048
|
return JSON.parse(e);
|
|
1049
1049
|
}
|
|
1050
1050
|
const tt = "-", et = "+";
|
|
1051
|
-
function V(t, e,
|
|
1051
|
+
function V(t, e, s) {
|
|
1052
1052
|
if (t === e)
|
|
1053
1053
|
return null;
|
|
1054
1054
|
if (Array.isArray(t)) {
|
|
1055
1055
|
if (Array.isArray(e)) {
|
|
1056
1056
|
let r = null;
|
|
1057
1057
|
for (let a = 0, o = Math.max(e.length, e.length); a < o; a++) {
|
|
1058
|
-
const i = V(t[a], e[a],
|
|
1058
|
+
const i = V(t[a], e[a], s);
|
|
1059
1059
|
i != null && (r || (r = []), r.push(i));
|
|
1060
1060
|
}
|
|
1061
|
-
return r != null &&
|
|
1061
|
+
return r != null && s && (r = s(t, e, r)), r;
|
|
1062
1062
|
}
|
|
1063
1063
|
} else if (t instanceof Object && e instanceof Object) {
|
|
1064
1064
|
let r = null;
|
|
1065
1065
|
for (const a in t)
|
|
1066
1066
|
if (Object.prototype.hasOwnProperty.call(t, a)) {
|
|
1067
|
-
const o = V(t[a], e[a],
|
|
1067
|
+
const o = V(t[a], e[a], s);
|
|
1068
1068
|
o != null && (r || (r = {}), r[a] = o);
|
|
1069
1069
|
}
|
|
1070
1070
|
for (const a in e)
|
|
1071
1071
|
if (Object.prototype.hasOwnProperty.call(e, a) && !Object.prototype.hasOwnProperty.call(t, a)) {
|
|
1072
|
-
const o = V(t[a], e[a],
|
|
1072
|
+
const o = V(t[a], e[a], s);
|
|
1073
1073
|
o != null && (r || (r = {}), r[a] = o);
|
|
1074
1074
|
}
|
|
1075
|
-
return r != null &&
|
|
1075
|
+
return r != null && s && (r = s(t, e, r)), r;
|
|
1076
1076
|
}
|
|
1077
|
-
let
|
|
1077
|
+
let n = {
|
|
1078
1078
|
[tt]: t,
|
|
1079
1079
|
[et]: e
|
|
1080
1080
|
};
|
|
1081
|
-
return
|
|
1081
|
+
return s && (n = s(t, e, n)), n;
|
|
1082
1082
|
}
|
|
1083
1083
|
function lt(t) {
|
|
1084
1084
|
function e(u) {
|
|
1085
1085
|
return u.sort((y, E) => y[0] > E[0] ? 1 : -1).reduce((y, E) => (y[E[0]] = E[1], y), {});
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function s(u) {
|
|
1088
1088
|
return u.reduce((y, E) => (y[E] = !0, y), {});
|
|
1089
1089
|
}
|
|
1090
|
-
const
|
|
1090
|
+
const n = t.filters && t.filters.excludeAttrs && s(t.filters.excludeAttrs), r = t.filters && t.filters.fixAttrs, a = t.filters && t.filters.fixStyles, o = t.filters && t.filters.excludeStyles && s(t.filters.excludeStyles), i = t.filters && t.filters.fixTags, c = t.filters && t.filters.excludeClasses, l = t.filters && t.filters.excludeIds, g = t.filters && t.filters.excludeSelectorClasses, d = t.filters && t.filters.excludeSelectorIds;
|
|
1091
1091
|
let h;
|
|
1092
1092
|
if (t.filters && t.filters.excludeSelectors && t.filters.excludeSelectors.length > 0) {
|
|
1093
1093
|
const u = Array.from(
|
|
@@ -1096,16 +1096,16 @@ function lt(t) {
|
|
|
1096
1096
|
u.length > 0 && (h = new Set(u));
|
|
1097
1097
|
}
|
|
1098
1098
|
function x(u, y, E, w) {
|
|
1099
|
-
const
|
|
1100
|
-
for (let O = 0, T =
|
|
1101
|
-
const
|
|
1102
|
-
if (o && o[
|
|
1099
|
+
const C = getComputedStyle(u, y), S = [];
|
|
1100
|
+
for (let O = 0, T = C.length; O < T; O++) {
|
|
1101
|
+
const P = C[O];
|
|
1102
|
+
if (o && o[P])
|
|
1103
1103
|
continue;
|
|
1104
|
-
let b =
|
|
1104
|
+
let b = C[P];
|
|
1105
1105
|
if (b && a)
|
|
1106
|
-
for (let M = 0,
|
|
1107
|
-
a[M].name.test(
|
|
1108
|
-
(!E || E[
|
|
1106
|
+
for (let M = 0, k = a.length; M < k; M++)
|
|
1107
|
+
a[M].name.test(P) && (b = b.replace(a[M].search, a[M].replace));
|
|
1108
|
+
(!E || E[P] !== b) && (!w || w[P] === b) && S.push([P, b]);
|
|
1109
1109
|
}
|
|
1110
1110
|
return e(S);
|
|
1111
1111
|
}
|
|
@@ -1131,7 +1131,7 @@ function lt(t) {
|
|
|
1131
1131
|
)
|
|
1132
1132
|
};
|
|
1133
1133
|
}
|
|
1134
|
-
function m(u, y, E, w,
|
|
1134
|
+
function m(u, y, E, w, C) {
|
|
1135
1135
|
for (let S = 0, O = u.childNodes.length; S < O; S++) {
|
|
1136
1136
|
const T = u.childNodes[S];
|
|
1137
1137
|
if (!T)
|
|
@@ -1144,13 +1144,13 @@ You should wait js executions before test`
|
|
|
1144
1144
|
y,
|
|
1145
1145
|
E,
|
|
1146
1146
|
w,
|
|
1147
|
-
|
|
1147
|
+
C
|
|
1148
1148
|
);
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
-
function p(u, y, E, w,
|
|
1152
|
-
const S =
|
|
1153
|
-
if (
|
|
1151
|
+
function p(u, y, E, w, C) {
|
|
1152
|
+
const S = C && C[y.length];
|
|
1153
|
+
if (C && !S || h && h.has(u))
|
|
1154
1154
|
return;
|
|
1155
1155
|
let O = u.tagName && u.tagName.toLowerCase();
|
|
1156
1156
|
if (O === "head" && (E = !1), i)
|
|
@@ -1161,45 +1161,45 @@ You should wait js executions before test`
|
|
|
1161
1161
|
const T = [];
|
|
1162
1162
|
for (let j = 0, B = u.attributes.length; j < B; j++) {
|
|
1163
1163
|
const W = u.attributes.item(j);
|
|
1164
|
-
let z = W.name,
|
|
1165
|
-
if (z = z.toLowerCase(), z !== "class" && !(
|
|
1164
|
+
let z = W.name, G = W.value;
|
|
1165
|
+
if (z = z.toLowerCase(), z !== "class" && !(n && n[z])) {
|
|
1166
1166
|
if (r)
|
|
1167
|
-
for (let
|
|
1168
|
-
r[
|
|
1169
|
-
(!S || S.attrs && S.attrs[z] ===
|
|
1167
|
+
for (let J = 0, Et = r.length; J < Et; J++)
|
|
1168
|
+
r[J].name.test(z) && (G = G.replace(r[J].search, r[J].replace));
|
|
1169
|
+
(!S || S.attrs && S.attrs[z] === G) && T.push([z, G]);
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
|
-
const
|
|
1172
|
+
const P = [], b = [];
|
|
1173
1173
|
for (let j = 0, B = u.classList.length; j < B; j++) {
|
|
1174
1174
|
const W = u.classList.item(j);
|
|
1175
|
-
(!c || !c.test(W)) &&
|
|
1175
|
+
(!c || !c.test(W)) && P.push(W), (!g || !g.test(W)) && b.push(W);
|
|
1176
1176
|
}
|
|
1177
|
-
const M = E ? f(u, t.defaultStyle, S && S.style) : null,
|
|
1177
|
+
const M = E ? f(u, t.defaultStyle, S && S.style) : null, k = u.childElementCount ? [] : null;
|
|
1178
1178
|
u.id && (!l || !l.test(u.id)) && u.id;
|
|
1179
|
-
const L = u.id && (!d || !d.test(u.id)) ? u.id : "", N = (O || "") + (L ? "#" + L : "") + (b.length > 0 ? "." + b.join(".") : ""),
|
|
1179
|
+
const L = u.id && (!d || !d.test(u.id)) ? u.id : "", N = (O || "") + (L ? "#" + L : "") + (b.length > 0 ? "." + b.join(".") : ""), st = N ? w ? w + " > " + N : N : w, gt = {
|
|
1180
1180
|
tag: O,
|
|
1181
|
-
selector:
|
|
1182
|
-
classes:
|
|
1181
|
+
selector: st,
|
|
1182
|
+
classes: P,
|
|
1183
1183
|
attrs: T.length > 0 ? e(T) : null,
|
|
1184
1184
|
style: M,
|
|
1185
|
-
childs:
|
|
1185
|
+
childs: k
|
|
1186
1186
|
};
|
|
1187
|
-
y.push(gt),
|
|
1187
|
+
y.push(gt), k && m(
|
|
1188
1188
|
u,
|
|
1189
|
-
|
|
1189
|
+
k,
|
|
1190
1190
|
E,
|
|
1191
|
-
|
|
1191
|
+
st,
|
|
1192
1192
|
S && S.childs
|
|
1193
1193
|
);
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1195
|
+
const _ = [];
|
|
1196
1196
|
return p(
|
|
1197
1197
|
document.documentElement,
|
|
1198
|
-
|
|
1198
|
+
_,
|
|
1199
1199
|
!0,
|
|
1200
1200
|
"",
|
|
1201
1201
|
t.shouldEqualResult && [t.shouldEqualResult]
|
|
1202
|
-
),
|
|
1202
|
+
), _[0];
|
|
1203
1203
|
}
|
|
1204
1204
|
async function pt(t) {
|
|
1205
1205
|
const e = await t.context().newCDPSession(t);
|
|
@@ -1208,42 +1208,42 @@ async function pt(t) {
|
|
|
1208
1208
|
async function wt(t) {
|
|
1209
1209
|
await t.send("CSS.disable"), await t.send("DOM.disable"), await t.detach();
|
|
1210
1210
|
}
|
|
1211
|
-
async function
|
|
1212
|
-
const
|
|
1211
|
+
async function De(t, e) {
|
|
1212
|
+
const s = await pt(t);
|
|
1213
1213
|
try {
|
|
1214
|
-
return await e(
|
|
1214
|
+
return await e(s);
|
|
1215
1215
|
} finally {
|
|
1216
|
-
await wt(
|
|
1216
|
+
await wt(s);
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
|
-
async function
|
|
1220
|
-
const { nodes:
|
|
1219
|
+
async function se(t, e) {
|
|
1220
|
+
const { nodes: s } = await t.send("DOM.getFlattenedDocument", {
|
|
1221
1221
|
depth: -1,
|
|
1222
1222
|
pierce: !0
|
|
1223
|
-
}),
|
|
1224
|
-
for (const r of
|
|
1223
|
+
}), n = s.filter((r) => r.nodeType === 1).map((r) => r.nodeId);
|
|
1224
|
+
for (const r of n)
|
|
1225
1225
|
await t.send("CSS.forcePseudoState", {
|
|
1226
1226
|
nodeId: r,
|
|
1227
1227
|
forcedPseudoClasses: e
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function Y(t, e) {
|
|
1231
1231
|
if (!t || !e)
|
|
1232
1232
|
return e || null;
|
|
1233
|
-
let
|
|
1234
|
-
for (const
|
|
1235
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
1236
|
-
for (const
|
|
1237
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
1238
|
-
return
|
|
1233
|
+
let s = null;
|
|
1234
|
+
for (const n in e)
|
|
1235
|
+
Object.prototype.hasOwnProperty.call(e, n) && e[n] !== t[n] && (s || (s = {}), s[n] = e[n]);
|
|
1236
|
+
for (const n in t)
|
|
1237
|
+
Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && (s || (s = {}), s[n] = "");
|
|
1238
|
+
return s;
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function ne(t, e) {
|
|
1241
1241
|
if (!t || !e)
|
|
1242
1242
|
return e || null;
|
|
1243
|
-
const
|
|
1244
|
-
return !
|
|
1245
|
-
_:
|
|
1246
|
-
before:
|
|
1243
|
+
const s = Y(t._, e._), n = Y(t.before, e.before), r = Y(t.after, e.after);
|
|
1244
|
+
return !s && !n && !r ? null : {
|
|
1245
|
+
_: s || {},
|
|
1246
|
+
before: n || {},
|
|
1247
1247
|
after: r || {}
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
@@ -1252,13 +1252,13 @@ function ae(t, e) {
|
|
|
1252
1252
|
return e || null;
|
|
1253
1253
|
if (t.length !== e.length)
|
|
1254
1254
|
return e;
|
|
1255
|
-
for (let
|
|
1256
|
-
if (t[
|
|
1255
|
+
for (let s = 0, n = t.length; s < n; s++)
|
|
1256
|
+
if (t[s] !== e[s])
|
|
1257
1257
|
return e;
|
|
1258
1258
|
return null;
|
|
1259
1259
|
}
|
|
1260
1260
|
function yt(t, e) {
|
|
1261
|
-
const
|
|
1261
|
+
const s = ae(t.classes, e.classes), n = Y(t.attrs, e.attrs), r = ne(t.style, e.style);
|
|
1262
1262
|
let a = null;
|
|
1263
1263
|
if (t.childs && e.childs) {
|
|
1264
1264
|
const o = Math.min(t.childs.length, e.childs.length);
|
|
@@ -1274,57 +1274,57 @@ function yt(t, e) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
return !
|
|
1277
|
+
return !s && !n && !r && !a ? null : {
|
|
1278
1278
|
tag: e.tag,
|
|
1279
1279
|
selector: e.selector,
|
|
1280
|
-
classes:
|
|
1281
|
-
attrs:
|
|
1280
|
+
classes: s,
|
|
1281
|
+
attrs: n,
|
|
1282
1282
|
style: r,
|
|
1283
1283
|
childs: a
|
|
1284
1284
|
};
|
|
1285
1285
|
}
|
|
1286
|
-
const
|
|
1287
|
-
const r =
|
|
1286
|
+
const q = (t, e, s, n) => {
|
|
1287
|
+
const r = n(t, e, s, n);
|
|
1288
1288
|
if (r == null)
|
|
1289
1289
|
return r;
|
|
1290
1290
|
if (Array.isArray(r))
|
|
1291
1291
|
return r.map(
|
|
1292
|
-
(a, o, i) =>
|
|
1292
|
+
(a, o, i) => q(a, o, i, n)
|
|
1293
1293
|
);
|
|
1294
1294
|
if (typeof r == "object") {
|
|
1295
1295
|
const a = {};
|
|
1296
1296
|
for (const o in r)
|
|
1297
|
-
Object.prototype.hasOwnProperty.call(r, o) && (a[o] =
|
|
1297
|
+
Object.prototype.hasOwnProperty.call(r, o) && (a[o] = q(r[o], o, r, n));
|
|
1298
1298
|
return a;
|
|
1299
1299
|
}
|
|
1300
1300
|
return r;
|
|
1301
1301
|
};
|
|
1302
1302
|
function bt(t, e) {
|
|
1303
1303
|
if (t.attrs && e.excludeAttrs) {
|
|
1304
|
-
for (let
|
|
1305
|
-
delete t.attrs[e.excludeAttrs[
|
|
1304
|
+
for (let s = 0, n = e.excludeAttrs.length; s < n; s++)
|
|
1305
|
+
delete t.attrs[e.excludeAttrs[s]];
|
|
1306
1306
|
Object.keys(t.attrs).length === 0 && (t.attrs = null);
|
|
1307
1307
|
}
|
|
1308
1308
|
if (t.classes && e.excludeClasses && (t.classes = t.classes.filter(
|
|
1309
|
-
(
|
|
1309
|
+
(s) => !e.excludeClasses.test(s)
|
|
1310
1310
|
)), t.style && e.excludeStyles)
|
|
1311
|
-
for (const
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1311
|
+
for (const s of ["_", "before", "after"]) {
|
|
1312
|
+
const n = t.style[s];
|
|
1313
|
+
if (n)
|
|
1314
1314
|
for (let r = 0, a = e.excludeStyles.length; r < a; r++)
|
|
1315
|
-
delete
|
|
1315
|
+
delete n[e.excludeStyles[r]];
|
|
1316
1316
|
}
|
|
1317
1317
|
if (t.childs)
|
|
1318
|
-
for (let
|
|
1319
|
-
bt(t.childs[
|
|
1318
|
+
for (let s = 0, n = t.childs.length; s < n; s++)
|
|
1319
|
+
bt(t.childs[s], e);
|
|
1320
1320
|
}
|
|
1321
1321
|
function oe(t, e) {
|
|
1322
|
-
for (const
|
|
1323
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
1324
|
-
const
|
|
1325
|
-
for (const r in
|
|
1326
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1327
|
-
const a =
|
|
1322
|
+
for (const s in t) {
|
|
1323
|
+
if (!Object.prototype.hasOwnProperty.call(t, s)) continue;
|
|
1324
|
+
const n = t[s];
|
|
1325
|
+
for (const r in n) {
|
|
1326
|
+
if (!Object.prototype.hasOwnProperty.call(n, r)) continue;
|
|
1327
|
+
const a = n[r];
|
|
1328
1328
|
for (const o in a)
|
|
1329
1329
|
Object.prototype.hasOwnProperty.call(a, o) && bt(a[o], e);
|
|
1330
1330
|
}
|
|
@@ -1333,15 +1333,15 @@ function oe(t, e) {
|
|
|
1333
1333
|
function Ae({
|
|
1334
1334
|
actualResultFile: t,
|
|
1335
1335
|
expectedResultFile: e,
|
|
1336
|
-
diffResultFile:
|
|
1337
|
-
filters:
|
|
1336
|
+
diffResultFile: s,
|
|
1337
|
+
filters: n,
|
|
1338
1338
|
transform: r,
|
|
1339
1339
|
pseudoStates: a
|
|
1340
1340
|
}) {
|
|
1341
1341
|
let o, i, c, l = {};
|
|
1342
1342
|
return {
|
|
1343
1343
|
async init(g) {
|
|
1344
|
-
o = await re(e), r && (o =
|
|
1344
|
+
o = await re(e), r && (o = q(o, null, null, r)), o && n && oe(o, n), await g.goto("about:blank"), i = await g.evaluate(lt, { filters: n }), c = i.style;
|
|
1345
1345
|
},
|
|
1346
1346
|
async handlePage({
|
|
1347
1347
|
page: g,
|
|
@@ -1356,30 +1356,30 @@ function Ae({
|
|
|
1356
1356
|
p || (p = {}, m[h.href] = p), await g.addStyleTag({
|
|
1357
1357
|
content: "*, *::before, *::after { animation-name: none!important; transition-duration: 0s !important; }"
|
|
1358
1358
|
});
|
|
1359
|
-
const
|
|
1359
|
+
const _ = a ?? [{ states: [] }];
|
|
1360
1360
|
let u = null, y;
|
|
1361
1361
|
try {
|
|
1362
|
-
for (let E = 0; E <
|
|
1363
|
-
const w =
|
|
1362
|
+
for (let E = 0; E < _.length; E++) {
|
|
1363
|
+
const w = _[E], C = w.states.length > 0 ? x + ":" + w.states.join(":") : x;
|
|
1364
1364
|
let S = null;
|
|
1365
1365
|
if (w.states.length > 0) {
|
|
1366
1366
|
u || (u = await pt(g));
|
|
1367
1367
|
const b = performance.now();
|
|
1368
|
-
await
|
|
1368
|
+
await se(u, w.states), S = performance.now() - b;
|
|
1369
1369
|
}
|
|
1370
1370
|
w.delay && await ft(w.delay);
|
|
1371
1371
|
const O = performance.now(), T = await g.evaluate(lt, {
|
|
1372
|
-
filters: f ||
|
|
1372
|
+
filters: f || n,
|
|
1373
1373
|
defaultStyle: c,
|
|
1374
|
-
shouldEqualResult: p[
|
|
1375
|
-
}),
|
|
1374
|
+
shouldEqualResult: p[C]
|
|
1375
|
+
}), P = performance.now() - O;
|
|
1376
1376
|
if (console.log(
|
|
1377
|
-
`SNAPSHOT ${
|
|
1377
|
+
`SNAPSHOT ${C}:` + (S != null ? ` forcePseudoClasses ${S.toFixed(0)}ms,` : "") + ` getAllElements ${P.toFixed(0)}ms`
|
|
1378
1378
|
), !y)
|
|
1379
|
-
y = T, p[
|
|
1379
|
+
y = T, p[C] = T;
|
|
1380
1380
|
else {
|
|
1381
1381
|
const b = yt(y, T);
|
|
1382
|
-
b && (p[
|
|
1382
|
+
b && (p[C] = b);
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
1385
|
} finally {
|
|
@@ -1387,7 +1387,7 @@ function Ae({
|
|
|
1387
1387
|
}
|
|
1388
1388
|
},
|
|
1389
1389
|
async end({ checkExistUrlsOnly: g }) {
|
|
1390
|
-
if (l =
|
|
1390
|
+
if (l = kt(l), r && (l = q(l, null, null, r)), o) {
|
|
1391
1391
|
let d, h;
|
|
1392
1392
|
if (!g)
|
|
1393
1393
|
d = o, h = l;
|
|
@@ -1405,13 +1405,13 @@ function Ae({
|
|
|
1405
1405
|
h,
|
|
1406
1406
|
(f, m, p) => p.selector && (delete p.selector, Object.keys(p).length === 0) ? null : p.childs && p.childs.length === 1 ? p.childs[0] : (m && m.selector ? p[et] ? p[et] = m.selector : p = { selector: m.selector, ...p } : f && f.selector && (p[tt] ? p[tt] = f.selector : p = { selector: f.selector, ...p }), p)
|
|
1407
1407
|
);
|
|
1408
|
-
if (
|
|
1409
|
-
throw await
|
|
1408
|
+
if (s && await Q(s, x || {}), x)
|
|
1409
|
+
throw await Q(t, l), console.error(
|
|
1410
1410
|
"Pages elements changes: " + JSON.stringify(x, null, 4).substring(0, 5e3)
|
|
1411
1411
|
), new Error("Pages elements changes detected");
|
|
1412
|
-
await
|
|
1412
|
+
await D.promises.stat(t).catch(() => null) && await D.promises.unlink(t);
|
|
1413
1413
|
} else
|
|
1414
|
-
await
|
|
1414
|
+
await Q(e, l);
|
|
1415
1415
|
return l;
|
|
1416
1416
|
}
|
|
1417
1417
|
};
|
|
@@ -1423,7 +1423,7 @@ export {
|
|
|
1423
1423
|
Re as ConsoleMessageLevel,
|
|
1424
1424
|
et as DIFF_NEW,
|
|
1425
1425
|
tt as DIFF_OLD,
|
|
1426
|
-
|
|
1426
|
+
Gt as FileStatStorage,
|
|
1427
1427
|
it as FileStorage,
|
|
1428
1428
|
Ne as Lazy,
|
|
1429
1429
|
$e as LazyWithId,
|
|
@@ -1431,22 +1431,22 @@ export {
|
|
|
1431
1431
|
St as LockerWithId,
|
|
1432
1432
|
ze as LogLevel,
|
|
1433
1433
|
Be as MAX_REPORT_ITEMS_DEFAULT,
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1434
|
+
Je as MatchInternalError,
|
|
1435
|
+
Ue as Matcher,
|
|
1436
|
+
Ge as MatcherAny,
|
|
1437
|
+
Ke as MatcherArray,
|
|
1438
1438
|
He as MatcherArrayItem,
|
|
1439
1439
|
Ve as MatcherConvert,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1440
|
+
Ye as MatcherCustom,
|
|
1441
|
+
qe as MatcherFew,
|
|
1442
|
+
Xe as MatcherIn,
|
|
1443
|
+
Qe as MatcherInstanceOf,
|
|
1444
1444
|
Ze as MatcherIs,
|
|
1445
1445
|
tr as MatcherNever,
|
|
1446
1446
|
er as MatcherNot,
|
|
1447
1447
|
rr as MatcherNumber,
|
|
1448
|
-
|
|
1449
|
-
|
|
1448
|
+
sr as MatcherObject,
|
|
1449
|
+
nr as MatcherObjectEntry,
|
|
1450
1450
|
ar as MatcherRef,
|
|
1451
1451
|
or as MatcherString,
|
|
1452
1452
|
ir as MemoryStorage,
|
|
@@ -1460,187 +1460,190 @@ export {
|
|
|
1460
1460
|
pr as check,
|
|
1461
1461
|
wr as checkFunc,
|
|
1462
1462
|
Vt as checkPageHttpErrors,
|
|
1463
|
-
|
|
1463
|
+
ke as clickAll,
|
|
1464
1464
|
yr as compressGzip,
|
|
1465
1465
|
br as consoleIntercept,
|
|
1466
1466
|
gr as consoleMessageToString,
|
|
1467
1467
|
Er as consoleReplace,
|
|
1468
1468
|
Sr as convertTimeZone,
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1469
|
+
xr as converterErrorToBuffer,
|
|
1470
|
+
Or as converterJson,
|
|
1471
|
+
Tr as converterJsonBuffer,
|
|
1472
|
+
Cr as converterStringToBuffer,
|
|
1473
1473
|
pt as createCDPSession,
|
|
1474
|
+
_r as createConverterBufferToGzip,
|
|
1475
|
+
xt as createConverterErrorToGzip,
|
|
1476
|
+
Ot as createConverterJsonGzip,
|
|
1474
1477
|
ct as createConverterSubPath,
|
|
1475
1478
|
xe as createFileCacheOptions,
|
|
1476
1479
|
Ee as createMatchPath,
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
+
kr as createMatchResult,
|
|
1481
|
+
vr as createMatchResultBoolean,
|
|
1482
|
+
Pr as createMatchResultError,
|
|
1480
1483
|
Ae as createPagesElementsChangesTest,
|
|
1481
|
-
|
|
1484
|
+
Dr as createTaskDelayRetry,
|
|
1482
1485
|
ee as createTestE2e,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1486
|
+
ve as createTestE2eVariants,
|
|
1487
|
+
Ar as createUniquePseudoRandom,
|
|
1488
|
+
Mr as dateNowUnique,
|
|
1489
|
+
jr as decompressGzip,
|
|
1490
|
+
Lr as deepCloneJsonLike,
|
|
1491
|
+
Fr as deepEqualJsonLike,
|
|
1492
|
+
Ir as deepEqualJsonLikeMap,
|
|
1493
|
+
qt as delayOnErrorCall,
|
|
1491
1494
|
Te as delayOnErrorSet,
|
|
1492
|
-
|
|
1495
|
+
Ce as delayOnErrorWait,
|
|
1493
1496
|
wt as destroyCDPSession,
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1497
|
+
Rr as equalArray,
|
|
1498
|
+
Nr as escapeHtml,
|
|
1499
|
+
$r as escapeRegExp,
|
|
1500
|
+
Kt as exec,
|
|
1501
|
+
Wr as expectedToString,
|
|
1499
1502
|
be as fileLock,
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1503
|
+
zr as filterMatchResult,
|
|
1504
|
+
Br as filterMatchResultNested,
|
|
1505
|
+
Jr as fixStackTrace,
|
|
1506
|
+
se as forcePseudoClasses,
|
|
1507
|
+
Ur as formatAny,
|
|
1508
|
+
Gr as formatDate,
|
|
1509
|
+
Kr as formatDateFileName,
|
|
1507
1510
|
Lt as generateTempFileName,
|
|
1508
1511
|
lt as getAllElements,
|
|
1509
|
-
|
|
1510
|
-
|
|
1512
|
+
Hr as getConsoleMessages,
|
|
1513
|
+
Vr as getDateInet,
|
|
1511
1514
|
It as getDrive,
|
|
1512
1515
|
yt as getElementsStyleDiff,
|
|
1513
1516
|
Rt as getFileId,
|
|
1514
1517
|
Tt as getHashKey,
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
+
Yr as getJsonKey,
|
|
1519
|
+
kt as getNormalizedObject,
|
|
1520
|
+
qr as getObjectId,
|
|
1518
1521
|
V as getObjectsDiff,
|
|
1519
1522
|
Ht as getPageHttpErrors,
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
+
Xr as getRandomFunc,
|
|
1524
|
+
Qr as getRandomSeed,
|
|
1525
|
+
_t as getStackTrace,
|
|
1523
1526
|
Wt as globGitIgnoreToPicomatch,
|
|
1524
1527
|
zt as globToRelative,
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1528
|
+
Xt as initPage,
|
|
1529
|
+
Zr as isGzipCompressed,
|
|
1530
|
+
ts as isMatcher,
|
|
1531
|
+
es as isObservable,
|
|
1529
1532
|
Se as loadGlobs,
|
|
1530
1533
|
Bt as loadGlobsFromFile,
|
|
1531
1534
|
re as loadJson,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1535
|
+
rs as mapObjectConverter,
|
|
1536
|
+
ss as match,
|
|
1537
|
+
ns as matchAnd,
|
|
1538
|
+
as as matchAndPipe,
|
|
1539
|
+
os as matchAny,
|
|
1540
|
+
is as matchArray,
|
|
1541
|
+
cs as matchArrayBuffer,
|
|
1542
|
+
ls as matchArrayIncludes,
|
|
1543
|
+
us as matchArrayItem,
|
|
1544
|
+
fs as matchArrayLength,
|
|
1545
|
+
hs as matchArrayWith,
|
|
1546
|
+
ds as matchBoolean,
|
|
1547
|
+
ms as matchConstructor,
|
|
1548
|
+
ps as matchConvert,
|
|
1549
|
+
ws as matchCustom,
|
|
1550
|
+
ys as matchDeep,
|
|
1551
|
+
bs as matchEnum,
|
|
1552
|
+
gs as matchFloat,
|
|
1553
|
+
Es as matchIn,
|
|
1554
|
+
Ss as matchInstanceOf,
|
|
1555
|
+
xs as matchInt,
|
|
1556
|
+
Os as matchIntDate,
|
|
1557
|
+
Ts as matchIs,
|
|
1558
|
+
Cs as matchIsNonStrict,
|
|
1559
|
+
_s as matchNever,
|
|
1560
|
+
ks as matchNot,
|
|
1561
|
+
vs as matchNotNullish,
|
|
1562
|
+
Ps as matchNullish,
|
|
1563
|
+
Ds as matchNumber,
|
|
1564
|
+
As as matchObject,
|
|
1565
|
+
Ms as matchObjectEntries,
|
|
1566
|
+
js as matchObjectEntry,
|
|
1567
|
+
Ls as matchObjectKey,
|
|
1568
|
+
Fs as matchObjectKeyValue,
|
|
1569
|
+
Is as matchObjectKeys,
|
|
1570
|
+
Rs as matchObjectKeysNotNull,
|
|
1571
|
+
Ns as matchObjectPartial,
|
|
1572
|
+
$s as matchObjectValue,
|
|
1573
|
+
Ws as matchObjectValues,
|
|
1574
|
+
zs as matchObjectWith,
|
|
1575
|
+
Bs as matchOptional,
|
|
1576
|
+
Js as matchOr,
|
|
1577
|
+
Us as matchOrPipe,
|
|
1578
|
+
Gs as matchRange,
|
|
1579
|
+
Ks as matchRangeDate,
|
|
1580
|
+
Hs as matchRef,
|
|
1581
|
+
Vs as matchResultNestedToString,
|
|
1582
|
+
Ys as matchResultToString,
|
|
1583
|
+
qs as matchString,
|
|
1584
|
+
Xs as matchStringLength,
|
|
1585
|
+
Qs as matchTypeOf,
|
|
1586
|
+
Zs as matchUuid,
|
|
1587
|
+
tn as matchValueState,
|
|
1588
|
+
en as max,
|
|
1589
|
+
rn as min,
|
|
1590
|
+
sn as minMax,
|
|
1588
1591
|
Oe as nodeBeep,
|
|
1589
|
-
|
|
1590
|
-
|
|
1592
|
+
nn as numberMod,
|
|
1593
|
+
q as objectTransform,
|
|
1591
1594
|
F as pathNormalize,
|
|
1592
1595
|
Nt as pathResolve,
|
|
1593
1596
|
R as poolFs,
|
|
1594
1597
|
ut as promiseAllWait,
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1598
|
+
an as randomBoolean,
|
|
1599
|
+
on as randomEnum,
|
|
1600
|
+
cn as randomFloat,
|
|
1601
|
+
ln as randomIndexWeighted,
|
|
1602
|
+
un as randomInt,
|
|
1603
|
+
fn as randomItem,
|
|
1604
|
+
hn as randomItems,
|
|
1605
|
+
Ut as readDirRecursive,
|
|
1606
|
+
Q as saveJson,
|
|
1607
|
+
dn as setArrayConverter,
|
|
1608
|
+
mn as setFuncName,
|
|
1606
1609
|
mt as setPlaywrightPriorityLow,
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1610
|
+
pn as sha256,
|
|
1611
|
+
wn as sha256Buffer,
|
|
1612
|
+
Yt as subscribeJsErrors,
|
|
1613
|
+
Qt as testPage,
|
|
1614
|
+
yn as timeoutAbortController,
|
|
1615
|
+
bn as toConvertFrom,
|
|
1616
|
+
gn as toConvertTo,
|
|
1617
|
+
En as toConvertWithDefaultFrom,
|
|
1618
|
+
Sn as toConvertWithDefaultTo,
|
|
1619
|
+
xn as toConverter,
|
|
1620
|
+
On as toConverterFrom,
|
|
1621
|
+
Tn as toConverterTo,
|
|
1622
|
+
Cn as toConverterWithDefault,
|
|
1623
|
+
_n as toConverterWithDefaultFrom,
|
|
1624
|
+
kn as toConverterWithDefaultTo,
|
|
1625
|
+
vn as toCorrect,
|
|
1626
|
+
Pn as toCorrectWithDefault,
|
|
1627
|
+
Dn as toHex,
|
|
1628
|
+
An as truncateString,
|
|
1629
|
+
Mn as urlGetBoolean,
|
|
1630
|
+
jn as urlGetFloat,
|
|
1631
|
+
Ln as urlGetInt,
|
|
1632
|
+
Fn as urlGetParams,
|
|
1633
|
+
In as urlGetString,
|
|
1634
|
+
Rn as urlParamToBoolean,
|
|
1635
|
+
Nn as urlParamToFloat,
|
|
1636
|
+
$n as urlParamToInt,
|
|
1637
|
+
_e as useBrowser,
|
|
1635
1638
|
Zt as useBrowserContext,
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1639
|
+
De as usingCDPSession,
|
|
1640
|
+
Wn as validateMatchResult,
|
|
1641
|
+
zn as waitObservable,
|
|
1642
|
+
Pe as waitPageStable,
|
|
1640
1643
|
$t as walkPathHandleErrorDefault,
|
|
1641
1644
|
ge as walkPaths,
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
+
Bn as withConsoleReplace,
|
|
1646
|
+
Jn as withRetry,
|
|
1647
|
+
Ct as withTimeout,
|
|
1645
1648
|
jt as writeFileThroughTmp
|
|
1646
1649
|
};
|