@checkly/playwright-core 1.51.17-beta.3 → 1.51.17

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.
@@ -1,251 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var utilityScriptSerializers_exports = {};
20
- __export(utilityScriptSerializers_exports, {
21
- parseEvaluationResultValue: () => parseEvaluationResultValue,
22
- serializeAsCallArgument: () => serializeAsCallArgument
23
- });
24
- module.exports = __toCommonJS(utilityScriptSerializers_exports);
25
- function isRegExp(obj) {
26
- try {
27
- return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
28
- } catch (error) {
29
- return false;
30
- }
31
- }
32
- function isDate(obj) {
33
- try {
34
- return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";
35
- } catch (error) {
36
- return false;
37
- }
38
- }
39
- function isURL(obj) {
40
- try {
41
- return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";
42
- } catch (error) {
43
- return false;
44
- }
45
- }
46
- function isError(obj) {
47
- try {
48
- return obj instanceof Error || obj && Object.getPrototypeOf(obj)?.name === "Error";
49
- } catch (error) {
50
- return false;
51
- }
52
- }
53
- function isTypedArray(obj, constructor) {
54
- try {
55
- return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;
56
- } catch (error) {
57
- return false;
58
- }
59
- }
60
- const typedArrayConstructors = {
61
- i8: Int8Array,
62
- ui8: Uint8Array,
63
- ui8c: Uint8ClampedArray,
64
- i16: Int16Array,
65
- ui16: Uint16Array,
66
- i32: Int32Array,
67
- ui32: Uint32Array,
68
- // TODO: add Float16Array once it's in baseline
69
- f32: Float32Array,
70
- f64: Float64Array,
71
- bi64: BigInt64Array,
72
- bui64: BigUint64Array
73
- };
74
- function typedArrayToBase64(array) {
75
- if ("toBase64" in array)
76
- return array.toBase64();
77
- const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");
78
- return btoa(binary);
79
- }
80
- function base64ToTypedArray(base64, TypedArrayConstructor) {
81
- const binary = atob(base64);
82
- const bytes = new Uint8Array(binary.length);
83
- for (let i = 0; i < binary.length; i++)
84
- bytes[i] = binary.charCodeAt(i);
85
- return new TypedArrayConstructor(bytes.buffer);
86
- }
87
- function parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {
88
- if (Object.is(value, void 0))
89
- return void 0;
90
- if (typeof value === "object" && value) {
91
- if ("ref" in value)
92
- return refs.get(value.ref);
93
- if ("v" in value) {
94
- if (value.v === "undefined")
95
- return void 0;
96
- if (value.v === "null")
97
- return null;
98
- if (value.v === "NaN")
99
- return NaN;
100
- if (value.v === "Infinity")
101
- return Infinity;
102
- if (value.v === "-Infinity")
103
- return -Infinity;
104
- if (value.v === "-0")
105
- return -0;
106
- return void 0;
107
- }
108
- if ("d" in value) {
109
- return new Date(value.d);
110
- }
111
- if ("u" in value)
112
- return new URL(value.u);
113
- if ("bi" in value)
114
- return BigInt(value.bi);
115
- if ("e" in value) {
116
- const error = new Error(value.e.m);
117
- error.name = value.e.n;
118
- error.stack = value.e.s;
119
- return error;
120
- }
121
- if ("r" in value)
122
- return new RegExp(value.r.p, value.r.f);
123
- if ("a" in value) {
124
- const result = [];
125
- refs.set(value.id, result);
126
- for (const a of value.a)
127
- result.push(parseEvaluationResultValue(a, handles, refs));
128
- return result;
129
- }
130
- if ("o" in value) {
131
- const result = {};
132
- refs.set(value.id, result);
133
- for (const { k, v } of value.o) {
134
- if (k === "__proto__")
135
- continue;
136
- result[k] = parseEvaluationResultValue(v, handles, refs);
137
- }
138
- return result;
139
- }
140
- if ("h" in value)
141
- return handles[value.h];
142
- if ("ta" in value)
143
- return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);
144
- }
145
- return value;
146
- }
147
- function serializeAsCallArgument(value, handleSerializer) {
148
- return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });
149
- }
150
- function serialize(value, handleSerializer, visitorInfo) {
151
- if (value && typeof value === "object") {
152
- if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)
153
- return "ref: <Window>";
154
- if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)
155
- return "ref: <Document>";
156
- if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)
157
- return "ref: <Node>";
158
- }
159
- return innerSerialize(value, handleSerializer, visitorInfo);
160
- }
161
- function innerSerialize(value, handleSerializer, visitorInfo) {
162
- const result = handleSerializer(value);
163
- if ("fallThrough" in result)
164
- value = result.fallThrough;
165
- else
166
- return result;
167
- if (typeof value === "symbol")
168
- return { v: "undefined" };
169
- if (Object.is(value, void 0))
170
- return { v: "undefined" };
171
- if (Object.is(value, null))
172
- return { v: "null" };
173
- if (Object.is(value, NaN))
174
- return { v: "NaN" };
175
- if (Object.is(value, Infinity))
176
- return { v: "Infinity" };
177
- if (Object.is(value, -Infinity))
178
- return { v: "-Infinity" };
179
- if (Object.is(value, -0))
180
- return { v: "-0" };
181
- if (typeof value === "boolean")
182
- return value;
183
- if (typeof value === "number")
184
- return value;
185
- if (typeof value === "string")
186
- return value;
187
- if (typeof value === "bigint")
188
- return { bi: value.toString() };
189
- if (isError(value)) {
190
- let stack;
191
- if (value.stack?.startsWith(value.name + ": " + value.message)) {
192
- stack = value.stack;
193
- } else {
194
- stack = `${value.name}: ${value.message}
195
- ${value.stack}`;
196
- }
197
- return { e: { n: value.name, m: value.message, s: stack } };
198
- }
199
- if (isDate(value))
200
- return { d: value.toJSON() };
201
- if (isURL(value))
202
- return { u: value.toJSON() };
203
- if (isRegExp(value))
204
- return { r: { p: value.source, f: value.flags } };
205
- for (const [k, ctor] of Object.entries(typedArrayConstructors)) {
206
- if (isTypedArray(value, ctor))
207
- return { ta: { b: typedArrayToBase64(value), k } };
208
- }
209
- const id = visitorInfo.visited.get(value);
210
- if (id)
211
- return { ref: id };
212
- if (Array.isArray(value)) {
213
- const a = [];
214
- const id2 = ++visitorInfo.lastId;
215
- visitorInfo.visited.set(value, id2);
216
- for (let i = 0; i < value.length; ++i)
217
- a.push(serialize(value[i], handleSerializer, visitorInfo));
218
- return { a, id: id2 };
219
- }
220
- if (typeof value === "object") {
221
- const o = [];
222
- const id2 = ++visitorInfo.lastId;
223
- visitorInfo.visited.set(value, id2);
224
- for (const name of Object.keys(value)) {
225
- let item;
226
- try {
227
- item = value[name];
228
- } catch (e) {
229
- continue;
230
- }
231
- if (name === "toJSON" && typeof item === "function")
232
- o.push({ k: name, v: { o: [], id: 0 } });
233
- else
234
- o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });
235
- }
236
- let jsonWrapper;
237
- try {
238
- if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")
239
- jsonWrapper = { value: value.toJSON() };
240
- } catch (e) {
241
- }
242
- if (jsonWrapper)
243
- return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);
244
- return { o, id: id2 };
245
- }
246
- }
247
- // Annotate the CommonJS export names for ESM import in node:
248
- 0 && (module.exports = {
249
- parseEvaluationResultValue,
250
- serializeAsCallArgument
251
- });