osra 0.1.2 → 0.2.0
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/README.md +29 -34
- package/build/index.d.ts +155 -8
- package/build/index.js +432 -259
- package/build/index.js.map +1 -1
- package/package.json +29 -16
- package/build/test.js +0 -3544
- package/build/test.js.map +0 -1
- package/build/types.d.ts +0 -66
- package/build/utils.d.ts +0 -60
package/build/test.js
DELETED
|
@@ -1,3544 +0,0 @@
|
|
|
1
|
-
var Gt = Object.defineProperty, Rn = Object.getOwnPropertyNames, l = (e, t) => Gt(e, "name", { value: t, configurable: !0 }), Vn = (e, t) => function() {
|
|
2
|
-
return t || (0, e[Rn(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
3
|
-
}, Xe = (e, t) => {
|
|
4
|
-
for (var n in t)
|
|
5
|
-
Gt(e, n, { get: t[n], enumerable: !0 });
|
|
6
|
-
}, Un = Vn({
|
|
7
|
-
"(disabled):util"() {
|
|
8
|
-
}
|
|
9
|
-
}), pe = {};
|
|
10
|
-
Xe(pe, {
|
|
11
|
-
addChainableMethod: () => ut,
|
|
12
|
-
addLengthGuard: () => fe,
|
|
13
|
-
addMethod: () => it,
|
|
14
|
-
addProperty: () => st,
|
|
15
|
-
checkError: () => _,
|
|
16
|
-
compareByInspect: () => me,
|
|
17
|
-
eql: () => vn,
|
|
18
|
-
expectTypes: () => Ht,
|
|
19
|
-
flag: () => v,
|
|
20
|
-
getActual: () => Se,
|
|
21
|
-
getMessage: () => et,
|
|
22
|
-
getName: () => je,
|
|
23
|
-
getOperator: () => dt,
|
|
24
|
-
getOwnEnumerableProperties: () => ht,
|
|
25
|
-
getOwnEnumerablePropertySymbols: () => lt,
|
|
26
|
-
getPathInfo: () => ot,
|
|
27
|
-
hasProperty: () => Ee,
|
|
28
|
-
inspect: () => S,
|
|
29
|
-
isNaN: () => we,
|
|
30
|
-
isNumeric: () => C,
|
|
31
|
-
isProxyEnabled: () => ue,
|
|
32
|
-
isRegExp: () => ve,
|
|
33
|
-
objDisplay: () => Z,
|
|
34
|
-
overwriteChainableMethod: () => ft,
|
|
35
|
-
overwriteMethod: () => ct,
|
|
36
|
-
overwriteProperty: () => at,
|
|
37
|
-
proxify: () => oe,
|
|
38
|
-
test: () => Le,
|
|
39
|
-
transferFlags: () => V,
|
|
40
|
-
type: () => O
|
|
41
|
-
});
|
|
42
|
-
var _ = {};
|
|
43
|
-
Xe(_, {
|
|
44
|
-
compatibleConstructor: () => Jt,
|
|
45
|
-
compatibleInstance: () => Yt,
|
|
46
|
-
compatibleMessage: () => Zt,
|
|
47
|
-
getConstructorName: () => Qt,
|
|
48
|
-
getMessage: () => Xt
|
|
49
|
-
});
|
|
50
|
-
function Pe(e) {
|
|
51
|
-
return e instanceof Error || Object.prototype.toString.call(e) === "[object Error]";
|
|
52
|
-
}
|
|
53
|
-
l(Pe, "isErrorInstance");
|
|
54
|
-
function Wt(e) {
|
|
55
|
-
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
56
|
-
}
|
|
57
|
-
l(Wt, "isRegExp");
|
|
58
|
-
function Yt(e, t) {
|
|
59
|
-
return Pe(t) && e === t;
|
|
60
|
-
}
|
|
61
|
-
l(Yt, "compatibleInstance");
|
|
62
|
-
function Jt(e, t) {
|
|
63
|
-
return Pe(t) ? e.constructor === t.constructor || e instanceof t.constructor : (typeof t == "object" || typeof t == "function") && t.prototype ? e.constructor === t || e instanceof t : !1;
|
|
64
|
-
}
|
|
65
|
-
l(Jt, "compatibleConstructor");
|
|
66
|
-
function Zt(e, t) {
|
|
67
|
-
const n = typeof e == "string" ? e : e.message;
|
|
68
|
-
return Wt(t) ? t.test(n) : typeof t == "string" ? n.indexOf(t) !== -1 : !1;
|
|
69
|
-
}
|
|
70
|
-
l(Zt, "compatibleMessage");
|
|
71
|
-
function Qt(e) {
|
|
72
|
-
let t = e;
|
|
73
|
-
return Pe(e) ? t = e.constructor.name : typeof e == "function" && (t = e.name, t === "" && (t = new e().name || t)), t;
|
|
74
|
-
}
|
|
75
|
-
l(Qt, "getConstructorName");
|
|
76
|
-
function Xt(e) {
|
|
77
|
-
let t = "";
|
|
78
|
-
return e && e.message ? t = e.message : typeof e == "string" && (t = e), t;
|
|
79
|
-
}
|
|
80
|
-
l(Xt, "getMessage");
|
|
81
|
-
function v(e, t, n) {
|
|
82
|
-
var r = e.__flags || (e.__flags = /* @__PURE__ */ Object.create(null));
|
|
83
|
-
if (arguments.length === 3)
|
|
84
|
-
r[t] = n;
|
|
85
|
-
else
|
|
86
|
-
return r[t];
|
|
87
|
-
}
|
|
88
|
-
l(v, "flag");
|
|
89
|
-
function Le(e, t) {
|
|
90
|
-
var n = v(e, "negate"), r = t[0];
|
|
91
|
-
return n ? !r : r;
|
|
92
|
-
}
|
|
93
|
-
l(Le, "test");
|
|
94
|
-
function O(e) {
|
|
95
|
-
if (typeof e > "u")
|
|
96
|
-
return "undefined";
|
|
97
|
-
if (e === null)
|
|
98
|
-
return "null";
|
|
99
|
-
const t = e[Symbol.toStringTag];
|
|
100
|
-
return typeof t == "string" ? t : Object.prototype.toString.call(e).slice(8, -1);
|
|
101
|
-
}
|
|
102
|
-
l(O, "type");
|
|
103
|
-
var Kn = "captureStackTrace" in Error, E = class Lt extends Error {
|
|
104
|
-
static {
|
|
105
|
-
l(this, "AssertionError");
|
|
106
|
-
}
|
|
107
|
-
message;
|
|
108
|
-
get name() {
|
|
109
|
-
return "AssertionError";
|
|
110
|
-
}
|
|
111
|
-
get ok() {
|
|
112
|
-
return !1;
|
|
113
|
-
}
|
|
114
|
-
constructor(t = "Unspecified AssertionError", n, r) {
|
|
115
|
-
super(t), this.message = t, Kn && Error.captureStackTrace(this, r || Lt);
|
|
116
|
-
for (const o in n)
|
|
117
|
-
o in this || (this[o] = n[o]);
|
|
118
|
-
}
|
|
119
|
-
toJSON(t) {
|
|
120
|
-
return {
|
|
121
|
-
...this,
|
|
122
|
-
name: this.name,
|
|
123
|
-
message: this.message,
|
|
124
|
-
ok: !1,
|
|
125
|
-
stack: t !== !1 ? this.stack : void 0
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
function Ht(e, t) {
|
|
130
|
-
var n = v(e, "message"), r = v(e, "ssfi");
|
|
131
|
-
n = n ? n + ": " : "", e = v(e, "object"), t = t.map(function(c) {
|
|
132
|
-
return c.toLowerCase();
|
|
133
|
-
}), t.sort();
|
|
134
|
-
var o = t.map(function(c, u) {
|
|
135
|
-
var h = ~["a", "e", "i", "o", "u"].indexOf(c.charAt(0)) ? "an" : "a", p = t.length > 1 && u === t.length - 1 ? "or " : "";
|
|
136
|
-
return p + h + " " + c;
|
|
137
|
-
}).join(", "), a = O(e).toLowerCase();
|
|
138
|
-
if (!t.some(function(c) {
|
|
139
|
-
return a === c;
|
|
140
|
-
}))
|
|
141
|
-
throw new E(
|
|
142
|
-
n + "object tested must be " + o + ", but " + a + " given",
|
|
143
|
-
void 0,
|
|
144
|
-
r
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
l(Ht, "expectTypes");
|
|
148
|
-
function Se(e, t) {
|
|
149
|
-
return t.length > 4 ? t[4] : e._obj;
|
|
150
|
-
}
|
|
151
|
-
l(Se, "getActual");
|
|
152
|
-
var _t = {
|
|
153
|
-
bold: ["1", "22"],
|
|
154
|
-
dim: ["2", "22"],
|
|
155
|
-
italic: ["3", "23"],
|
|
156
|
-
underline: ["4", "24"],
|
|
157
|
-
// 5 & 6 are blinking
|
|
158
|
-
inverse: ["7", "27"],
|
|
159
|
-
hidden: ["8", "28"],
|
|
160
|
-
strike: ["9", "29"],
|
|
161
|
-
// 10-20 are fonts
|
|
162
|
-
// 21-29 are resets for 1-9
|
|
163
|
-
black: ["30", "39"],
|
|
164
|
-
red: ["31", "39"],
|
|
165
|
-
green: ["32", "39"],
|
|
166
|
-
yellow: ["33", "39"],
|
|
167
|
-
blue: ["34", "39"],
|
|
168
|
-
magenta: ["35", "39"],
|
|
169
|
-
cyan: ["36", "39"],
|
|
170
|
-
white: ["37", "39"],
|
|
171
|
-
brightblack: ["30;1", "39"],
|
|
172
|
-
brightred: ["31;1", "39"],
|
|
173
|
-
brightgreen: ["32;1", "39"],
|
|
174
|
-
brightyellow: ["33;1", "39"],
|
|
175
|
-
brightblue: ["34;1", "39"],
|
|
176
|
-
brightmagenta: ["35;1", "39"],
|
|
177
|
-
brightcyan: ["36;1", "39"],
|
|
178
|
-
brightwhite: ["37;1", "39"],
|
|
179
|
-
grey: ["90", "39"]
|
|
180
|
-
}, kn = {
|
|
181
|
-
special: "cyan",
|
|
182
|
-
number: "yellow",
|
|
183
|
-
bigint: "yellow",
|
|
184
|
-
boolean: "yellow",
|
|
185
|
-
undefined: "grey",
|
|
186
|
-
null: "bold",
|
|
187
|
-
string: "green",
|
|
188
|
-
symbol: "green",
|
|
189
|
-
date: "magenta",
|
|
190
|
-
regexp: "red"
|
|
191
|
-
}, te = "…";
|
|
192
|
-
function en(e, t) {
|
|
193
|
-
const n = _t[kn[t]] || _t[t] || "";
|
|
194
|
-
return n ? `\x1B[${n[0]}m${String(e)}\x1B[${n[1]}m` : String(e);
|
|
195
|
-
}
|
|
196
|
-
l(en, "colorise");
|
|
197
|
-
function tn({
|
|
198
|
-
showHidden: e = !1,
|
|
199
|
-
depth: t = 2,
|
|
200
|
-
colors: n = !1,
|
|
201
|
-
customInspect: r = !0,
|
|
202
|
-
showProxy: o = !1,
|
|
203
|
-
maxArrayLength: a = 1 / 0,
|
|
204
|
-
breakLength: c = 1 / 0,
|
|
205
|
-
seen: u = [],
|
|
206
|
-
// eslint-disable-next-line no-shadow
|
|
207
|
-
truncate: h = 1 / 0,
|
|
208
|
-
stylize: p = String
|
|
209
|
-
} = {}, b) {
|
|
210
|
-
const y = {
|
|
211
|
-
showHidden: !!e,
|
|
212
|
-
depth: Number(t),
|
|
213
|
-
colors: !!n,
|
|
214
|
-
customInspect: !!r,
|
|
215
|
-
showProxy: !!o,
|
|
216
|
-
maxArrayLength: Number(a),
|
|
217
|
-
breakLength: Number(c),
|
|
218
|
-
truncate: Number(h),
|
|
219
|
-
seen: u,
|
|
220
|
-
inspect: b,
|
|
221
|
-
stylize: p
|
|
222
|
-
};
|
|
223
|
-
return y.colors && (y.stylize = en), y;
|
|
224
|
-
}
|
|
225
|
-
l(tn, "normaliseOptions");
|
|
226
|
-
function nn(e) {
|
|
227
|
-
return e >= "\uD800" && e <= "\uDBFF";
|
|
228
|
-
}
|
|
229
|
-
l(nn, "isHighSurrogate");
|
|
230
|
-
function G(e, t, n = te) {
|
|
231
|
-
e = String(e);
|
|
232
|
-
const r = n.length, o = e.length;
|
|
233
|
-
if (r > t && o > r)
|
|
234
|
-
return n;
|
|
235
|
-
if (o > t && o > r) {
|
|
236
|
-
let a = t - r;
|
|
237
|
-
return a > 0 && nn(e[a - 1]) && (a = a - 1), `${e.slice(0, a)}${n}`;
|
|
238
|
-
}
|
|
239
|
-
return e;
|
|
240
|
-
}
|
|
241
|
-
l(G, "truncate");
|
|
242
|
-
function z(e, t, n, r = ", ") {
|
|
243
|
-
n = n || t.inspect;
|
|
244
|
-
const o = e.length;
|
|
245
|
-
if (o === 0)
|
|
246
|
-
return "";
|
|
247
|
-
const a = t.truncate;
|
|
248
|
-
let c = "", u = "", h = "";
|
|
249
|
-
for (let p = 0; p < o; p += 1) {
|
|
250
|
-
const b = p + 1 === e.length, y = p + 2 === e.length;
|
|
251
|
-
h = `${te}(${e.length - p})`;
|
|
252
|
-
const x = e[p];
|
|
253
|
-
t.truncate = a - c.length - (b ? 0 : r.length);
|
|
254
|
-
const m = u || n(x, t) + (b ? "" : r), w = c.length + m.length, j = w + h.length;
|
|
255
|
-
if (b && w > a && c.length + h.length <= a || !b && !y && j > a || (u = b ? "" : n(e[p + 1], t) + (y ? "" : r), !b && y && j > a && w + u.length > a))
|
|
256
|
-
break;
|
|
257
|
-
if (c += m, !b && !y && w + u.length >= a) {
|
|
258
|
-
h = `${te}(${e.length - p - 1})`;
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
h = "";
|
|
262
|
-
}
|
|
263
|
-
return `${c}${h}`;
|
|
264
|
-
}
|
|
265
|
-
l(z, "inspectList");
|
|
266
|
-
function rn(e) {
|
|
267
|
-
return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/) ? e : JSON.stringify(e).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
|
|
268
|
-
}
|
|
269
|
-
l(rn, "quoteComplexKey");
|
|
270
|
-
function ne([e, t], n) {
|
|
271
|
-
return n.truncate -= 2, typeof e == "string" ? e = rn(e) : typeof e != "number" && (e = `[${n.inspect(e, n)}]`), n.truncate -= e.length, t = n.inspect(t, n), `${e}: ${t}`;
|
|
272
|
-
}
|
|
273
|
-
l(ne, "inspectProperty");
|
|
274
|
-
function on(e, t) {
|
|
275
|
-
const n = Object.keys(e).slice(e.length);
|
|
276
|
-
if (!e.length && !n.length)
|
|
277
|
-
return "[]";
|
|
278
|
-
t.truncate -= 4;
|
|
279
|
-
const r = z(e, t);
|
|
280
|
-
t.truncate -= r.length;
|
|
281
|
-
let o = "";
|
|
282
|
-
return n.length && (o = z(n.map((a) => [a, e[a]]), t, ne)), `[ ${r}${o ? `, ${o}` : ""} ]`;
|
|
283
|
-
}
|
|
284
|
-
l(on, "inspectArray");
|
|
285
|
-
var Gn = /* @__PURE__ */ l((e) => typeof Buffer == "function" && e instanceof Buffer ? "Buffer" : e[Symbol.toStringTag] ? e[Symbol.toStringTag] : e.constructor.name, "getArrayName");
|
|
286
|
-
function K(e, t) {
|
|
287
|
-
const n = Gn(e);
|
|
288
|
-
t.truncate -= n.length + 4;
|
|
289
|
-
const r = Object.keys(e).slice(e.length);
|
|
290
|
-
if (!e.length && !r.length)
|
|
291
|
-
return `${n}[]`;
|
|
292
|
-
let o = "";
|
|
293
|
-
for (let c = 0; c < e.length; c++) {
|
|
294
|
-
const u = `${t.stylize(G(e[c], t.truncate), "number")}${c === e.length - 1 ? "" : ", "}`;
|
|
295
|
-
if (t.truncate -= u.length, e[c] !== e.length && t.truncate <= 3) {
|
|
296
|
-
o += `${te}(${e.length - e[c] + 1})`;
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
o += u;
|
|
300
|
-
}
|
|
301
|
-
let a = "";
|
|
302
|
-
return r.length && (a = z(r.map((c) => [c, e[c]]), t, ne)), `${n}[ ${o}${a ? `, ${a}` : ""} ]`;
|
|
303
|
-
}
|
|
304
|
-
l(K, "inspectTypedArray");
|
|
305
|
-
function sn(e, t) {
|
|
306
|
-
const n = e.toJSON();
|
|
307
|
-
if (n === null)
|
|
308
|
-
return "Invalid Date";
|
|
309
|
-
const r = n.split("T"), o = r[0];
|
|
310
|
-
return t.stylize(`${o}T${G(r[1], t.truncate - o.length - 1)}`, "date");
|
|
311
|
-
}
|
|
312
|
-
l(sn, "inspectDate");
|
|
313
|
-
function ze(e, t) {
|
|
314
|
-
const n = e[Symbol.toStringTag] || "Function", r = e.name;
|
|
315
|
-
return r ? t.stylize(`[${n} ${G(r, t.truncate - 11)}]`, "special") : t.stylize(`[${n}]`, "special");
|
|
316
|
-
}
|
|
317
|
-
l(ze, "inspectFunction");
|
|
318
|
-
function an([e, t], n) {
|
|
319
|
-
return n.truncate -= 4, e = n.inspect(e, n), n.truncate -= e.length, t = n.inspect(t, n), `${e} => ${t}`;
|
|
320
|
-
}
|
|
321
|
-
l(an, "inspectMapEntry");
|
|
322
|
-
function cn(e) {
|
|
323
|
-
const t = [];
|
|
324
|
-
return e.forEach((n, r) => {
|
|
325
|
-
t.push([r, n]);
|
|
326
|
-
}), t;
|
|
327
|
-
}
|
|
328
|
-
l(cn, "mapToEntries");
|
|
329
|
-
function un(e, t) {
|
|
330
|
-
return e.size - 1 <= 0 ? "Map{}" : (t.truncate -= 7, `Map{ ${z(cn(e), t, an)} }`);
|
|
331
|
-
}
|
|
332
|
-
l(un, "inspectMap");
|
|
333
|
-
var Wn = Number.isNaN || ((e) => e !== e);
|
|
334
|
-
function Be(e, t) {
|
|
335
|
-
return Wn(e) ? t.stylize("NaN", "number") : e === 1 / 0 ? t.stylize("Infinity", "number") : e === -1 / 0 ? t.stylize("-Infinity", "number") : e === 0 ? t.stylize(1 / e === 1 / 0 ? "+0" : "-0", "number") : t.stylize(G(String(e), t.truncate), "number");
|
|
336
|
-
}
|
|
337
|
-
l(Be, "inspectNumber");
|
|
338
|
-
function Fe(e, t) {
|
|
339
|
-
let n = G(e.toString(), t.truncate - 1);
|
|
340
|
-
return n !== te && (n += "n"), t.stylize(n, "bigint");
|
|
341
|
-
}
|
|
342
|
-
l(Fe, "inspectBigInt");
|
|
343
|
-
function fn(e, t) {
|
|
344
|
-
const n = e.toString().split("/")[2], r = t.truncate - (2 + n.length), o = e.source;
|
|
345
|
-
return t.stylize(`/${G(o, r)}/${n}`, "regexp");
|
|
346
|
-
}
|
|
347
|
-
l(fn, "inspectRegExp");
|
|
348
|
-
function ln(e) {
|
|
349
|
-
const t = [];
|
|
350
|
-
return e.forEach((n) => {
|
|
351
|
-
t.push(n);
|
|
352
|
-
}), t;
|
|
353
|
-
}
|
|
354
|
-
l(ln, "arrayFromSet");
|
|
355
|
-
function hn(e, t) {
|
|
356
|
-
return e.size === 0 ? "Set{}" : (t.truncate -= 7, `Set{ ${z(ln(e), t)} }`);
|
|
357
|
-
}
|
|
358
|
-
l(hn, "inspectSet");
|
|
359
|
-
var qt = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"), Yn = {
|
|
360
|
-
"\b": "\\b",
|
|
361
|
-
" ": "\\t",
|
|
362
|
-
"\n": "\\n",
|
|
363
|
-
"\f": "\\f",
|
|
364
|
-
"\r": "\\r",
|
|
365
|
-
"'": "\\'",
|
|
366
|
-
"\\": "\\\\"
|
|
367
|
-
}, Jn = 16, Zn = 4;
|
|
368
|
-
function dn(e) {
|
|
369
|
-
return Yn[e] || `\\u${`0000${e.charCodeAt(0).toString(Jn)}`.slice(-Zn)}`;
|
|
370
|
-
}
|
|
371
|
-
l(dn, "escape");
|
|
372
|
-
function Re(e, t) {
|
|
373
|
-
return qt.test(e) && (e = e.replace(qt, dn)), t.stylize(`'${G(e, t.truncate - 2)}'`, "string");
|
|
374
|
-
}
|
|
375
|
-
l(Re, "inspectString");
|
|
376
|
-
function Ve(e) {
|
|
377
|
-
return "description" in Symbol.prototype ? e.description ? `Symbol(${e.description})` : "Symbol()" : e.toString();
|
|
378
|
-
}
|
|
379
|
-
l(Ve, "inspectSymbol");
|
|
380
|
-
var pn = /* @__PURE__ */ l(() => "Promise{…}", "getPromiseValue");
|
|
381
|
-
try {
|
|
382
|
-
const { getPromiseDetails: e, kPending: t, kRejected: n } = process.binding("util");
|
|
383
|
-
Array.isArray(e(Promise.resolve())) && (pn = /* @__PURE__ */ l((r, o) => {
|
|
384
|
-
const [a, c] = e(r);
|
|
385
|
-
return a === t ? "Promise{<pending>}" : `Promise${a === n ? "!" : ""}{${o.inspect(c, o)}}`;
|
|
386
|
-
}, "getPromiseValue"));
|
|
387
|
-
} catch {
|
|
388
|
-
}
|
|
389
|
-
var Qn = pn;
|
|
390
|
-
function ae(e, t) {
|
|
391
|
-
const n = Object.getOwnPropertyNames(e), r = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e) : [];
|
|
392
|
-
if (n.length === 0 && r.length === 0)
|
|
393
|
-
return "{}";
|
|
394
|
-
if (t.truncate -= 4, t.seen = t.seen || [], t.seen.includes(e))
|
|
395
|
-
return "[Circular]";
|
|
396
|
-
t.seen.push(e);
|
|
397
|
-
const o = z(n.map((u) => [u, e[u]]), t, ne), a = z(r.map((u) => [u, e[u]]), t, ne);
|
|
398
|
-
t.seen.pop();
|
|
399
|
-
let c = "";
|
|
400
|
-
return o && a && (c = ", "), `{ ${o}${c}${a} }`;
|
|
401
|
-
}
|
|
402
|
-
l(ae, "inspectObject");
|
|
403
|
-
var $e = typeof Symbol < "u" && Symbol.toStringTag ? Symbol.toStringTag : !1;
|
|
404
|
-
function gn(e, t) {
|
|
405
|
-
let n = "";
|
|
406
|
-
return $e && $e in e && (n = e[$e]), n = n || e.constructor.name, (!n || n === "_class") && (n = "<Anonymous Class>"), t.truncate -= n.length, `${n}${ae(e, t)}`;
|
|
407
|
-
}
|
|
408
|
-
l(gn, "inspectClass");
|
|
409
|
-
function bn(e, t) {
|
|
410
|
-
return e.length === 0 ? "Arguments[]" : (t.truncate -= 13, `Arguments[ ${z(e, t)} ]`);
|
|
411
|
-
}
|
|
412
|
-
l(bn, "inspectArguments");
|
|
413
|
-
var Xn = [
|
|
414
|
-
"stack",
|
|
415
|
-
"line",
|
|
416
|
-
"column",
|
|
417
|
-
"name",
|
|
418
|
-
"message",
|
|
419
|
-
"fileName",
|
|
420
|
-
"lineNumber",
|
|
421
|
-
"columnNumber",
|
|
422
|
-
"number",
|
|
423
|
-
"description",
|
|
424
|
-
"cause"
|
|
425
|
-
];
|
|
426
|
-
function yn(e, t) {
|
|
427
|
-
const n = Object.getOwnPropertyNames(e).filter((c) => Xn.indexOf(c) === -1), r = e.name;
|
|
428
|
-
t.truncate -= r.length;
|
|
429
|
-
let o = "";
|
|
430
|
-
if (typeof e.message == "string" ? o = G(e.message, t.truncate) : n.unshift("message"), o = o ? `: ${o}` : "", t.truncate -= o.length + 5, t.seen = t.seen || [], t.seen.includes(e))
|
|
431
|
-
return "[Circular]";
|
|
432
|
-
t.seen.push(e);
|
|
433
|
-
const a = z(n.map((c) => [c, e[c]]), t, ne);
|
|
434
|
-
return `${r}${o}${a ? ` { ${a} }` : ""}`;
|
|
435
|
-
}
|
|
436
|
-
l(yn, "inspectObject");
|
|
437
|
-
function mn([e, t], n) {
|
|
438
|
-
return n.truncate -= 3, t ? `${n.stylize(String(e), "yellow")}=${n.stylize(`"${t}"`, "string")}` : `${n.stylize(String(e), "yellow")}`;
|
|
439
|
-
}
|
|
440
|
-
l(mn, "inspectAttribute");
|
|
441
|
-
function ge(e, t) {
|
|
442
|
-
return z(e, t, He, `
|
|
443
|
-
`);
|
|
444
|
-
}
|
|
445
|
-
l(ge, "inspectHTMLCollection");
|
|
446
|
-
function He(e, t) {
|
|
447
|
-
const n = e.getAttributeNames(), r = e.tagName.toLowerCase(), o = t.stylize(`<${r}`, "special"), a = t.stylize(">", "special"), c = t.stylize(`</${r}>`, "special");
|
|
448
|
-
t.truncate -= r.length * 2 + 5;
|
|
449
|
-
let u = "";
|
|
450
|
-
n.length > 0 && (u += " ", u += z(n.map((b) => [b, e.getAttribute(b)]), t, mn, " ")), t.truncate -= u.length;
|
|
451
|
-
const h = t.truncate;
|
|
452
|
-
let p = ge(e.children, t);
|
|
453
|
-
return p && p.length > h && (p = `${te}(${e.children.length})`), `${o}${u}${a}${p}${c}`;
|
|
454
|
-
}
|
|
455
|
-
l(He, "inspectHTML");
|
|
456
|
-
var Ln = typeof Symbol == "function" && typeof Symbol.for == "function", _e = Ln ? Symbol.for("chai/inspect") : "@@chai/inspect", ee = !1;
|
|
457
|
-
try {
|
|
458
|
-
const e = Un();
|
|
459
|
-
ee = e.inspect ? e.inspect.custom : !1;
|
|
460
|
-
} catch {
|
|
461
|
-
ee = !1;
|
|
462
|
-
}
|
|
463
|
-
var zt = /* @__PURE__ */ new WeakMap(), Bt = {}, Ft = {
|
|
464
|
-
undefined: (e, t) => t.stylize("undefined", "undefined"),
|
|
465
|
-
null: (e, t) => t.stylize("null", "null"),
|
|
466
|
-
boolean: (e, t) => t.stylize(String(e), "boolean"),
|
|
467
|
-
Boolean: (e, t) => t.stylize(String(e), "boolean"),
|
|
468
|
-
number: Be,
|
|
469
|
-
Number: Be,
|
|
470
|
-
bigint: Fe,
|
|
471
|
-
BigInt: Fe,
|
|
472
|
-
string: Re,
|
|
473
|
-
String: Re,
|
|
474
|
-
function: ze,
|
|
475
|
-
Function: ze,
|
|
476
|
-
symbol: Ve,
|
|
477
|
-
// A Symbol polyfill will return `Symbol` not `symbol` from typedetect
|
|
478
|
-
Symbol: Ve,
|
|
479
|
-
Array: on,
|
|
480
|
-
Date: sn,
|
|
481
|
-
Map: un,
|
|
482
|
-
Set: hn,
|
|
483
|
-
RegExp: fn,
|
|
484
|
-
Promise: Qn,
|
|
485
|
-
// WeakSet, WeakMap are totally opaque to us
|
|
486
|
-
WeakSet: (e, t) => t.stylize("WeakSet{…}", "special"),
|
|
487
|
-
WeakMap: (e, t) => t.stylize("WeakMap{…}", "special"),
|
|
488
|
-
Arguments: bn,
|
|
489
|
-
Int8Array: K,
|
|
490
|
-
Uint8Array: K,
|
|
491
|
-
Uint8ClampedArray: K,
|
|
492
|
-
Int16Array: K,
|
|
493
|
-
Uint16Array: K,
|
|
494
|
-
Int32Array: K,
|
|
495
|
-
Uint32Array: K,
|
|
496
|
-
Float32Array: K,
|
|
497
|
-
Float64Array: K,
|
|
498
|
-
Generator: () => "",
|
|
499
|
-
DataView: () => "",
|
|
500
|
-
ArrayBuffer: () => "",
|
|
501
|
-
Error: yn,
|
|
502
|
-
HTMLCollection: ge,
|
|
503
|
-
NodeList: ge
|
|
504
|
-
}, Hn = /* @__PURE__ */ l((e, t, n) => _e in e && typeof e[_e] == "function" ? e[_e](t) : ee && ee in e && typeof e[ee] == "function" ? e[ee](t.depth, t) : "inspect" in e && typeof e.inspect == "function" ? e.inspect(t.depth, t) : "constructor" in e && zt.has(e.constructor) ? zt.get(e.constructor)(e, t) : Bt[n] ? Bt[n](e, t) : "", "inspectCustom"), er = Object.prototype.toString;
|
|
505
|
-
function be(e, t = {}) {
|
|
506
|
-
const n = tn(t, be), { customInspect: r } = n;
|
|
507
|
-
let o = e === null ? "null" : typeof e;
|
|
508
|
-
if (o === "object" && (o = er.call(e).slice(8, -1)), o in Ft)
|
|
509
|
-
return Ft[o](e, n);
|
|
510
|
-
if (r && e) {
|
|
511
|
-
const c = Hn(e, n, o);
|
|
512
|
-
if (c)
|
|
513
|
-
return typeof c == "string" ? c : be(c, n);
|
|
514
|
-
}
|
|
515
|
-
const a = e ? Object.getPrototypeOf(e) : !1;
|
|
516
|
-
return a === Object.prototype || a === null ? ae(e, n) : e && typeof HTMLElement == "function" && e instanceof HTMLElement ? He(e, n) : "constructor" in e ? e.constructor !== Object ? gn(e, n) : ae(e, n) : e === Object(e) ? ae(e, n) : n.stylize(String(e), o);
|
|
517
|
-
}
|
|
518
|
-
l(be, "inspect");
|
|
519
|
-
var $ = {
|
|
520
|
-
/**
|
|
521
|
-
* ### config.includeStack
|
|
522
|
-
*
|
|
523
|
-
* User configurable property, influences whether stack trace
|
|
524
|
-
* is included in Assertion error message. Default of false
|
|
525
|
-
* suppresses stack trace in the error message.
|
|
526
|
-
*
|
|
527
|
-
* chai.config.includeStack = true; // enable stack on error
|
|
528
|
-
*
|
|
529
|
-
* @param {boolean}
|
|
530
|
-
* @public
|
|
531
|
-
*/
|
|
532
|
-
includeStack: !1,
|
|
533
|
-
/**
|
|
534
|
-
* ### config.showDiff
|
|
535
|
-
*
|
|
536
|
-
* User configurable property, influences whether or not
|
|
537
|
-
* the `showDiff` flag should be included in the thrown
|
|
538
|
-
* AssertionErrors. `false` will always be `false`; `true`
|
|
539
|
-
* will be true when the assertion has requested a diff
|
|
540
|
-
* be shown.
|
|
541
|
-
*
|
|
542
|
-
* @param {boolean}
|
|
543
|
-
* @public
|
|
544
|
-
*/
|
|
545
|
-
showDiff: !0,
|
|
546
|
-
/**
|
|
547
|
-
* ### config.truncateThreshold
|
|
548
|
-
*
|
|
549
|
-
* User configurable property, sets length threshold for actual and
|
|
550
|
-
* expected values in assertion errors. If this threshold is exceeded, for
|
|
551
|
-
* example for large data structures, the value is replaced with something
|
|
552
|
-
* like `[ Array(3) ]` or `{ Object (prop1, prop2) }`.
|
|
553
|
-
*
|
|
554
|
-
* Set it to zero if you want to disable truncating altogether.
|
|
555
|
-
*
|
|
556
|
-
* This is especially userful when doing assertions on arrays: having this
|
|
557
|
-
* set to a reasonable large value makes the failure messages readily
|
|
558
|
-
* inspectable.
|
|
559
|
-
*
|
|
560
|
-
* chai.config.truncateThreshold = 0; // disable truncating
|
|
561
|
-
*
|
|
562
|
-
* @param {number}
|
|
563
|
-
* @public
|
|
564
|
-
*/
|
|
565
|
-
truncateThreshold: 40,
|
|
566
|
-
/**
|
|
567
|
-
* ### config.useProxy
|
|
568
|
-
*
|
|
569
|
-
* User configurable property, defines if chai will use a Proxy to throw
|
|
570
|
-
* an error when a non-existent property is read, which protects users
|
|
571
|
-
* from typos when using property-based assertions.
|
|
572
|
-
*
|
|
573
|
-
* Set it to false if you want to disable this feature.
|
|
574
|
-
*
|
|
575
|
-
* chai.config.useProxy = false; // disable use of Proxy
|
|
576
|
-
*
|
|
577
|
-
* This feature is automatically disabled regardless of this config value
|
|
578
|
-
* in environments that don't support proxies.
|
|
579
|
-
*
|
|
580
|
-
* @param {boolean}
|
|
581
|
-
* @public
|
|
582
|
-
*/
|
|
583
|
-
useProxy: !0,
|
|
584
|
-
/**
|
|
585
|
-
* ### config.proxyExcludedKeys
|
|
586
|
-
*
|
|
587
|
-
* User configurable property, defines which properties should be ignored
|
|
588
|
-
* instead of throwing an error if they do not exist on the assertion.
|
|
589
|
-
* This is only applied if the environment Chai is running in supports proxies and
|
|
590
|
-
* if the `useProxy` configuration setting is enabled.
|
|
591
|
-
* By default, `then` and `inspect` will not throw an error if they do not exist on the
|
|
592
|
-
* assertion object because the `.inspect` property is read by `util.inspect` (for example, when
|
|
593
|
-
* using `console.log` on the assertion object) and `.then` is necessary for promise type-checking.
|
|
594
|
-
*
|
|
595
|
-
* // By default these keys will not throw an error if they do not exist on the assertion object
|
|
596
|
-
* chai.config.proxyExcludedKeys = ['then', 'inspect'];
|
|
597
|
-
*
|
|
598
|
-
* @param {Array}
|
|
599
|
-
* @public
|
|
600
|
-
*/
|
|
601
|
-
proxyExcludedKeys: ["then", "catch", "inspect", "toJSON"],
|
|
602
|
-
/**
|
|
603
|
-
* ### config.deepEqual
|
|
604
|
-
*
|
|
605
|
-
* User configurable property, defines which a custom function to use for deepEqual
|
|
606
|
-
* comparisons.
|
|
607
|
-
* By default, the function used is the one from the `deep-eql` package without custom comparator.
|
|
608
|
-
*
|
|
609
|
-
* // use a custom comparator
|
|
610
|
-
* chai.config.deepEqual = (expected, actual) => {
|
|
611
|
-
* return chai.util.eql(expected, actual, {
|
|
612
|
-
* comparator: (expected, actual) => {
|
|
613
|
-
* // for non number comparison, use the default behavior
|
|
614
|
-
* if(typeof expected !== 'number') return null;
|
|
615
|
-
* // allow a difference of 10 between compared numbers
|
|
616
|
-
* return typeof actual === 'number' && Math.abs(actual - expected) < 10
|
|
617
|
-
* }
|
|
618
|
-
* })
|
|
619
|
-
* };
|
|
620
|
-
*
|
|
621
|
-
* @param {Function}
|
|
622
|
-
* @public
|
|
623
|
-
*/
|
|
624
|
-
deepEqual: null
|
|
625
|
-
};
|
|
626
|
-
function S(e, t, n, r) {
|
|
627
|
-
var o = {
|
|
628
|
-
colors: r,
|
|
629
|
-
depth: typeof n > "u" ? 2 : n,
|
|
630
|
-
showHidden: t,
|
|
631
|
-
truncate: $.truncateThreshold ? $.truncateThreshold : 1 / 0
|
|
632
|
-
};
|
|
633
|
-
return be(e, o);
|
|
634
|
-
}
|
|
635
|
-
l(S, "inspect");
|
|
636
|
-
function Z(e) {
|
|
637
|
-
var t = S(e), n = Object.prototype.toString.call(e);
|
|
638
|
-
if ($.truncateThreshold && t.length >= $.truncateThreshold) {
|
|
639
|
-
if (n === "[object Function]")
|
|
640
|
-
return !e.name || e.name === "" ? "[Function]" : "[Function: " + e.name + "]";
|
|
641
|
-
if (n === "[object Array]")
|
|
642
|
-
return "[ Array(" + e.length + ") ]";
|
|
643
|
-
if (n === "[object Object]") {
|
|
644
|
-
var r = Object.keys(e), o = r.length > 2 ? r.splice(0, 2).join(", ") + ", ..." : r.join(", ");
|
|
645
|
-
return "{ Object (" + o + ") }";
|
|
646
|
-
} else
|
|
647
|
-
return t;
|
|
648
|
-
} else
|
|
649
|
-
return t;
|
|
650
|
-
}
|
|
651
|
-
l(Z, "objDisplay");
|
|
652
|
-
function et(e, t) {
|
|
653
|
-
var n = v(e, "negate"), r = v(e, "object"), o = t[3], a = Se(e, t), c = n ? t[2] : t[1], u = v(e, "message");
|
|
654
|
-
return typeof c == "function" && (c = c()), c = c || "", c = c.replace(/#\{this\}/g, function() {
|
|
655
|
-
return Z(r);
|
|
656
|
-
}).replace(/#\{act\}/g, function() {
|
|
657
|
-
return Z(a);
|
|
658
|
-
}).replace(/#\{exp\}/g, function() {
|
|
659
|
-
return Z(o);
|
|
660
|
-
}), u ? u + ": " + c : c;
|
|
661
|
-
}
|
|
662
|
-
l(et, "getMessage");
|
|
663
|
-
function V(e, t, n) {
|
|
664
|
-
var r = e.__flags || (e.__flags = /* @__PURE__ */ Object.create(null));
|
|
665
|
-
t.__flags || (t.__flags = /* @__PURE__ */ Object.create(null)), n = arguments.length === 3 ? n : !0;
|
|
666
|
-
for (var o in r)
|
|
667
|
-
(n || o !== "object" && o !== "ssfi" && o !== "lockSsfi" && o != "message") && (t.__flags[o] = r[o]);
|
|
668
|
-
}
|
|
669
|
-
l(V, "transferFlags");
|
|
670
|
-
function Ue(e) {
|
|
671
|
-
if (typeof e > "u")
|
|
672
|
-
return "undefined";
|
|
673
|
-
if (e === null)
|
|
674
|
-
return "null";
|
|
675
|
-
const t = e[Symbol.toStringTag];
|
|
676
|
-
return typeof t == "string" ? t : Object.prototype.toString.call(e).slice(8, -1);
|
|
677
|
-
}
|
|
678
|
-
l(Ue, "type");
|
|
679
|
-
function tt() {
|
|
680
|
-
this._key = "chai/deep-eql__" + Math.random() + Date.now();
|
|
681
|
-
}
|
|
682
|
-
l(tt, "FakeMap");
|
|
683
|
-
tt.prototype = {
|
|
684
|
-
get: /* @__PURE__ */ l(function(t) {
|
|
685
|
-
return t[this._key];
|
|
686
|
-
}, "get"),
|
|
687
|
-
set: /* @__PURE__ */ l(function(t, n) {
|
|
688
|
-
Object.isExtensible(t) && Object.defineProperty(t, this._key, {
|
|
689
|
-
value: n,
|
|
690
|
-
configurable: !0
|
|
691
|
-
});
|
|
692
|
-
}, "set")
|
|
693
|
-
};
|
|
694
|
-
var wn = typeof WeakMap == "function" ? WeakMap : tt;
|
|
695
|
-
function Ke(e, t, n) {
|
|
696
|
-
if (!n || Q(e) || Q(t))
|
|
697
|
-
return null;
|
|
698
|
-
var r = n.get(e);
|
|
699
|
-
if (r) {
|
|
700
|
-
var o = r.get(t);
|
|
701
|
-
if (typeof o == "boolean")
|
|
702
|
-
return o;
|
|
703
|
-
}
|
|
704
|
-
return null;
|
|
705
|
-
}
|
|
706
|
-
l(Ke, "memoizeCompare");
|
|
707
|
-
function ie(e, t, n, r) {
|
|
708
|
-
if (!(!n || Q(e) || Q(t))) {
|
|
709
|
-
var o = n.get(e);
|
|
710
|
-
o ? o.set(t, r) : (o = new wn(), o.set(t, r), n.set(e, o));
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
l(ie, "memoizeSet");
|
|
714
|
-
var vn = ce;
|
|
715
|
-
function ce(e, t, n) {
|
|
716
|
-
if (n && n.comparator)
|
|
717
|
-
return ke(e, t, n);
|
|
718
|
-
var r = nt(e, t);
|
|
719
|
-
return r !== null ? r : ke(e, t, n);
|
|
720
|
-
}
|
|
721
|
-
l(ce, "deepEqual");
|
|
722
|
-
function nt(e, t) {
|
|
723
|
-
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && // eslint-disable-line no-self-compare
|
|
724
|
-
t !== t ? !0 : Q(e) || Q(t) ? !1 : null;
|
|
725
|
-
}
|
|
726
|
-
l(nt, "simpleEqual");
|
|
727
|
-
function ke(e, t, n) {
|
|
728
|
-
n = n || {}, n.memoize = n.memoize === !1 ? !1 : n.memoize || new wn();
|
|
729
|
-
var r = n && n.comparator, o = Ke(e, t, n.memoize);
|
|
730
|
-
if (o !== null)
|
|
731
|
-
return o;
|
|
732
|
-
var a = Ke(t, e, n.memoize);
|
|
733
|
-
if (a !== null)
|
|
734
|
-
return a;
|
|
735
|
-
if (r) {
|
|
736
|
-
var c = r(e, t);
|
|
737
|
-
if (c === !1 || c === !0)
|
|
738
|
-
return ie(e, t, n.memoize, c), c;
|
|
739
|
-
var u = nt(e, t);
|
|
740
|
-
if (u !== null)
|
|
741
|
-
return u;
|
|
742
|
-
}
|
|
743
|
-
var h = Ue(e);
|
|
744
|
-
if (h !== Ue(t))
|
|
745
|
-
return ie(e, t, n.memoize, !1), !1;
|
|
746
|
-
ie(e, t, n.memoize, !0);
|
|
747
|
-
var p = xn(e, t, h, n);
|
|
748
|
-
return ie(e, t, n.memoize, p), p;
|
|
749
|
-
}
|
|
750
|
-
l(ke, "extensiveDeepEqual");
|
|
751
|
-
function xn(e, t, n, r) {
|
|
752
|
-
switch (n) {
|
|
753
|
-
case "String":
|
|
754
|
-
case "Number":
|
|
755
|
-
case "Boolean":
|
|
756
|
-
case "Date":
|
|
757
|
-
return ce(e.valueOf(), t.valueOf());
|
|
758
|
-
case "Promise":
|
|
759
|
-
case "Symbol":
|
|
760
|
-
case "function":
|
|
761
|
-
case "WeakMap":
|
|
762
|
-
case "WeakSet":
|
|
763
|
-
return e === t;
|
|
764
|
-
case "Error":
|
|
765
|
-
return rt(e, t, ["name", "message", "code"], r);
|
|
766
|
-
case "Arguments":
|
|
767
|
-
case "Int8Array":
|
|
768
|
-
case "Uint8Array":
|
|
769
|
-
case "Uint8ClampedArray":
|
|
770
|
-
case "Int16Array":
|
|
771
|
-
case "Uint16Array":
|
|
772
|
-
case "Int32Array":
|
|
773
|
-
case "Uint32Array":
|
|
774
|
-
case "Float32Array":
|
|
775
|
-
case "Float64Array":
|
|
776
|
-
case "Array":
|
|
777
|
-
return W(e, t, r);
|
|
778
|
-
case "RegExp":
|
|
779
|
-
return Pn(e, t);
|
|
780
|
-
case "Generator":
|
|
781
|
-
return Sn(e, t, r);
|
|
782
|
-
case "DataView":
|
|
783
|
-
return W(new Uint8Array(e.buffer), new Uint8Array(t.buffer), r);
|
|
784
|
-
case "ArrayBuffer":
|
|
785
|
-
return W(new Uint8Array(e), new Uint8Array(t), r);
|
|
786
|
-
case "Set":
|
|
787
|
-
return Ge(e, t, r);
|
|
788
|
-
case "Map":
|
|
789
|
-
return Ge(e, t, r);
|
|
790
|
-
case "Temporal.PlainDate":
|
|
791
|
-
case "Temporal.PlainTime":
|
|
792
|
-
case "Temporal.PlainDateTime":
|
|
793
|
-
case "Temporal.Instant":
|
|
794
|
-
case "Temporal.ZonedDateTime":
|
|
795
|
-
case "Temporal.PlainYearMonth":
|
|
796
|
-
case "Temporal.PlainMonthDay":
|
|
797
|
-
return e.equals(t);
|
|
798
|
-
case "Temporal.Duration":
|
|
799
|
-
return e.total("nanoseconds") === t.total("nanoseconds");
|
|
800
|
-
case "Temporal.TimeZone":
|
|
801
|
-
case "Temporal.Calendar":
|
|
802
|
-
return e.toString() === t.toString();
|
|
803
|
-
default:
|
|
804
|
-
return jn(e, t, r);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
l(xn, "extensiveDeepEqualByType");
|
|
808
|
-
function Pn(e, t) {
|
|
809
|
-
return e.toString() === t.toString();
|
|
810
|
-
}
|
|
811
|
-
l(Pn, "regexpEqual");
|
|
812
|
-
function Ge(e, t, n) {
|
|
813
|
-
try {
|
|
814
|
-
if (e.size !== t.size)
|
|
815
|
-
return !1;
|
|
816
|
-
if (e.size === 0)
|
|
817
|
-
return !0;
|
|
818
|
-
} catch {
|
|
819
|
-
return !1;
|
|
820
|
-
}
|
|
821
|
-
var r = [], o = [];
|
|
822
|
-
return e.forEach(/* @__PURE__ */ l(function(c, u) {
|
|
823
|
-
r.push([c, u]);
|
|
824
|
-
}, "gatherEntries")), t.forEach(/* @__PURE__ */ l(function(c, u) {
|
|
825
|
-
o.push([c, u]);
|
|
826
|
-
}, "gatherEntries")), W(r.sort(), o.sort(), n);
|
|
827
|
-
}
|
|
828
|
-
l(Ge, "entriesEqual");
|
|
829
|
-
function W(e, t, n) {
|
|
830
|
-
var r = e.length;
|
|
831
|
-
if (r !== t.length)
|
|
832
|
-
return !1;
|
|
833
|
-
if (r === 0)
|
|
834
|
-
return !0;
|
|
835
|
-
for (var o = -1; ++o < r; )
|
|
836
|
-
if (ce(e[o], t[o], n) === !1)
|
|
837
|
-
return !1;
|
|
838
|
-
return !0;
|
|
839
|
-
}
|
|
840
|
-
l(W, "iterableEqual");
|
|
841
|
-
function Sn(e, t, n) {
|
|
842
|
-
return W(ye(e), ye(t), n);
|
|
843
|
-
}
|
|
844
|
-
l(Sn, "generatorEqual");
|
|
845
|
-
function En(e) {
|
|
846
|
-
return typeof Symbol < "u" && typeof e == "object" && typeof Symbol.iterator < "u" && typeof e[Symbol.iterator] == "function";
|
|
847
|
-
}
|
|
848
|
-
l(En, "hasIteratorFunction");
|
|
849
|
-
function We(e) {
|
|
850
|
-
if (En(e))
|
|
851
|
-
try {
|
|
852
|
-
return ye(e[Symbol.iterator]());
|
|
853
|
-
} catch {
|
|
854
|
-
return [];
|
|
855
|
-
}
|
|
856
|
-
return [];
|
|
857
|
-
}
|
|
858
|
-
l(We, "getIteratorEntries");
|
|
859
|
-
function ye(e) {
|
|
860
|
-
for (var t = e.next(), n = [t.value]; t.done === !1; )
|
|
861
|
-
t = e.next(), n.push(t.value);
|
|
862
|
-
return n;
|
|
863
|
-
}
|
|
864
|
-
l(ye, "getGeneratorEntries");
|
|
865
|
-
function Ye(e) {
|
|
866
|
-
var t = [];
|
|
867
|
-
for (var n in e)
|
|
868
|
-
t.push(n);
|
|
869
|
-
return t;
|
|
870
|
-
}
|
|
871
|
-
l(Ye, "getEnumerableKeys");
|
|
872
|
-
function Je(e) {
|
|
873
|
-
for (var t = [], n = Object.getOwnPropertySymbols(e), r = 0; r < n.length; r += 1) {
|
|
874
|
-
var o = n[r];
|
|
875
|
-
Object.getOwnPropertyDescriptor(e, o).enumerable && t.push(o);
|
|
876
|
-
}
|
|
877
|
-
return t;
|
|
878
|
-
}
|
|
879
|
-
l(Je, "getEnumerableSymbols");
|
|
880
|
-
function rt(e, t, n, r) {
|
|
881
|
-
var o = n.length;
|
|
882
|
-
if (o === 0)
|
|
883
|
-
return !0;
|
|
884
|
-
for (var a = 0; a < o; a += 1)
|
|
885
|
-
if (ce(e[n[a]], t[n[a]], r) === !1)
|
|
886
|
-
return !1;
|
|
887
|
-
return !0;
|
|
888
|
-
}
|
|
889
|
-
l(rt, "keysEqual");
|
|
890
|
-
function jn(e, t, n) {
|
|
891
|
-
var r = Ye(e), o = Ye(t), a = Je(e), c = Je(t);
|
|
892
|
-
if (r = r.concat(a), o = o.concat(c), r.length && r.length === o.length)
|
|
893
|
-
return W(Ze(r).sort(), Ze(o).sort()) === !1 ? !1 : rt(e, t, r, n);
|
|
894
|
-
var u = We(e), h = We(t);
|
|
895
|
-
return u.length && u.length === h.length ? (u.sort(), h.sort(), W(u, h, n)) : r.length === 0 && u.length === 0 && o.length === 0 && h.length === 0;
|
|
896
|
-
}
|
|
897
|
-
l(jn, "objectEqual");
|
|
898
|
-
function Q(e) {
|
|
899
|
-
return e === null || typeof e != "object";
|
|
900
|
-
}
|
|
901
|
-
l(Q, "isPrimitive");
|
|
902
|
-
function Ze(e) {
|
|
903
|
-
return e.map(/* @__PURE__ */ l(function(n) {
|
|
904
|
-
return typeof n == "symbol" ? n.toString() : n;
|
|
905
|
-
}, "mapSymbol"));
|
|
906
|
-
}
|
|
907
|
-
l(Ze, "mapSymbols");
|
|
908
|
-
function Ee(e, t) {
|
|
909
|
-
return typeof e > "u" || e === null ? !1 : t in Object(e);
|
|
910
|
-
}
|
|
911
|
-
l(Ee, "hasProperty");
|
|
912
|
-
function Mn(e) {
|
|
913
|
-
return e.replace(/([^\\])\[/g, "$1.[").match(/(\\\.|[^.]+?)+/g).map((r) => {
|
|
914
|
-
if (r === "constructor" || r === "__proto__" || r === "prototype")
|
|
915
|
-
return {};
|
|
916
|
-
const a = /^\[(\d+)\]$/.exec(r);
|
|
917
|
-
let c = null;
|
|
918
|
-
return a ? c = { i: parseFloat(a[1]) } : c = { p: r.replace(/\\([.[\]])/g, "$1") }, c;
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
l(Mn, "parsePath");
|
|
922
|
-
function Qe(e, t, n) {
|
|
923
|
-
let r = e, o = null;
|
|
924
|
-
n = typeof n > "u" ? t.length : n;
|
|
925
|
-
for (let a = 0; a < n; a++) {
|
|
926
|
-
const c = t[a];
|
|
927
|
-
r && (typeof c.p > "u" ? r = r[c.i] : r = r[c.p], a === n - 1 && (o = r));
|
|
928
|
-
}
|
|
929
|
-
return o;
|
|
930
|
-
}
|
|
931
|
-
l(Qe, "internalGetPathValue");
|
|
932
|
-
function ot(e, t) {
|
|
933
|
-
const n = Mn(t), r = n[n.length - 1], o = {
|
|
934
|
-
parent: n.length > 1 ? Qe(e, n, n.length - 1) : e,
|
|
935
|
-
name: r.p || r.i,
|
|
936
|
-
value: Qe(e, n)
|
|
937
|
-
};
|
|
938
|
-
return o.exists = Ee(o.parent, o.name), o;
|
|
939
|
-
}
|
|
940
|
-
l(ot, "getPathInfo");
|
|
941
|
-
function i(e, t, n, r) {
|
|
942
|
-
return v(this, "ssfi", n || i), v(this, "lockSsfi", r), v(this, "object", e), v(this, "message", t), v(this, "eql", $.deepEqual || vn), oe(this);
|
|
943
|
-
}
|
|
944
|
-
l(i, "Assertion");
|
|
945
|
-
Object.defineProperty(i, "includeStack", {
|
|
946
|
-
get: function() {
|
|
947
|
-
return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."), $.includeStack;
|
|
948
|
-
},
|
|
949
|
-
set: function(e) {
|
|
950
|
-
console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."), $.includeStack = e;
|
|
951
|
-
}
|
|
952
|
-
});
|
|
953
|
-
Object.defineProperty(i, "showDiff", {
|
|
954
|
-
get: function() {
|
|
955
|
-
return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."), $.showDiff;
|
|
956
|
-
},
|
|
957
|
-
set: function(e) {
|
|
958
|
-
console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."), $.showDiff = e;
|
|
959
|
-
}
|
|
960
|
-
});
|
|
961
|
-
i.addProperty = function(e, t) {
|
|
962
|
-
st(this.prototype, e, t);
|
|
963
|
-
};
|
|
964
|
-
i.addMethod = function(e, t) {
|
|
965
|
-
it(this.prototype, e, t);
|
|
966
|
-
};
|
|
967
|
-
i.addChainableMethod = function(e, t, n) {
|
|
968
|
-
ut(this.prototype, e, t, n);
|
|
969
|
-
};
|
|
970
|
-
i.overwriteProperty = function(e, t) {
|
|
971
|
-
at(this.prototype, e, t);
|
|
972
|
-
};
|
|
973
|
-
i.overwriteMethod = function(e, t) {
|
|
974
|
-
ct(this.prototype, e, t);
|
|
975
|
-
};
|
|
976
|
-
i.overwriteChainableMethod = function(e, t, n) {
|
|
977
|
-
ft(this.prototype, e, t, n);
|
|
978
|
-
};
|
|
979
|
-
i.prototype.assert = function(e, t, n, r, o, a) {
|
|
980
|
-
var c = Le(this, arguments);
|
|
981
|
-
if (a !== !1 && (a = !0), r === void 0 && o === void 0 && (a = !1), $.showDiff !== !0 && (a = !1), !c) {
|
|
982
|
-
t = et(this, arguments);
|
|
983
|
-
var u = Se(this, arguments), h = {
|
|
984
|
-
actual: u,
|
|
985
|
-
expected: r,
|
|
986
|
-
showDiff: a
|
|
987
|
-
}, p = dt(this, arguments);
|
|
988
|
-
throw p && (h.operator = p), new E(
|
|
989
|
-
t,
|
|
990
|
-
h,
|
|
991
|
-
$.includeStack ? this.assert : v(this, "ssfi")
|
|
992
|
-
);
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
Object.defineProperty(
|
|
996
|
-
i.prototype,
|
|
997
|
-
"_obj",
|
|
998
|
-
{
|
|
999
|
-
get: function() {
|
|
1000
|
-
return v(this, "object");
|
|
1001
|
-
},
|
|
1002
|
-
set: function(e) {
|
|
1003
|
-
v(this, "object", e);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
);
|
|
1007
|
-
function ue() {
|
|
1008
|
-
return $.useProxy && typeof Proxy < "u" && typeof Reflect < "u";
|
|
1009
|
-
}
|
|
1010
|
-
l(ue, "isProxyEnabled");
|
|
1011
|
-
function st(e, t, n) {
|
|
1012
|
-
n = n === void 0 ? function() {
|
|
1013
|
-
} : n, Object.defineProperty(
|
|
1014
|
-
e,
|
|
1015
|
-
t,
|
|
1016
|
-
{
|
|
1017
|
-
get: /* @__PURE__ */ l(function r() {
|
|
1018
|
-
!ue() && !v(this, "lockSsfi") && v(this, "ssfi", r);
|
|
1019
|
-
var o = n.call(this);
|
|
1020
|
-
if (o !== void 0)
|
|
1021
|
-
return o;
|
|
1022
|
-
var a = new i();
|
|
1023
|
-
return V(this, a), a;
|
|
1024
|
-
}, "propertyGetter"),
|
|
1025
|
-
configurable: !0
|
|
1026
|
-
}
|
|
1027
|
-
);
|
|
1028
|
-
}
|
|
1029
|
-
l(st, "addProperty");
|
|
1030
|
-
var tr = Object.getOwnPropertyDescriptor(function() {
|
|
1031
|
-
}, "length");
|
|
1032
|
-
function fe(e, t, n) {
|
|
1033
|
-
return tr.configurable && Object.defineProperty(e, "length", {
|
|
1034
|
-
get: function() {
|
|
1035
|
-
throw Error(n ? "Invalid Chai property: " + t + '.length. Due to a compatibility issue, "length" cannot directly follow "' + t + '". Use "' + t + '.lengthOf" instead.' : "Invalid Chai property: " + t + '.length. See docs for proper usage of "' + t + '".');
|
|
1036
|
-
}
|
|
1037
|
-
}), e;
|
|
1038
|
-
}
|
|
1039
|
-
l(fe, "addLengthGuard");
|
|
1040
|
-
function On(e) {
|
|
1041
|
-
var t = Object.getOwnPropertyNames(e);
|
|
1042
|
-
function n(o) {
|
|
1043
|
-
t.indexOf(o) === -1 && t.push(o);
|
|
1044
|
-
}
|
|
1045
|
-
l(n, "addProperty");
|
|
1046
|
-
for (var r = Object.getPrototypeOf(e); r !== null; )
|
|
1047
|
-
Object.getOwnPropertyNames(r).forEach(n), r = Object.getPrototypeOf(r);
|
|
1048
|
-
return t;
|
|
1049
|
-
}
|
|
1050
|
-
l(On, "getProperties");
|
|
1051
|
-
var Rt = ["__flags", "__methods", "_obj", "assert"];
|
|
1052
|
-
function oe(e, t) {
|
|
1053
|
-
return ue() ? new Proxy(e, {
|
|
1054
|
-
get: /* @__PURE__ */ l(function n(r, o) {
|
|
1055
|
-
if (typeof o == "string" && $.proxyExcludedKeys.indexOf(o) === -1 && !Reflect.has(r, o)) {
|
|
1056
|
-
if (t)
|
|
1057
|
-
throw Error("Invalid Chai property: " + t + "." + o + '. See docs for proper usage of "' + t + '".');
|
|
1058
|
-
var a = null, c = 4;
|
|
1059
|
-
throw On(r).forEach(function(u) {
|
|
1060
|
-
if (!Object.prototype.hasOwnProperty(u) && Rt.indexOf(u) === -1) {
|
|
1061
|
-
var h = Nn(
|
|
1062
|
-
o,
|
|
1063
|
-
u,
|
|
1064
|
-
c
|
|
1065
|
-
);
|
|
1066
|
-
h < c && (a = u, c = h);
|
|
1067
|
-
}
|
|
1068
|
-
}), Error(a !== null ? "Invalid Chai property: " + o + '. Did you mean "' + a + '"?' : "Invalid Chai property: " + o);
|
|
1069
|
-
}
|
|
1070
|
-
return Rt.indexOf(o) === -1 && !v(r, "lockSsfi") && v(r, "ssfi", n), Reflect.get(r, o);
|
|
1071
|
-
}, "proxyGetter")
|
|
1072
|
-
}) : e;
|
|
1073
|
-
}
|
|
1074
|
-
l(oe, "proxify");
|
|
1075
|
-
function Nn(e, t, n) {
|
|
1076
|
-
if (Math.abs(e.length - t.length) >= n)
|
|
1077
|
-
return n;
|
|
1078
|
-
for (var r = [], o = 0; o <= e.length; o++)
|
|
1079
|
-
r[o] = Array(t.length + 1).fill(0), r[o][0] = o;
|
|
1080
|
-
for (var a = 0; a < t.length; a++)
|
|
1081
|
-
r[0][a] = a;
|
|
1082
|
-
for (var o = 1; o <= e.length; o++)
|
|
1083
|
-
for (var c = e.charCodeAt(o - 1), a = 1; a <= t.length; a++) {
|
|
1084
|
-
if (Math.abs(o - a) >= n) {
|
|
1085
|
-
r[o][a] = n;
|
|
1086
|
-
continue;
|
|
1087
|
-
}
|
|
1088
|
-
r[o][a] = Math.min(
|
|
1089
|
-
r[o - 1][a] + 1,
|
|
1090
|
-
r[o][a - 1] + 1,
|
|
1091
|
-
r[o - 1][a - 1] + (c === t.charCodeAt(a - 1) ? 0 : 1)
|
|
1092
|
-
);
|
|
1093
|
-
}
|
|
1094
|
-
return r[e.length][t.length];
|
|
1095
|
-
}
|
|
1096
|
-
l(Nn, "stringDistanceCapped");
|
|
1097
|
-
function it(e, t, n) {
|
|
1098
|
-
var r = /* @__PURE__ */ l(function() {
|
|
1099
|
-
v(this, "lockSsfi") || v(this, "ssfi", r);
|
|
1100
|
-
var o = n.apply(this, arguments);
|
|
1101
|
-
if (o !== void 0)
|
|
1102
|
-
return o;
|
|
1103
|
-
var a = new i();
|
|
1104
|
-
return V(this, a), a;
|
|
1105
|
-
}, "methodWrapper");
|
|
1106
|
-
fe(r, t, !1), e[t] = oe(r, t);
|
|
1107
|
-
}
|
|
1108
|
-
l(it, "addMethod");
|
|
1109
|
-
function at(e, t, n) {
|
|
1110
|
-
var r = Object.getOwnPropertyDescriptor(e, t), o = /* @__PURE__ */ l(function() {
|
|
1111
|
-
}, "_super");
|
|
1112
|
-
r && typeof r.get == "function" && (o = r.get), Object.defineProperty(
|
|
1113
|
-
e,
|
|
1114
|
-
t,
|
|
1115
|
-
{
|
|
1116
|
-
get: /* @__PURE__ */ l(function a() {
|
|
1117
|
-
!ue() && !v(this, "lockSsfi") && v(this, "ssfi", a);
|
|
1118
|
-
var c = v(this, "lockSsfi");
|
|
1119
|
-
v(this, "lockSsfi", !0);
|
|
1120
|
-
var u = n(o).call(this);
|
|
1121
|
-
if (v(this, "lockSsfi", c), u !== void 0)
|
|
1122
|
-
return u;
|
|
1123
|
-
var h = new i();
|
|
1124
|
-
return V(this, h), h;
|
|
1125
|
-
}, "overwritingPropertyGetter"),
|
|
1126
|
-
configurable: !0
|
|
1127
|
-
}
|
|
1128
|
-
);
|
|
1129
|
-
}
|
|
1130
|
-
l(at, "overwriteProperty");
|
|
1131
|
-
function ct(e, t, n) {
|
|
1132
|
-
var r = e[t], o = /* @__PURE__ */ l(function() {
|
|
1133
|
-
throw new Error(t + " is not a function");
|
|
1134
|
-
}, "_super");
|
|
1135
|
-
r && typeof r == "function" && (o = r);
|
|
1136
|
-
var a = /* @__PURE__ */ l(function() {
|
|
1137
|
-
v(this, "lockSsfi") || v(this, "ssfi", a);
|
|
1138
|
-
var c = v(this, "lockSsfi");
|
|
1139
|
-
v(this, "lockSsfi", !0);
|
|
1140
|
-
var u = n(o).apply(this, arguments);
|
|
1141
|
-
if (v(this, "lockSsfi", c), u !== void 0)
|
|
1142
|
-
return u;
|
|
1143
|
-
var h = new i();
|
|
1144
|
-
return V(this, h), h;
|
|
1145
|
-
}, "overwritingMethodWrapper");
|
|
1146
|
-
fe(a, t, !1), e[t] = oe(a, t);
|
|
1147
|
-
}
|
|
1148
|
-
l(ct, "overwriteMethod");
|
|
1149
|
-
var nr = typeof Object.setPrototypeOf == "function", Vt = /* @__PURE__ */ l(function() {
|
|
1150
|
-
}, "testFn"), rr = Object.getOwnPropertyNames(Vt).filter(function(e) {
|
|
1151
|
-
var t = Object.getOwnPropertyDescriptor(Vt, e);
|
|
1152
|
-
return typeof t != "object" ? !0 : !t.configurable;
|
|
1153
|
-
}), or = Function.prototype.call, sr = Function.prototype.apply;
|
|
1154
|
-
function ut(e, t, n, r) {
|
|
1155
|
-
typeof r != "function" && (r = /* @__PURE__ */ l(function() {
|
|
1156
|
-
}, "chainingBehavior"));
|
|
1157
|
-
var o = {
|
|
1158
|
-
method: n,
|
|
1159
|
-
chainingBehavior: r
|
|
1160
|
-
};
|
|
1161
|
-
e.__methods || (e.__methods = {}), e.__methods[t] = o, Object.defineProperty(
|
|
1162
|
-
e,
|
|
1163
|
-
t,
|
|
1164
|
-
{
|
|
1165
|
-
get: /* @__PURE__ */ l(function() {
|
|
1166
|
-
o.chainingBehavior.call(this);
|
|
1167
|
-
var c = /* @__PURE__ */ l(function() {
|
|
1168
|
-
v(this, "lockSsfi") || v(this, "ssfi", c);
|
|
1169
|
-
var p = o.method.apply(this, arguments);
|
|
1170
|
-
if (p !== void 0)
|
|
1171
|
-
return p;
|
|
1172
|
-
var b = new i();
|
|
1173
|
-
return V(this, b), b;
|
|
1174
|
-
}, "chainableMethodWrapper");
|
|
1175
|
-
if (fe(c, t, !0), nr) {
|
|
1176
|
-
var u = Object.create(this);
|
|
1177
|
-
u.call = or, u.apply = sr, Object.setPrototypeOf(c, u);
|
|
1178
|
-
} else {
|
|
1179
|
-
var h = Object.getOwnPropertyNames(e);
|
|
1180
|
-
h.forEach(function(p) {
|
|
1181
|
-
if (rr.indexOf(p) === -1) {
|
|
1182
|
-
var b = Object.getOwnPropertyDescriptor(e, p);
|
|
1183
|
-
Object.defineProperty(c, p, b);
|
|
1184
|
-
}
|
|
1185
|
-
});
|
|
1186
|
-
}
|
|
1187
|
-
return V(this, c), oe(c);
|
|
1188
|
-
}, "chainableMethodGetter"),
|
|
1189
|
-
configurable: !0
|
|
1190
|
-
}
|
|
1191
|
-
);
|
|
1192
|
-
}
|
|
1193
|
-
l(ut, "addChainableMethod");
|
|
1194
|
-
function ft(e, t, n, r) {
|
|
1195
|
-
var o = e.__methods[t], a = o.chainingBehavior;
|
|
1196
|
-
o.chainingBehavior = /* @__PURE__ */ l(function() {
|
|
1197
|
-
var h = r(a).call(this);
|
|
1198
|
-
if (h !== void 0)
|
|
1199
|
-
return h;
|
|
1200
|
-
var p = new i();
|
|
1201
|
-
return V(this, p), p;
|
|
1202
|
-
}, "overwritingChainableMethodGetter");
|
|
1203
|
-
var c = o.method;
|
|
1204
|
-
o.method = /* @__PURE__ */ l(function() {
|
|
1205
|
-
var h = n(c).apply(this, arguments);
|
|
1206
|
-
if (h !== void 0)
|
|
1207
|
-
return h;
|
|
1208
|
-
var p = new i();
|
|
1209
|
-
return V(this, p), p;
|
|
1210
|
-
}, "overwritingChainableMethodWrapper");
|
|
1211
|
-
}
|
|
1212
|
-
l(ft, "overwriteChainableMethod");
|
|
1213
|
-
function me(e, t) {
|
|
1214
|
-
return S(e) < S(t) ? -1 : 1;
|
|
1215
|
-
}
|
|
1216
|
-
l(me, "compareByInspect");
|
|
1217
|
-
function lt(e) {
|
|
1218
|
-
return typeof Object.getOwnPropertySymbols != "function" ? [] : Object.getOwnPropertySymbols(e).filter(function(t) {
|
|
1219
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1220
|
-
});
|
|
1221
|
-
}
|
|
1222
|
-
l(lt, "getOwnEnumerablePropertySymbols");
|
|
1223
|
-
function ht(e) {
|
|
1224
|
-
return Object.keys(e).concat(lt(e));
|
|
1225
|
-
}
|
|
1226
|
-
l(ht, "getOwnEnumerableProperties");
|
|
1227
|
-
function An(e) {
|
|
1228
|
-
return e !== e;
|
|
1229
|
-
}
|
|
1230
|
-
l(An, "_isNaN");
|
|
1231
|
-
var we = Number.isNaN || An;
|
|
1232
|
-
function Tn(e) {
|
|
1233
|
-
var t = O(e), n = ["Array", "Object", "Function"];
|
|
1234
|
-
return n.indexOf(t) !== -1;
|
|
1235
|
-
}
|
|
1236
|
-
l(Tn, "isObjectType");
|
|
1237
|
-
function dt(e, t) {
|
|
1238
|
-
var n = v(e, "operator"), r = v(e, "negate"), o = t[3], a = r ? t[2] : t[1];
|
|
1239
|
-
if (n)
|
|
1240
|
-
return n;
|
|
1241
|
-
if (typeof a == "function" && (a = a()), a = a || "", !!a && !/\shave\s/.test(a)) {
|
|
1242
|
-
var c = Tn(o);
|
|
1243
|
-
return /\snot\s/.test(a) ? c ? "notDeepStrictEqual" : "notStrictEqual" : c ? "deepStrictEqual" : "strictEqual";
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
l(dt, "getOperator");
|
|
1247
|
-
function je(e) {
|
|
1248
|
-
return e.name;
|
|
1249
|
-
}
|
|
1250
|
-
l(je, "getName");
|
|
1251
|
-
function ve(e) {
|
|
1252
|
-
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
1253
|
-
}
|
|
1254
|
-
l(ve, "isRegExp");
|
|
1255
|
-
function C(e) {
|
|
1256
|
-
return ["Number", "BigInt"].includes(O(e));
|
|
1257
|
-
}
|
|
1258
|
-
l(C, "isNumeric");
|
|
1259
|
-
var { flag: f } = pe;
|
|
1260
|
-
[
|
|
1261
|
-
"to",
|
|
1262
|
-
"be",
|
|
1263
|
-
"been",
|
|
1264
|
-
"is",
|
|
1265
|
-
"and",
|
|
1266
|
-
"has",
|
|
1267
|
-
"have",
|
|
1268
|
-
"with",
|
|
1269
|
-
"that",
|
|
1270
|
-
"which",
|
|
1271
|
-
"at",
|
|
1272
|
-
"of",
|
|
1273
|
-
"same",
|
|
1274
|
-
"but",
|
|
1275
|
-
"does",
|
|
1276
|
-
"still",
|
|
1277
|
-
"also"
|
|
1278
|
-
].forEach(function(e) {
|
|
1279
|
-
i.addProperty(e);
|
|
1280
|
-
});
|
|
1281
|
-
i.addProperty("not", function() {
|
|
1282
|
-
f(this, "negate", !0);
|
|
1283
|
-
});
|
|
1284
|
-
i.addProperty("deep", function() {
|
|
1285
|
-
f(this, "deep", !0);
|
|
1286
|
-
});
|
|
1287
|
-
i.addProperty("nested", function() {
|
|
1288
|
-
f(this, "nested", !0);
|
|
1289
|
-
});
|
|
1290
|
-
i.addProperty("own", function() {
|
|
1291
|
-
f(this, "own", !0);
|
|
1292
|
-
});
|
|
1293
|
-
i.addProperty("ordered", function() {
|
|
1294
|
-
f(this, "ordered", !0);
|
|
1295
|
-
});
|
|
1296
|
-
i.addProperty("any", function() {
|
|
1297
|
-
f(this, "any", !0), f(this, "all", !1);
|
|
1298
|
-
});
|
|
1299
|
-
i.addProperty("all", function() {
|
|
1300
|
-
f(this, "all", !0), f(this, "any", !1);
|
|
1301
|
-
});
|
|
1302
|
-
var Ut = {
|
|
1303
|
-
function: ["function", "asyncfunction", "generatorfunction", "asyncgeneratorfunction"],
|
|
1304
|
-
asyncfunction: ["asyncfunction", "asyncgeneratorfunction"],
|
|
1305
|
-
generatorfunction: ["generatorfunction", "asyncgeneratorfunction"],
|
|
1306
|
-
asyncgeneratorfunction: ["asyncgeneratorfunction"]
|
|
1307
|
-
};
|
|
1308
|
-
function pt(e, t) {
|
|
1309
|
-
t && f(this, "message", t), e = e.toLowerCase();
|
|
1310
|
-
var n = f(this, "object"), r = ~["a", "e", "i", "o", "u"].indexOf(e.charAt(0)) ? "an " : "a ";
|
|
1311
|
-
const o = O(n).toLowerCase();
|
|
1312
|
-
Ut.function.includes(e) ? this.assert(
|
|
1313
|
-
Ut[e].includes(o),
|
|
1314
|
-
"expected #{this} to be " + r + e,
|
|
1315
|
-
"expected #{this} not to be " + r + e
|
|
1316
|
-
) : this.assert(
|
|
1317
|
-
e === o,
|
|
1318
|
-
"expected #{this} to be " + r + e,
|
|
1319
|
-
"expected #{this} not to be " + r + e
|
|
1320
|
-
);
|
|
1321
|
-
}
|
|
1322
|
-
l(pt, "an");
|
|
1323
|
-
i.addChainableMethod("an", pt);
|
|
1324
|
-
i.addChainableMethod("a", pt);
|
|
1325
|
-
function In(e, t) {
|
|
1326
|
-
return we(e) && we(t) || e === t;
|
|
1327
|
-
}
|
|
1328
|
-
l(In, "SameValueZero");
|
|
1329
|
-
function le() {
|
|
1330
|
-
f(this, "contains", !0);
|
|
1331
|
-
}
|
|
1332
|
-
l(le, "includeChainingBehavior");
|
|
1333
|
-
function he(e, t) {
|
|
1334
|
-
t && f(this, "message", t);
|
|
1335
|
-
var n = f(this, "object"), r = O(n).toLowerCase(), o = f(this, "message"), a = f(this, "negate"), c = f(this, "ssfi"), u = f(this, "deep"), h = u ? "deep " : "", p = u ? f(this, "eql") : In;
|
|
1336
|
-
o = o ? o + ": " : "";
|
|
1337
|
-
var b = !1;
|
|
1338
|
-
switch (r) {
|
|
1339
|
-
case "string":
|
|
1340
|
-
b = n.indexOf(e) !== -1;
|
|
1341
|
-
break;
|
|
1342
|
-
case "weakset":
|
|
1343
|
-
if (u)
|
|
1344
|
-
throw new E(
|
|
1345
|
-
o + "unable to use .deep.include with WeakSet",
|
|
1346
|
-
void 0,
|
|
1347
|
-
c
|
|
1348
|
-
);
|
|
1349
|
-
b = n.has(e);
|
|
1350
|
-
break;
|
|
1351
|
-
case "map":
|
|
1352
|
-
n.forEach(function(w) {
|
|
1353
|
-
b = b || p(w, e);
|
|
1354
|
-
});
|
|
1355
|
-
break;
|
|
1356
|
-
case "set":
|
|
1357
|
-
u ? n.forEach(function(w) {
|
|
1358
|
-
b = b || p(w, e);
|
|
1359
|
-
}) : b = n.has(e);
|
|
1360
|
-
break;
|
|
1361
|
-
case "array":
|
|
1362
|
-
u ? b = n.some(function(w) {
|
|
1363
|
-
return p(w, e);
|
|
1364
|
-
}) : b = n.indexOf(e) !== -1;
|
|
1365
|
-
break;
|
|
1366
|
-
default:
|
|
1367
|
-
if (e !== Object(e))
|
|
1368
|
-
throw new E(
|
|
1369
|
-
o + "the given combination of arguments (" + r + " and " + O(e).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + O(e).toLowerCase(),
|
|
1370
|
-
void 0,
|
|
1371
|
-
c
|
|
1372
|
-
);
|
|
1373
|
-
var y = Object.keys(e), x = null, m = 0;
|
|
1374
|
-
if (y.forEach(function(w) {
|
|
1375
|
-
var j = new i(n);
|
|
1376
|
-
if (V(this, j, !0), f(j, "lockSsfi", !0), !a || y.length === 1) {
|
|
1377
|
-
j.property(w, e[w]);
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
try {
|
|
1381
|
-
j.property(w, e[w]);
|
|
1382
|
-
} catch (N) {
|
|
1383
|
-
if (!_.compatibleConstructor(N, E))
|
|
1384
|
-
throw N;
|
|
1385
|
-
x === null && (x = N), m++;
|
|
1386
|
-
}
|
|
1387
|
-
}, this), a && y.length > 1 && m === y.length)
|
|
1388
|
-
throw x;
|
|
1389
|
-
return;
|
|
1390
|
-
}
|
|
1391
|
-
this.assert(
|
|
1392
|
-
b,
|
|
1393
|
-
"expected #{this} to " + h + "include " + S(e),
|
|
1394
|
-
"expected #{this} to not " + h + "include " + S(e)
|
|
1395
|
-
);
|
|
1396
|
-
}
|
|
1397
|
-
l(he, "include");
|
|
1398
|
-
i.addChainableMethod("include", he, le);
|
|
1399
|
-
i.addChainableMethod("contain", he, le);
|
|
1400
|
-
i.addChainableMethod("contains", he, le);
|
|
1401
|
-
i.addChainableMethod("includes", he, le);
|
|
1402
|
-
i.addProperty("ok", function() {
|
|
1403
|
-
this.assert(
|
|
1404
|
-
f(this, "object"),
|
|
1405
|
-
"expected #{this} to be truthy",
|
|
1406
|
-
"expected #{this} to be falsy"
|
|
1407
|
-
);
|
|
1408
|
-
});
|
|
1409
|
-
i.addProperty("true", function() {
|
|
1410
|
-
this.assert(
|
|
1411
|
-
f(this, "object") === !0,
|
|
1412
|
-
"expected #{this} to be true",
|
|
1413
|
-
"expected #{this} to be false",
|
|
1414
|
-
!f(this, "negate")
|
|
1415
|
-
);
|
|
1416
|
-
});
|
|
1417
|
-
i.addProperty("numeric", function() {
|
|
1418
|
-
const e = f(this, "object");
|
|
1419
|
-
this.assert(
|
|
1420
|
-
["Number", "BigInt"].includes(O(e)),
|
|
1421
|
-
"expected #{this} to be numeric",
|
|
1422
|
-
"expected #{this} to not be numeric",
|
|
1423
|
-
!f(this, "negate")
|
|
1424
|
-
);
|
|
1425
|
-
});
|
|
1426
|
-
i.addProperty("callable", function() {
|
|
1427
|
-
const e = f(this, "object"), t = f(this, "ssfi"), n = f(this, "message"), r = n ? `${n}: ` : "", o = f(this, "negate"), a = o ? `${r}expected ${S(e)} not to be a callable function` : `${r}expected ${S(e)} to be a callable function`, c = ["Function", "AsyncFunction", "GeneratorFunction", "AsyncGeneratorFunction"].includes(O(e));
|
|
1428
|
-
if (c && o || !c && !o)
|
|
1429
|
-
throw new E(
|
|
1430
|
-
a,
|
|
1431
|
-
void 0,
|
|
1432
|
-
t
|
|
1433
|
-
);
|
|
1434
|
-
});
|
|
1435
|
-
i.addProperty("false", function() {
|
|
1436
|
-
this.assert(
|
|
1437
|
-
f(this, "object") === !1,
|
|
1438
|
-
"expected #{this} to be false",
|
|
1439
|
-
"expected #{this} to be true",
|
|
1440
|
-
!!f(this, "negate")
|
|
1441
|
-
);
|
|
1442
|
-
});
|
|
1443
|
-
i.addProperty("null", function() {
|
|
1444
|
-
this.assert(
|
|
1445
|
-
f(this, "object") === null,
|
|
1446
|
-
"expected #{this} to be null",
|
|
1447
|
-
"expected #{this} not to be null"
|
|
1448
|
-
);
|
|
1449
|
-
});
|
|
1450
|
-
i.addProperty("undefined", function() {
|
|
1451
|
-
this.assert(
|
|
1452
|
-
f(this, "object") === void 0,
|
|
1453
|
-
"expected #{this} to be undefined",
|
|
1454
|
-
"expected #{this} not to be undefined"
|
|
1455
|
-
);
|
|
1456
|
-
});
|
|
1457
|
-
i.addProperty("NaN", function() {
|
|
1458
|
-
this.assert(
|
|
1459
|
-
we(f(this, "object")),
|
|
1460
|
-
"expected #{this} to be NaN",
|
|
1461
|
-
"expected #{this} not to be NaN"
|
|
1462
|
-
);
|
|
1463
|
-
});
|
|
1464
|
-
function gt() {
|
|
1465
|
-
var e = f(this, "object");
|
|
1466
|
-
this.assert(
|
|
1467
|
-
e != null,
|
|
1468
|
-
"expected #{this} to exist",
|
|
1469
|
-
"expected #{this} to not exist"
|
|
1470
|
-
);
|
|
1471
|
-
}
|
|
1472
|
-
l(gt, "assertExist");
|
|
1473
|
-
i.addProperty("exist", gt);
|
|
1474
|
-
i.addProperty("exists", gt);
|
|
1475
|
-
i.addProperty("empty", function() {
|
|
1476
|
-
var e = f(this, "object"), t = f(this, "ssfi"), n = f(this, "message"), r;
|
|
1477
|
-
switch (n = n ? n + ": " : "", O(e).toLowerCase()) {
|
|
1478
|
-
case "array":
|
|
1479
|
-
case "string":
|
|
1480
|
-
r = e.length;
|
|
1481
|
-
break;
|
|
1482
|
-
case "map":
|
|
1483
|
-
case "set":
|
|
1484
|
-
r = e.size;
|
|
1485
|
-
break;
|
|
1486
|
-
case "weakmap":
|
|
1487
|
-
case "weakset":
|
|
1488
|
-
throw new E(
|
|
1489
|
-
n + ".empty was passed a weak collection",
|
|
1490
|
-
void 0,
|
|
1491
|
-
t
|
|
1492
|
-
);
|
|
1493
|
-
case "function":
|
|
1494
|
-
var o = n + ".empty was passed a function " + je(e);
|
|
1495
|
-
throw new E(o.trim(), void 0, t);
|
|
1496
|
-
default:
|
|
1497
|
-
if (e !== Object(e))
|
|
1498
|
-
throw new E(
|
|
1499
|
-
n + ".empty was passed non-string primitive " + S(e),
|
|
1500
|
-
void 0,
|
|
1501
|
-
t
|
|
1502
|
-
);
|
|
1503
|
-
r = Object.keys(e).length;
|
|
1504
|
-
}
|
|
1505
|
-
this.assert(
|
|
1506
|
-
r === 0,
|
|
1507
|
-
"expected #{this} to be empty",
|
|
1508
|
-
"expected #{this} not to be empty"
|
|
1509
|
-
);
|
|
1510
|
-
});
|
|
1511
|
-
function bt() {
|
|
1512
|
-
var e = f(this, "object"), t = O(e);
|
|
1513
|
-
this.assert(
|
|
1514
|
-
t === "Arguments",
|
|
1515
|
-
"expected #{this} to be arguments but got " + t,
|
|
1516
|
-
"expected #{this} to not be arguments"
|
|
1517
|
-
);
|
|
1518
|
-
}
|
|
1519
|
-
l(bt, "checkArguments");
|
|
1520
|
-
i.addProperty("arguments", bt);
|
|
1521
|
-
i.addProperty("Arguments", bt);
|
|
1522
|
-
function Me(e, t) {
|
|
1523
|
-
t && f(this, "message", t);
|
|
1524
|
-
var n = f(this, "object");
|
|
1525
|
-
if (f(this, "deep")) {
|
|
1526
|
-
var r = f(this, "lockSsfi");
|
|
1527
|
-
f(this, "lockSsfi", !0), this.eql(e), f(this, "lockSsfi", r);
|
|
1528
|
-
} else
|
|
1529
|
-
this.assert(
|
|
1530
|
-
e === n,
|
|
1531
|
-
"expected #{this} to equal #{exp}",
|
|
1532
|
-
"expected #{this} to not equal #{exp}",
|
|
1533
|
-
e,
|
|
1534
|
-
this._obj,
|
|
1535
|
-
!0
|
|
1536
|
-
);
|
|
1537
|
-
}
|
|
1538
|
-
l(Me, "assertEqual");
|
|
1539
|
-
i.addMethod("equal", Me);
|
|
1540
|
-
i.addMethod("equals", Me);
|
|
1541
|
-
i.addMethod("eq", Me);
|
|
1542
|
-
function yt(e, t) {
|
|
1543
|
-
t && f(this, "message", t);
|
|
1544
|
-
var n = f(this, "eql");
|
|
1545
|
-
this.assert(
|
|
1546
|
-
n(e, f(this, "object")),
|
|
1547
|
-
"expected #{this} to deeply equal #{exp}",
|
|
1548
|
-
"expected #{this} to not deeply equal #{exp}",
|
|
1549
|
-
e,
|
|
1550
|
-
this._obj,
|
|
1551
|
-
!0
|
|
1552
|
-
);
|
|
1553
|
-
}
|
|
1554
|
-
l(yt, "assertEql");
|
|
1555
|
-
i.addMethod("eql", yt);
|
|
1556
|
-
i.addMethod("eqls", yt);
|
|
1557
|
-
function Oe(e, t) {
|
|
1558
|
-
t && f(this, "message", t);
|
|
1559
|
-
var n = f(this, "object"), r = f(this, "doLength"), o = f(this, "message"), a = o ? o + ": " : "", c = f(this, "ssfi"), u = O(n).toLowerCase(), h = O(e).toLowerCase();
|
|
1560
|
-
if (r && u !== "map" && u !== "set" && new i(n, o, c, !0).to.have.property("length"), !r && u === "date" && h !== "date")
|
|
1561
|
-
throw new E(a + "the argument to above must be a date", void 0, c);
|
|
1562
|
-
if (!C(e) && (r || C(n)))
|
|
1563
|
-
throw new E(a + "the argument to above must be a number", void 0, c);
|
|
1564
|
-
if (!r && u !== "date" && !C(n)) {
|
|
1565
|
-
var p = u === "string" ? "'" + n + "'" : n;
|
|
1566
|
-
throw new E(a + "expected " + p + " to be a number or a date", void 0, c);
|
|
1567
|
-
}
|
|
1568
|
-
if (r) {
|
|
1569
|
-
var b = "length", y;
|
|
1570
|
-
u === "map" || u === "set" ? (b = "size", y = n.size) : y = n.length, this.assert(
|
|
1571
|
-
y > e,
|
|
1572
|
-
"expected #{this} to have a " + b + " above #{exp} but got #{act}",
|
|
1573
|
-
"expected #{this} to not have a " + b + " above #{exp}",
|
|
1574
|
-
e,
|
|
1575
|
-
y
|
|
1576
|
-
);
|
|
1577
|
-
} else
|
|
1578
|
-
this.assert(
|
|
1579
|
-
n > e,
|
|
1580
|
-
"expected #{this} to be above #{exp}",
|
|
1581
|
-
"expected #{this} to be at most #{exp}",
|
|
1582
|
-
e
|
|
1583
|
-
);
|
|
1584
|
-
}
|
|
1585
|
-
l(Oe, "assertAbove");
|
|
1586
|
-
i.addMethod("above", Oe);
|
|
1587
|
-
i.addMethod("gt", Oe);
|
|
1588
|
-
i.addMethod("greaterThan", Oe);
|
|
1589
|
-
function Ne(e, t) {
|
|
1590
|
-
t && f(this, "message", t);
|
|
1591
|
-
var n = f(this, "object"), r = f(this, "doLength"), o = f(this, "message"), a = o ? o + ": " : "", c = f(this, "ssfi"), u = O(n).toLowerCase(), h = O(e).toLowerCase(), p, b = !0;
|
|
1592
|
-
if (r && u !== "map" && u !== "set" && new i(n, o, c, !0).to.have.property("length"), !r && u === "date" && h !== "date")
|
|
1593
|
-
p = a + "the argument to least must be a date";
|
|
1594
|
-
else if (!C(e) && (r || C(n)))
|
|
1595
|
-
p = a + "the argument to least must be a number";
|
|
1596
|
-
else if (!r && u !== "date" && !C(n)) {
|
|
1597
|
-
var y = u === "string" ? "'" + n + "'" : n;
|
|
1598
|
-
p = a + "expected " + y + " to be a number or a date";
|
|
1599
|
-
} else
|
|
1600
|
-
b = !1;
|
|
1601
|
-
if (b)
|
|
1602
|
-
throw new E(p, void 0, c);
|
|
1603
|
-
if (r) {
|
|
1604
|
-
var x = "length", m;
|
|
1605
|
-
u === "map" || u === "set" ? (x = "size", m = n.size) : m = n.length, this.assert(
|
|
1606
|
-
m >= e,
|
|
1607
|
-
"expected #{this} to have a " + x + " at least #{exp} but got #{act}",
|
|
1608
|
-
"expected #{this} to have a " + x + " below #{exp}",
|
|
1609
|
-
e,
|
|
1610
|
-
m
|
|
1611
|
-
);
|
|
1612
|
-
} else
|
|
1613
|
-
this.assert(
|
|
1614
|
-
n >= e,
|
|
1615
|
-
"expected #{this} to be at least #{exp}",
|
|
1616
|
-
"expected #{this} to be below #{exp}",
|
|
1617
|
-
e
|
|
1618
|
-
);
|
|
1619
|
-
}
|
|
1620
|
-
l(Ne, "assertLeast");
|
|
1621
|
-
i.addMethod("least", Ne);
|
|
1622
|
-
i.addMethod("gte", Ne);
|
|
1623
|
-
i.addMethod("greaterThanOrEqual", Ne);
|
|
1624
|
-
function Ae(e, t) {
|
|
1625
|
-
t && f(this, "message", t);
|
|
1626
|
-
var n = f(this, "object"), r = f(this, "doLength"), o = f(this, "message"), a = o ? o + ": " : "", c = f(this, "ssfi"), u = O(n).toLowerCase(), h = O(e).toLowerCase(), p, b = !0;
|
|
1627
|
-
if (r && u !== "map" && u !== "set" && new i(n, o, c, !0).to.have.property("length"), !r && u === "date" && h !== "date")
|
|
1628
|
-
p = a + "the argument to below must be a date";
|
|
1629
|
-
else if (!C(e) && (r || C(n)))
|
|
1630
|
-
p = a + "the argument to below must be a number";
|
|
1631
|
-
else if (!r && u !== "date" && !C(n)) {
|
|
1632
|
-
var y = u === "string" ? "'" + n + "'" : n;
|
|
1633
|
-
p = a + "expected " + y + " to be a number or a date";
|
|
1634
|
-
} else
|
|
1635
|
-
b = !1;
|
|
1636
|
-
if (b)
|
|
1637
|
-
throw new E(p, void 0, c);
|
|
1638
|
-
if (r) {
|
|
1639
|
-
var x = "length", m;
|
|
1640
|
-
u === "map" || u === "set" ? (x = "size", m = n.size) : m = n.length, this.assert(
|
|
1641
|
-
m < e,
|
|
1642
|
-
"expected #{this} to have a " + x + " below #{exp} but got #{act}",
|
|
1643
|
-
"expected #{this} to not have a " + x + " below #{exp}",
|
|
1644
|
-
e,
|
|
1645
|
-
m
|
|
1646
|
-
);
|
|
1647
|
-
} else
|
|
1648
|
-
this.assert(
|
|
1649
|
-
n < e,
|
|
1650
|
-
"expected #{this} to be below #{exp}",
|
|
1651
|
-
"expected #{this} to be at least #{exp}",
|
|
1652
|
-
e
|
|
1653
|
-
);
|
|
1654
|
-
}
|
|
1655
|
-
l(Ae, "assertBelow");
|
|
1656
|
-
i.addMethod("below", Ae);
|
|
1657
|
-
i.addMethod("lt", Ae);
|
|
1658
|
-
i.addMethod("lessThan", Ae);
|
|
1659
|
-
function Te(e, t) {
|
|
1660
|
-
t && f(this, "message", t);
|
|
1661
|
-
var n = f(this, "object"), r = f(this, "doLength"), o = f(this, "message"), a = o ? o + ": " : "", c = f(this, "ssfi"), u = O(n).toLowerCase(), h = O(e).toLowerCase(), p, b = !0;
|
|
1662
|
-
if (r && u !== "map" && u !== "set" && new i(n, o, c, !0).to.have.property("length"), !r && u === "date" && h !== "date")
|
|
1663
|
-
p = a + "the argument to most must be a date";
|
|
1664
|
-
else if (!C(e) && (r || C(n)))
|
|
1665
|
-
p = a + "the argument to most must be a number";
|
|
1666
|
-
else if (!r && u !== "date" && !C(n)) {
|
|
1667
|
-
var y = u === "string" ? "'" + n + "'" : n;
|
|
1668
|
-
p = a + "expected " + y + " to be a number or a date";
|
|
1669
|
-
} else
|
|
1670
|
-
b = !1;
|
|
1671
|
-
if (b)
|
|
1672
|
-
throw new E(p, void 0, c);
|
|
1673
|
-
if (r) {
|
|
1674
|
-
var x = "length", m;
|
|
1675
|
-
u === "map" || u === "set" ? (x = "size", m = n.size) : m = n.length, this.assert(
|
|
1676
|
-
m <= e,
|
|
1677
|
-
"expected #{this} to have a " + x + " at most #{exp} but got #{act}",
|
|
1678
|
-
"expected #{this} to have a " + x + " above #{exp}",
|
|
1679
|
-
e,
|
|
1680
|
-
m
|
|
1681
|
-
);
|
|
1682
|
-
} else
|
|
1683
|
-
this.assert(
|
|
1684
|
-
n <= e,
|
|
1685
|
-
"expected #{this} to be at most #{exp}",
|
|
1686
|
-
"expected #{this} to be above #{exp}",
|
|
1687
|
-
e
|
|
1688
|
-
);
|
|
1689
|
-
}
|
|
1690
|
-
l(Te, "assertMost");
|
|
1691
|
-
i.addMethod("most", Te);
|
|
1692
|
-
i.addMethod("lte", Te);
|
|
1693
|
-
i.addMethod("lessThanOrEqual", Te);
|
|
1694
|
-
i.addMethod("within", function(e, t, n) {
|
|
1695
|
-
n && f(this, "message", n);
|
|
1696
|
-
var r = f(this, "object"), o = f(this, "doLength"), a = f(this, "message"), c = a ? a + ": " : "", u = f(this, "ssfi"), h = O(r).toLowerCase(), p = O(e).toLowerCase(), b = O(t).toLowerCase(), y, x = !0, m = p === "date" && b === "date" ? e.toISOString() + ".." + t.toISOString() : e + ".." + t;
|
|
1697
|
-
if (o && h !== "map" && h !== "set" && new i(r, a, u, !0).to.have.property("length"), !o && h === "date" && (p !== "date" || b !== "date"))
|
|
1698
|
-
y = c + "the arguments to within must be dates";
|
|
1699
|
-
else if ((!C(e) || !C(t)) && (o || C(r)))
|
|
1700
|
-
y = c + "the arguments to within must be numbers";
|
|
1701
|
-
else if (!o && h !== "date" && !C(r)) {
|
|
1702
|
-
var w = h === "string" ? "'" + r + "'" : r;
|
|
1703
|
-
y = c + "expected " + w + " to be a number or a date";
|
|
1704
|
-
} else
|
|
1705
|
-
x = !1;
|
|
1706
|
-
if (x)
|
|
1707
|
-
throw new E(y, void 0, u);
|
|
1708
|
-
if (o) {
|
|
1709
|
-
var j = "length", N;
|
|
1710
|
-
h === "map" || h === "set" ? (j = "size", N = r.size) : N = r.length, this.assert(
|
|
1711
|
-
N >= e && N <= t,
|
|
1712
|
-
"expected #{this} to have a " + j + " within " + m,
|
|
1713
|
-
"expected #{this} to not have a " + j + " within " + m
|
|
1714
|
-
);
|
|
1715
|
-
} else
|
|
1716
|
-
this.assert(
|
|
1717
|
-
r >= e && r <= t,
|
|
1718
|
-
"expected #{this} to be within " + m,
|
|
1719
|
-
"expected #{this} to not be within " + m
|
|
1720
|
-
);
|
|
1721
|
-
});
|
|
1722
|
-
function mt(e, t) {
|
|
1723
|
-
t && f(this, "message", t);
|
|
1724
|
-
var n = f(this, "object"), r = f(this, "ssfi"), o = f(this, "message");
|
|
1725
|
-
try {
|
|
1726
|
-
var a = n instanceof e;
|
|
1727
|
-
} catch (u) {
|
|
1728
|
-
throw u instanceof TypeError ? (o = o ? o + ": " : "", new E(
|
|
1729
|
-
o + "The instanceof assertion needs a constructor but " + O(e) + " was given.",
|
|
1730
|
-
void 0,
|
|
1731
|
-
r
|
|
1732
|
-
)) : u;
|
|
1733
|
-
}
|
|
1734
|
-
var c = je(e);
|
|
1735
|
-
c == null && (c = "an unnamed constructor"), this.assert(
|
|
1736
|
-
a,
|
|
1737
|
-
"expected #{this} to be an instance of " + c,
|
|
1738
|
-
"expected #{this} to not be an instance of " + c
|
|
1739
|
-
);
|
|
1740
|
-
}
|
|
1741
|
-
l(mt, "assertInstanceOf");
|
|
1742
|
-
i.addMethod("instanceof", mt);
|
|
1743
|
-
i.addMethod("instanceOf", mt);
|
|
1744
|
-
function wt(e, t, n) {
|
|
1745
|
-
n && f(this, "message", n);
|
|
1746
|
-
var r = f(this, "nested"), o = f(this, "own"), a = f(this, "message"), c = f(this, "object"), u = f(this, "ssfi"), h = typeof e;
|
|
1747
|
-
if (a = a ? a + ": " : "", r) {
|
|
1748
|
-
if (h !== "string")
|
|
1749
|
-
throw new E(
|
|
1750
|
-
a + "the argument to property must be a string when using nested syntax",
|
|
1751
|
-
void 0,
|
|
1752
|
-
u
|
|
1753
|
-
);
|
|
1754
|
-
} else if (h !== "string" && h !== "number" && h !== "symbol")
|
|
1755
|
-
throw new E(
|
|
1756
|
-
a + "the argument to property must be a string, number, or symbol",
|
|
1757
|
-
void 0,
|
|
1758
|
-
u
|
|
1759
|
-
);
|
|
1760
|
-
if (r && o)
|
|
1761
|
-
throw new E(
|
|
1762
|
-
a + 'The "nested" and "own" flags cannot be combined.',
|
|
1763
|
-
void 0,
|
|
1764
|
-
u
|
|
1765
|
-
);
|
|
1766
|
-
if (c == null)
|
|
1767
|
-
throw new E(
|
|
1768
|
-
a + "Target cannot be null or undefined.",
|
|
1769
|
-
void 0,
|
|
1770
|
-
u
|
|
1771
|
-
);
|
|
1772
|
-
var p = f(this, "deep"), b = f(this, "negate"), y = r ? ot(c, e) : null, x = r ? y.value : c[e], m = p ? f(this, "eql") : (N, B) => N === B, w = "";
|
|
1773
|
-
p && (w += "deep "), o && (w += "own "), r && (w += "nested "), w += "property ";
|
|
1774
|
-
var j;
|
|
1775
|
-
o ? j = Object.prototype.hasOwnProperty.call(c, e) : r ? j = y.exists : j = Ee(c, e), (!b || arguments.length === 1) && this.assert(
|
|
1776
|
-
j,
|
|
1777
|
-
"expected #{this} to have " + w + S(e),
|
|
1778
|
-
"expected #{this} to not have " + w + S(e)
|
|
1779
|
-
), arguments.length > 1 && this.assert(
|
|
1780
|
-
j && m(t, x),
|
|
1781
|
-
"expected #{this} to have " + w + S(e) + " of #{exp}, but got #{act}",
|
|
1782
|
-
"expected #{this} to not have " + w + S(e) + " of #{act}",
|
|
1783
|
-
t,
|
|
1784
|
-
x
|
|
1785
|
-
), f(this, "object", x);
|
|
1786
|
-
}
|
|
1787
|
-
l(wt, "assertProperty");
|
|
1788
|
-
i.addMethod("property", wt);
|
|
1789
|
-
function vt(e, t, n) {
|
|
1790
|
-
f(this, "own", !0), wt.apply(this, arguments);
|
|
1791
|
-
}
|
|
1792
|
-
l(vt, "assertOwnProperty");
|
|
1793
|
-
i.addMethod("ownProperty", vt);
|
|
1794
|
-
i.addMethod("haveOwnProperty", vt);
|
|
1795
|
-
function xt(e, t, n) {
|
|
1796
|
-
typeof t == "string" && (n = t, t = null), n && f(this, "message", n);
|
|
1797
|
-
var r = f(this, "object"), o = Object.getOwnPropertyDescriptor(Object(r), e), a = f(this, "eql");
|
|
1798
|
-
o && t ? this.assert(
|
|
1799
|
-
a(t, o),
|
|
1800
|
-
"expected the own property descriptor for " + S(e) + " on #{this} to match " + S(t) + ", got " + S(o),
|
|
1801
|
-
"expected the own property descriptor for " + S(e) + " on #{this} to not match " + S(t),
|
|
1802
|
-
t,
|
|
1803
|
-
o,
|
|
1804
|
-
!0
|
|
1805
|
-
) : this.assert(
|
|
1806
|
-
o,
|
|
1807
|
-
"expected #{this} to have an own property descriptor for " + S(e),
|
|
1808
|
-
"expected #{this} to not have an own property descriptor for " + S(e)
|
|
1809
|
-
), f(this, "object", o);
|
|
1810
|
-
}
|
|
1811
|
-
l(xt, "assertOwnPropertyDescriptor");
|
|
1812
|
-
i.addMethod("ownPropertyDescriptor", xt);
|
|
1813
|
-
i.addMethod("haveOwnPropertyDescriptor", xt);
|
|
1814
|
-
function Pt() {
|
|
1815
|
-
f(this, "doLength", !0);
|
|
1816
|
-
}
|
|
1817
|
-
l(Pt, "assertLengthChain");
|
|
1818
|
-
function St(e, t) {
|
|
1819
|
-
t && f(this, "message", t);
|
|
1820
|
-
var n = f(this, "object"), r = O(n).toLowerCase(), o = f(this, "message"), a = f(this, "ssfi"), c = "length", u;
|
|
1821
|
-
switch (r) {
|
|
1822
|
-
case "map":
|
|
1823
|
-
case "set":
|
|
1824
|
-
c = "size", u = n.size;
|
|
1825
|
-
break;
|
|
1826
|
-
default:
|
|
1827
|
-
new i(n, o, a, !0).to.have.property("length"), u = n.length;
|
|
1828
|
-
}
|
|
1829
|
-
this.assert(
|
|
1830
|
-
u == e,
|
|
1831
|
-
"expected #{this} to have a " + c + " of #{exp} but got #{act}",
|
|
1832
|
-
"expected #{this} to not have a " + c + " of #{act}",
|
|
1833
|
-
e,
|
|
1834
|
-
u
|
|
1835
|
-
);
|
|
1836
|
-
}
|
|
1837
|
-
l(St, "assertLength");
|
|
1838
|
-
i.addChainableMethod("length", St, Pt);
|
|
1839
|
-
i.addChainableMethod("lengthOf", St, Pt);
|
|
1840
|
-
function Et(e, t) {
|
|
1841
|
-
t && f(this, "message", t);
|
|
1842
|
-
var n = f(this, "object");
|
|
1843
|
-
this.assert(
|
|
1844
|
-
e.exec(n),
|
|
1845
|
-
"expected #{this} to match " + e,
|
|
1846
|
-
"expected #{this} not to match " + e
|
|
1847
|
-
);
|
|
1848
|
-
}
|
|
1849
|
-
l(Et, "assertMatch");
|
|
1850
|
-
i.addMethod("match", Et);
|
|
1851
|
-
i.addMethod("matches", Et);
|
|
1852
|
-
i.addMethod("string", function(e, t) {
|
|
1853
|
-
t && f(this, "message", t);
|
|
1854
|
-
var n = f(this, "object"), r = f(this, "message"), o = f(this, "ssfi");
|
|
1855
|
-
new i(n, r, o, !0).is.a("string"), this.assert(
|
|
1856
|
-
~n.indexOf(e),
|
|
1857
|
-
"expected #{this} to contain " + S(e),
|
|
1858
|
-
"expected #{this} to not contain " + S(e)
|
|
1859
|
-
);
|
|
1860
|
-
});
|
|
1861
|
-
function jt(e) {
|
|
1862
|
-
var t = f(this, "object"), n = O(t), r = O(e), o = f(this, "ssfi"), a = f(this, "deep"), c, u = "", h, p = !0, b = f(this, "message");
|
|
1863
|
-
b = b ? b + ": " : "";
|
|
1864
|
-
var y = b + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
|
|
1865
|
-
if (n === "Map" || n === "Set")
|
|
1866
|
-
u = a ? "deeply " : "", h = [], t.forEach(function(A, T) {
|
|
1867
|
-
h.push(T);
|
|
1868
|
-
}), r !== "Array" && (e = Array.prototype.slice.call(arguments));
|
|
1869
|
-
else {
|
|
1870
|
-
switch (h = ht(t), r) {
|
|
1871
|
-
case "Array":
|
|
1872
|
-
if (arguments.length > 1)
|
|
1873
|
-
throw new E(y, void 0, o);
|
|
1874
|
-
break;
|
|
1875
|
-
case "Object":
|
|
1876
|
-
if (arguments.length > 1)
|
|
1877
|
-
throw new E(y, void 0, o);
|
|
1878
|
-
e = Object.keys(e);
|
|
1879
|
-
break;
|
|
1880
|
-
default:
|
|
1881
|
-
e = Array.prototype.slice.call(arguments);
|
|
1882
|
-
}
|
|
1883
|
-
e = e.map(function(A) {
|
|
1884
|
-
return typeof A == "symbol" ? A : String(A);
|
|
1885
|
-
});
|
|
1886
|
-
}
|
|
1887
|
-
if (!e.length)
|
|
1888
|
-
throw new E(b + "keys required", void 0, o);
|
|
1889
|
-
var x = e.length, m = f(this, "any"), w = f(this, "all"), j = e, N = a ? f(this, "eql") : (A, T) => A === T;
|
|
1890
|
-
if (!m && !w && (w = !0), m && (p = j.some(function(A) {
|
|
1891
|
-
return h.some(function(T) {
|
|
1892
|
-
return N(A, T);
|
|
1893
|
-
});
|
|
1894
|
-
})), w && (p = j.every(function(A) {
|
|
1895
|
-
return h.some(function(T) {
|
|
1896
|
-
return N(A, T);
|
|
1897
|
-
});
|
|
1898
|
-
}), f(this, "contains") || (p = p && e.length == h.length)), x > 1) {
|
|
1899
|
-
e = e.map(function(A) {
|
|
1900
|
-
return S(A);
|
|
1901
|
-
});
|
|
1902
|
-
var B = e.pop();
|
|
1903
|
-
w && (c = e.join(", ") + ", and " + B), m && (c = e.join(", ") + ", or " + B);
|
|
1904
|
-
} else
|
|
1905
|
-
c = S(e[0]);
|
|
1906
|
-
c = (x > 1 ? "keys " : "key ") + c, c = (f(this, "contains") ? "contain " : "have ") + c, this.assert(
|
|
1907
|
-
p,
|
|
1908
|
-
"expected #{this} to " + u + c,
|
|
1909
|
-
"expected #{this} to not " + u + c,
|
|
1910
|
-
j.slice(0).sort(me),
|
|
1911
|
-
h.sort(me),
|
|
1912
|
-
!0
|
|
1913
|
-
);
|
|
1914
|
-
}
|
|
1915
|
-
l(jt, "assertKeys");
|
|
1916
|
-
i.addMethod("keys", jt);
|
|
1917
|
-
i.addMethod("key", jt);
|
|
1918
|
-
function Ie(e, t, n) {
|
|
1919
|
-
n && f(this, "message", n);
|
|
1920
|
-
var r = f(this, "object"), o = f(this, "ssfi"), a = f(this, "message"), c = f(this, "negate") || !1;
|
|
1921
|
-
new i(r, a, o, !0).is.a("function"), (ve(e) || typeof e == "string") && (t = e, e = null);
|
|
1922
|
-
let u, h = !1;
|
|
1923
|
-
try {
|
|
1924
|
-
r();
|
|
1925
|
-
} catch (A) {
|
|
1926
|
-
h = !0, u = A;
|
|
1927
|
-
}
|
|
1928
|
-
var p = e === void 0 && t === void 0, b = !!(e && t), y = !1, x = !1;
|
|
1929
|
-
if (p || !p && !c) {
|
|
1930
|
-
var m = "an error";
|
|
1931
|
-
e instanceof Error ? m = "#{exp}" : e && (m = _.getConstructorName(e));
|
|
1932
|
-
let A = u;
|
|
1933
|
-
if (u instanceof Error)
|
|
1934
|
-
A = u.toString();
|
|
1935
|
-
else if (typeof u == "string")
|
|
1936
|
-
A = u;
|
|
1937
|
-
else if (u && (typeof u == "object" || typeof u == "function"))
|
|
1938
|
-
try {
|
|
1939
|
-
A = _.getConstructorName(u);
|
|
1940
|
-
} catch {
|
|
1941
|
-
}
|
|
1942
|
-
this.assert(
|
|
1943
|
-
h,
|
|
1944
|
-
"expected #{this} to throw " + m,
|
|
1945
|
-
"expected #{this} to not throw an error but #{act} was thrown",
|
|
1946
|
-
e && e.toString(),
|
|
1947
|
-
A
|
|
1948
|
-
);
|
|
1949
|
-
}
|
|
1950
|
-
if (e && u) {
|
|
1951
|
-
if (e instanceof Error) {
|
|
1952
|
-
var w = _.compatibleInstance(u, e);
|
|
1953
|
-
w === c && (b && c ? y = !0 : this.assert(
|
|
1954
|
-
c,
|
|
1955
|
-
"expected #{this} to throw #{exp} but #{act} was thrown",
|
|
1956
|
-
"expected #{this} to not throw #{exp}" + (u && !c ? " but #{act} was thrown" : ""),
|
|
1957
|
-
e.toString(),
|
|
1958
|
-
u.toString()
|
|
1959
|
-
));
|
|
1960
|
-
}
|
|
1961
|
-
var j = _.compatibleConstructor(u, e);
|
|
1962
|
-
j === c && (b && c ? y = !0 : this.assert(
|
|
1963
|
-
c,
|
|
1964
|
-
"expected #{this} to throw #{exp} but #{act} was thrown",
|
|
1965
|
-
"expected #{this} to not throw #{exp}" + (u ? " but #{act} was thrown" : ""),
|
|
1966
|
-
e instanceof Error ? e.toString() : e && _.getConstructorName(e),
|
|
1967
|
-
u instanceof Error ? u.toString() : u && _.getConstructorName(u)
|
|
1968
|
-
));
|
|
1969
|
-
}
|
|
1970
|
-
if (u && t !== void 0 && t !== null) {
|
|
1971
|
-
var N = "including";
|
|
1972
|
-
ve(t) && (N = "matching");
|
|
1973
|
-
var B = _.compatibleMessage(u, t);
|
|
1974
|
-
B === c && (b && c ? x = !0 : this.assert(
|
|
1975
|
-
c,
|
|
1976
|
-
"expected #{this} to throw error " + N + " #{exp} but got #{act}",
|
|
1977
|
-
"expected #{this} to throw error not " + N + " #{exp}",
|
|
1978
|
-
t,
|
|
1979
|
-
_.getMessage(u)
|
|
1980
|
-
));
|
|
1981
|
-
}
|
|
1982
|
-
y && x && this.assert(
|
|
1983
|
-
c,
|
|
1984
|
-
"expected #{this} to throw #{exp} but #{act} was thrown",
|
|
1985
|
-
"expected #{this} to not throw #{exp}" + (u ? " but #{act} was thrown" : ""),
|
|
1986
|
-
e instanceof Error ? e.toString() : e && _.getConstructorName(e),
|
|
1987
|
-
u instanceof Error ? u.toString() : u && _.getConstructorName(u)
|
|
1988
|
-
), f(this, "object", u);
|
|
1989
|
-
}
|
|
1990
|
-
l(Ie, "assertThrows");
|
|
1991
|
-
i.addMethod("throw", Ie);
|
|
1992
|
-
i.addMethod("throws", Ie);
|
|
1993
|
-
i.addMethod("Throw", Ie);
|
|
1994
|
-
function Mt(e, t) {
|
|
1995
|
-
t && f(this, "message", t);
|
|
1996
|
-
var n = f(this, "object"), r = f(this, "itself"), o = typeof n == "function" && !r ? n.prototype[e] : n[e];
|
|
1997
|
-
this.assert(
|
|
1998
|
-
typeof o == "function",
|
|
1999
|
-
"expected #{this} to respond to " + S(e),
|
|
2000
|
-
"expected #{this} to not respond to " + S(e)
|
|
2001
|
-
);
|
|
2002
|
-
}
|
|
2003
|
-
l(Mt, "respondTo");
|
|
2004
|
-
i.addMethod("respondTo", Mt);
|
|
2005
|
-
i.addMethod("respondsTo", Mt);
|
|
2006
|
-
i.addProperty("itself", function() {
|
|
2007
|
-
f(this, "itself", !0);
|
|
2008
|
-
});
|
|
2009
|
-
function Ot(e, t) {
|
|
2010
|
-
t && f(this, "message", t);
|
|
2011
|
-
var n = f(this, "object"), r = e(n);
|
|
2012
|
-
this.assert(
|
|
2013
|
-
r,
|
|
2014
|
-
"expected #{this} to satisfy " + Z(e),
|
|
2015
|
-
"expected #{this} to not satisfy" + Z(e),
|
|
2016
|
-
!f(this, "negate"),
|
|
2017
|
-
r
|
|
2018
|
-
);
|
|
2019
|
-
}
|
|
2020
|
-
l(Ot, "satisfy");
|
|
2021
|
-
i.addMethod("satisfy", Ot);
|
|
2022
|
-
i.addMethod("satisfies", Ot);
|
|
2023
|
-
function Nt(e, t, n) {
|
|
2024
|
-
n && f(this, "message", n);
|
|
2025
|
-
var r = f(this, "object"), o = f(this, "message"), a = f(this, "ssfi");
|
|
2026
|
-
new i(r, o, a, !0).is.numeric;
|
|
2027
|
-
let c = "A `delta` value is required for `closeTo`";
|
|
2028
|
-
if (t == null)
|
|
2029
|
-
throw new E(o ? `${o}: ${c}` : c, void 0, a);
|
|
2030
|
-
if (new i(t, o, a, !0).is.numeric, c = "A `expected` value is required for `closeTo`", e == null)
|
|
2031
|
-
throw new E(o ? `${o}: ${c}` : c, void 0, a);
|
|
2032
|
-
new i(e, o, a, !0).is.numeric;
|
|
2033
|
-
const u = /* @__PURE__ */ l((h) => h < 0n ? -h : h, "abs");
|
|
2034
|
-
this.assert(
|
|
2035
|
-
u(r - e) <= t,
|
|
2036
|
-
"expected #{this} to be close to " + e + " +/- " + t,
|
|
2037
|
-
"expected #{this} not to be close to " + e + " +/- " + t
|
|
2038
|
-
);
|
|
2039
|
-
}
|
|
2040
|
-
l(Nt, "closeTo");
|
|
2041
|
-
i.addMethod("closeTo", Nt);
|
|
2042
|
-
i.addMethod("approximately", Nt);
|
|
2043
|
-
function Cn(e, t, n, r, o) {
|
|
2044
|
-
let a = Array.from(t), c = Array.from(e);
|
|
2045
|
-
if (!r) {
|
|
2046
|
-
if (c.length !== a.length)
|
|
2047
|
-
return !1;
|
|
2048
|
-
a = a.slice();
|
|
2049
|
-
}
|
|
2050
|
-
return c.every(function(u, h) {
|
|
2051
|
-
if (o)
|
|
2052
|
-
return n ? n(u, a[h]) : u === a[h];
|
|
2053
|
-
if (!n) {
|
|
2054
|
-
var p = a.indexOf(u);
|
|
2055
|
-
return p === -1 ? !1 : (r || a.splice(p, 1), !0);
|
|
2056
|
-
}
|
|
2057
|
-
return a.some(function(b, y) {
|
|
2058
|
-
return n(u, b) ? (r || a.splice(y, 1), !0) : !1;
|
|
2059
|
-
});
|
|
2060
|
-
});
|
|
2061
|
-
}
|
|
2062
|
-
l(Cn, "isSubsetOf");
|
|
2063
|
-
i.addMethod("members", function(e, t) {
|
|
2064
|
-
t && f(this, "message", t);
|
|
2065
|
-
var n = f(this, "object"), r = f(this, "message"), o = f(this, "ssfi");
|
|
2066
|
-
new i(n, r, o, !0).to.be.iterable, new i(e, r, o, !0).to.be.iterable;
|
|
2067
|
-
var a = f(this, "contains"), c = f(this, "ordered"), u, h, p;
|
|
2068
|
-
a ? (u = c ? "an ordered superset" : "a superset", h = "expected #{this} to be " + u + " of #{exp}", p = "expected #{this} to not be " + u + " of #{exp}") : (u = c ? "ordered members" : "members", h = "expected #{this} to have the same " + u + " as #{exp}", p = "expected #{this} to not have the same " + u + " as #{exp}");
|
|
2069
|
-
var b = f(this, "deep") ? f(this, "eql") : void 0;
|
|
2070
|
-
this.assert(
|
|
2071
|
-
Cn(e, n, b, a, c),
|
|
2072
|
-
h,
|
|
2073
|
-
p,
|
|
2074
|
-
e,
|
|
2075
|
-
n,
|
|
2076
|
-
!0
|
|
2077
|
-
);
|
|
2078
|
-
});
|
|
2079
|
-
i.addProperty("iterable", function(e) {
|
|
2080
|
-
e && f(this, "message", e);
|
|
2081
|
-
var t = f(this, "object");
|
|
2082
|
-
this.assert(
|
|
2083
|
-
t != null && t[Symbol.iterator],
|
|
2084
|
-
"expected #{this} to be an iterable",
|
|
2085
|
-
"expected #{this} to not be an iterable",
|
|
2086
|
-
t
|
|
2087
|
-
);
|
|
2088
|
-
});
|
|
2089
|
-
function Dn(e, t) {
|
|
2090
|
-
t && f(this, "message", t);
|
|
2091
|
-
var n = f(this, "object"), r = f(this, "message"), o = f(this, "ssfi"), a = f(this, "contains"), c = f(this, "deep"), u = f(this, "eql");
|
|
2092
|
-
new i(e, r, o, !0).to.be.an("array"), a ? this.assert(
|
|
2093
|
-
e.some(function(h) {
|
|
2094
|
-
return n.indexOf(h) > -1;
|
|
2095
|
-
}),
|
|
2096
|
-
"expected #{this} to contain one of #{exp}",
|
|
2097
|
-
"expected #{this} to not contain one of #{exp}",
|
|
2098
|
-
e,
|
|
2099
|
-
n
|
|
2100
|
-
) : c ? this.assert(
|
|
2101
|
-
e.some(function(h) {
|
|
2102
|
-
return u(n, h);
|
|
2103
|
-
}),
|
|
2104
|
-
"expected #{this} to deeply equal one of #{exp}",
|
|
2105
|
-
"expected #{this} to deeply equal one of #{exp}",
|
|
2106
|
-
e,
|
|
2107
|
-
n
|
|
2108
|
-
) : this.assert(
|
|
2109
|
-
e.indexOf(n) > -1,
|
|
2110
|
-
"expected #{this} to be one of #{exp}",
|
|
2111
|
-
"expected #{this} to not be one of #{exp}",
|
|
2112
|
-
e,
|
|
2113
|
-
n
|
|
2114
|
-
);
|
|
2115
|
-
}
|
|
2116
|
-
l(Dn, "oneOf");
|
|
2117
|
-
i.addMethod("oneOf", Dn);
|
|
2118
|
-
function At(e, t, n) {
|
|
2119
|
-
n && f(this, "message", n);
|
|
2120
|
-
var r = f(this, "object"), o = f(this, "message"), a = f(this, "ssfi");
|
|
2121
|
-
new i(r, o, a, !0).is.a("function");
|
|
2122
|
-
var c;
|
|
2123
|
-
t ? (new i(e, o, a, !0).to.have.property(t), c = e[t]) : (new i(e, o, a, !0).is.a("function"), c = e()), r();
|
|
2124
|
-
var u = t == null ? e() : e[t], h = t == null ? c : "." + t;
|
|
2125
|
-
f(this, "deltaMsgObj", h), f(this, "initialDeltaValue", c), f(this, "finalDeltaValue", u), f(this, "deltaBehavior", "change"), f(this, "realDelta", u !== c), this.assert(
|
|
2126
|
-
c !== u,
|
|
2127
|
-
"expected " + h + " to change",
|
|
2128
|
-
"expected " + h + " to not change"
|
|
2129
|
-
);
|
|
2130
|
-
}
|
|
2131
|
-
l(At, "assertChanges");
|
|
2132
|
-
i.addMethod("change", At);
|
|
2133
|
-
i.addMethod("changes", At);
|
|
2134
|
-
function Tt(e, t, n) {
|
|
2135
|
-
n && f(this, "message", n);
|
|
2136
|
-
var r = f(this, "object"), o = f(this, "message"), a = f(this, "ssfi");
|
|
2137
|
-
new i(r, o, a, !0).is.a("function");
|
|
2138
|
-
var c;
|
|
2139
|
-
t ? (new i(e, o, a, !0).to.have.property(t), c = e[t]) : (new i(e, o, a, !0).is.a("function"), c = e()), new i(c, o, a, !0).is.a("number"), r();
|
|
2140
|
-
var u = t == null ? e() : e[t], h = t == null ? c : "." + t;
|
|
2141
|
-
f(this, "deltaMsgObj", h), f(this, "initialDeltaValue", c), f(this, "finalDeltaValue", u), f(this, "deltaBehavior", "increase"), f(this, "realDelta", u - c), this.assert(
|
|
2142
|
-
u - c > 0,
|
|
2143
|
-
"expected " + h + " to increase",
|
|
2144
|
-
"expected " + h + " to not increase"
|
|
2145
|
-
);
|
|
2146
|
-
}
|
|
2147
|
-
l(Tt, "assertIncreases");
|
|
2148
|
-
i.addMethod("increase", Tt);
|
|
2149
|
-
i.addMethod("increases", Tt);
|
|
2150
|
-
function It(e, t, n) {
|
|
2151
|
-
n && f(this, "message", n);
|
|
2152
|
-
var r = f(this, "object"), o = f(this, "message"), a = f(this, "ssfi");
|
|
2153
|
-
new i(r, o, a, !0).is.a("function");
|
|
2154
|
-
var c;
|
|
2155
|
-
t ? (new i(e, o, a, !0).to.have.property(t), c = e[t]) : (new i(e, o, a, !0).is.a("function"), c = e()), new i(c, o, a, !0).is.a("number"), r();
|
|
2156
|
-
var u = t == null ? e() : e[t], h = t == null ? c : "." + t;
|
|
2157
|
-
f(this, "deltaMsgObj", h), f(this, "initialDeltaValue", c), f(this, "finalDeltaValue", u), f(this, "deltaBehavior", "decrease"), f(this, "realDelta", c - u), this.assert(
|
|
2158
|
-
u - c < 0,
|
|
2159
|
-
"expected " + h + " to decrease",
|
|
2160
|
-
"expected " + h + " to not decrease"
|
|
2161
|
-
);
|
|
2162
|
-
}
|
|
2163
|
-
l(It, "assertDecreases");
|
|
2164
|
-
i.addMethod("decrease", It);
|
|
2165
|
-
i.addMethod("decreases", It);
|
|
2166
|
-
function $n(e, t) {
|
|
2167
|
-
t && f(this, "message", t);
|
|
2168
|
-
var n = f(this, "deltaMsgObj"), r = f(this, "initialDeltaValue"), o = f(this, "finalDeltaValue"), a = f(this, "deltaBehavior"), c = f(this, "realDelta"), u;
|
|
2169
|
-
a === "change" ? u = Math.abs(o - r) === Math.abs(e) : u = c === Math.abs(e), this.assert(
|
|
2170
|
-
u,
|
|
2171
|
-
"expected " + n + " to " + a + " by " + e,
|
|
2172
|
-
"expected " + n + " to not " + a + " by " + e
|
|
2173
|
-
);
|
|
2174
|
-
}
|
|
2175
|
-
l($n, "assertDelta");
|
|
2176
|
-
i.addMethod("by", $n);
|
|
2177
|
-
i.addProperty("extensible", function() {
|
|
2178
|
-
var e = f(this, "object"), t = e === Object(e) && Object.isExtensible(e);
|
|
2179
|
-
this.assert(
|
|
2180
|
-
t,
|
|
2181
|
-
"expected #{this} to be extensible",
|
|
2182
|
-
"expected #{this} to not be extensible"
|
|
2183
|
-
);
|
|
2184
|
-
});
|
|
2185
|
-
i.addProperty("sealed", function() {
|
|
2186
|
-
var e = f(this, "object"), t = e === Object(e) ? Object.isSealed(e) : !0;
|
|
2187
|
-
this.assert(
|
|
2188
|
-
t,
|
|
2189
|
-
"expected #{this} to be sealed",
|
|
2190
|
-
"expected #{this} to not be sealed"
|
|
2191
|
-
);
|
|
2192
|
-
});
|
|
2193
|
-
i.addProperty("frozen", function() {
|
|
2194
|
-
var e = f(this, "object"), t = e === Object(e) ? Object.isFrozen(e) : !0;
|
|
2195
|
-
this.assert(
|
|
2196
|
-
t,
|
|
2197
|
-
"expected #{this} to be frozen",
|
|
2198
|
-
"expected #{this} to not be frozen"
|
|
2199
|
-
);
|
|
2200
|
-
});
|
|
2201
|
-
i.addProperty("finite", function(e) {
|
|
2202
|
-
var t = f(this, "object");
|
|
2203
|
-
this.assert(
|
|
2204
|
-
typeof t == "number" && isFinite(t),
|
|
2205
|
-
"expected #{this} to be a finite number",
|
|
2206
|
-
"expected #{this} to not be a finite number"
|
|
2207
|
-
);
|
|
2208
|
-
});
|
|
2209
|
-
function k(e, t) {
|
|
2210
|
-
return new i(e, t);
|
|
2211
|
-
}
|
|
2212
|
-
l(k, "expect");
|
|
2213
|
-
k.fail = function(e, t, n, r) {
|
|
2214
|
-
throw arguments.length < 2 && (n = e, e = void 0), n = n || "expect.fail()", new E(n, {
|
|
2215
|
-
actual: e,
|
|
2216
|
-
expected: t,
|
|
2217
|
-
operator: r
|
|
2218
|
-
}, k.fail);
|
|
2219
|
-
};
|
|
2220
|
-
var _n = {};
|
|
2221
|
-
Xe(_n, {
|
|
2222
|
-
Should: () => ar,
|
|
2223
|
-
should: () => ir
|
|
2224
|
-
});
|
|
2225
|
-
function Ct() {
|
|
2226
|
-
function e() {
|
|
2227
|
-
return this instanceof String || this instanceof Number || this instanceof Boolean || typeof Symbol == "function" && this instanceof Symbol || typeof BigInt == "function" && this instanceof BigInt ? new i(this.valueOf(), null, e) : new i(this, null, e);
|
|
2228
|
-
}
|
|
2229
|
-
l(e, "shouldGetter");
|
|
2230
|
-
function t(r) {
|
|
2231
|
-
Object.defineProperty(this, "should", {
|
|
2232
|
-
value: r,
|
|
2233
|
-
enumerable: !0,
|
|
2234
|
-
configurable: !0,
|
|
2235
|
-
writable: !0
|
|
2236
|
-
});
|
|
2237
|
-
}
|
|
2238
|
-
l(t, "shouldSetter"), Object.defineProperty(Object.prototype, "should", {
|
|
2239
|
-
set: t,
|
|
2240
|
-
get: e,
|
|
2241
|
-
configurable: !0
|
|
2242
|
-
});
|
|
2243
|
-
var n = {};
|
|
2244
|
-
return n.fail = function(r, o, a, c) {
|
|
2245
|
-
throw arguments.length < 2 && (a = r, r = void 0), a = a || "should.fail()", new E(a, {
|
|
2246
|
-
actual: r,
|
|
2247
|
-
expected: o,
|
|
2248
|
-
operator: c
|
|
2249
|
-
}, n.fail);
|
|
2250
|
-
}, n.equal = function(r, o, a) {
|
|
2251
|
-
new i(r, a).to.equal(o);
|
|
2252
|
-
}, n.Throw = function(r, o, a, c) {
|
|
2253
|
-
new i(r, c).to.Throw(o, a);
|
|
2254
|
-
}, n.exist = function(r, o) {
|
|
2255
|
-
new i(r, o).to.exist;
|
|
2256
|
-
}, n.not = {}, n.not.equal = function(r, o, a) {
|
|
2257
|
-
new i(r, a).to.not.equal(o);
|
|
2258
|
-
}, n.not.Throw = function(r, o, a, c) {
|
|
2259
|
-
new i(r, c).to.not.Throw(o, a);
|
|
2260
|
-
}, n.not.exist = function(r, o) {
|
|
2261
|
-
new i(r, o).to.not.exist;
|
|
2262
|
-
}, n.throw = n.Throw, n.not.throw = n.not.Throw, n;
|
|
2263
|
-
}
|
|
2264
|
-
l(Ct, "loadShould");
|
|
2265
|
-
var ir = Ct, ar = Ct;
|
|
2266
|
-
function s(e, t) {
|
|
2267
|
-
var n = new i(null, null, s, !0);
|
|
2268
|
-
n.assert(
|
|
2269
|
-
e,
|
|
2270
|
-
t,
|
|
2271
|
-
"[ negation message unavailable ]"
|
|
2272
|
-
);
|
|
2273
|
-
}
|
|
2274
|
-
l(s, "assert");
|
|
2275
|
-
s.fail = function(e, t, n, r) {
|
|
2276
|
-
throw arguments.length < 2 && (n = e, e = void 0), n = n || "assert.fail()", new E(n, {
|
|
2277
|
-
actual: e,
|
|
2278
|
-
expected: t,
|
|
2279
|
-
operator: r
|
|
2280
|
-
}, s.fail);
|
|
2281
|
-
};
|
|
2282
|
-
s.isOk = function(e, t) {
|
|
2283
|
-
new i(e, t, s.isOk, !0).is.ok;
|
|
2284
|
-
};
|
|
2285
|
-
s.isNotOk = function(e, t) {
|
|
2286
|
-
new i(e, t, s.isNotOk, !0).is.not.ok;
|
|
2287
|
-
};
|
|
2288
|
-
s.equal = function(e, t, n) {
|
|
2289
|
-
var r = new i(e, n, s.equal, !0);
|
|
2290
|
-
r.assert(
|
|
2291
|
-
t == v(r, "object"),
|
|
2292
|
-
"expected #{this} to equal #{exp}",
|
|
2293
|
-
"expected #{this} to not equal #{act}",
|
|
2294
|
-
t,
|
|
2295
|
-
e,
|
|
2296
|
-
!0
|
|
2297
|
-
);
|
|
2298
|
-
};
|
|
2299
|
-
s.notEqual = function(e, t, n) {
|
|
2300
|
-
var r = new i(e, n, s.notEqual, !0);
|
|
2301
|
-
r.assert(
|
|
2302
|
-
t != v(r, "object"),
|
|
2303
|
-
"expected #{this} to not equal #{exp}",
|
|
2304
|
-
"expected #{this} to equal #{act}",
|
|
2305
|
-
t,
|
|
2306
|
-
e,
|
|
2307
|
-
!0
|
|
2308
|
-
);
|
|
2309
|
-
};
|
|
2310
|
-
s.strictEqual = function(e, t, n) {
|
|
2311
|
-
new i(e, n, s.strictEqual, !0).to.equal(t);
|
|
2312
|
-
};
|
|
2313
|
-
s.notStrictEqual = function(e, t, n) {
|
|
2314
|
-
new i(e, n, s.notStrictEqual, !0).to.not.equal(t);
|
|
2315
|
-
};
|
|
2316
|
-
s.deepEqual = s.deepStrictEqual = function(e, t, n) {
|
|
2317
|
-
new i(e, n, s.deepEqual, !0).to.eql(t);
|
|
2318
|
-
};
|
|
2319
|
-
s.notDeepEqual = function(e, t, n) {
|
|
2320
|
-
new i(e, n, s.notDeepEqual, !0).to.not.eql(t);
|
|
2321
|
-
};
|
|
2322
|
-
s.isAbove = function(e, t, n) {
|
|
2323
|
-
new i(e, n, s.isAbove, !0).to.be.above(t);
|
|
2324
|
-
};
|
|
2325
|
-
s.isAtLeast = function(e, t, n) {
|
|
2326
|
-
new i(e, n, s.isAtLeast, !0).to.be.least(t);
|
|
2327
|
-
};
|
|
2328
|
-
s.isBelow = function(e, t, n) {
|
|
2329
|
-
new i(e, n, s.isBelow, !0).to.be.below(t);
|
|
2330
|
-
};
|
|
2331
|
-
s.isAtMost = function(e, t, n) {
|
|
2332
|
-
new i(e, n, s.isAtMost, !0).to.be.most(t);
|
|
2333
|
-
};
|
|
2334
|
-
s.isTrue = function(e, t) {
|
|
2335
|
-
new i(e, t, s.isTrue, !0).is.true;
|
|
2336
|
-
};
|
|
2337
|
-
s.isNotTrue = function(e, t) {
|
|
2338
|
-
new i(e, t, s.isNotTrue, !0).to.not.equal(!0);
|
|
2339
|
-
};
|
|
2340
|
-
s.isFalse = function(e, t) {
|
|
2341
|
-
new i(e, t, s.isFalse, !0).is.false;
|
|
2342
|
-
};
|
|
2343
|
-
s.isNotFalse = function(e, t) {
|
|
2344
|
-
new i(e, t, s.isNotFalse, !0).to.not.equal(!1);
|
|
2345
|
-
};
|
|
2346
|
-
s.isNull = function(e, t) {
|
|
2347
|
-
new i(e, t, s.isNull, !0).to.equal(null);
|
|
2348
|
-
};
|
|
2349
|
-
s.isNotNull = function(e, t) {
|
|
2350
|
-
new i(e, t, s.isNotNull, !0).to.not.equal(null);
|
|
2351
|
-
};
|
|
2352
|
-
s.isNaN = function(e, t) {
|
|
2353
|
-
new i(e, t, s.isNaN, !0).to.be.NaN;
|
|
2354
|
-
};
|
|
2355
|
-
s.isNotNaN = function(e, t) {
|
|
2356
|
-
new i(e, t, s.isNotNaN, !0).not.to.be.NaN;
|
|
2357
|
-
};
|
|
2358
|
-
s.exists = function(e, t) {
|
|
2359
|
-
new i(e, t, s.exists, !0).to.exist;
|
|
2360
|
-
};
|
|
2361
|
-
s.notExists = function(e, t) {
|
|
2362
|
-
new i(e, t, s.notExists, !0).to.not.exist;
|
|
2363
|
-
};
|
|
2364
|
-
s.isUndefined = function(e, t) {
|
|
2365
|
-
new i(e, t, s.isUndefined, !0).to.equal(void 0);
|
|
2366
|
-
};
|
|
2367
|
-
s.isDefined = function(e, t) {
|
|
2368
|
-
new i(e, t, s.isDefined, !0).to.not.equal(void 0);
|
|
2369
|
-
};
|
|
2370
|
-
s.isCallable = function(e, t) {
|
|
2371
|
-
new i(e, t, s.isCallable, !0).is.callable;
|
|
2372
|
-
};
|
|
2373
|
-
s.isNotCallable = function(e, t) {
|
|
2374
|
-
new i(e, t, s.isNotCallable, !0).is.not.callable;
|
|
2375
|
-
};
|
|
2376
|
-
s.isObject = function(e, t) {
|
|
2377
|
-
new i(e, t, s.isObject, !0).to.be.a("object");
|
|
2378
|
-
};
|
|
2379
|
-
s.isNotObject = function(e, t) {
|
|
2380
|
-
new i(e, t, s.isNotObject, !0).to.not.be.a("object");
|
|
2381
|
-
};
|
|
2382
|
-
s.isArray = function(e, t) {
|
|
2383
|
-
new i(e, t, s.isArray, !0).to.be.an("array");
|
|
2384
|
-
};
|
|
2385
|
-
s.isNotArray = function(e, t) {
|
|
2386
|
-
new i(e, t, s.isNotArray, !0).to.not.be.an("array");
|
|
2387
|
-
};
|
|
2388
|
-
s.isString = function(e, t) {
|
|
2389
|
-
new i(e, t, s.isString, !0).to.be.a("string");
|
|
2390
|
-
};
|
|
2391
|
-
s.isNotString = function(e, t) {
|
|
2392
|
-
new i(e, t, s.isNotString, !0).to.not.be.a("string");
|
|
2393
|
-
};
|
|
2394
|
-
s.isNumber = function(e, t) {
|
|
2395
|
-
new i(e, t, s.isNumber, !0).to.be.a("number");
|
|
2396
|
-
};
|
|
2397
|
-
s.isNotNumber = function(e, t) {
|
|
2398
|
-
new i(e, t, s.isNotNumber, !0).to.not.be.a("number");
|
|
2399
|
-
};
|
|
2400
|
-
s.isNumeric = function(e, t) {
|
|
2401
|
-
new i(e, t, s.isNumeric, !0).is.numeric;
|
|
2402
|
-
};
|
|
2403
|
-
s.isNotNumeric = function(e, t) {
|
|
2404
|
-
new i(e, t, s.isNotNumeric, !0).is.not.numeric;
|
|
2405
|
-
};
|
|
2406
|
-
s.isFinite = function(e, t) {
|
|
2407
|
-
new i(e, t, s.isFinite, !0).to.be.finite;
|
|
2408
|
-
};
|
|
2409
|
-
s.isBoolean = function(e, t) {
|
|
2410
|
-
new i(e, t, s.isBoolean, !0).to.be.a("boolean");
|
|
2411
|
-
};
|
|
2412
|
-
s.isNotBoolean = function(e, t) {
|
|
2413
|
-
new i(e, t, s.isNotBoolean, !0).to.not.be.a("boolean");
|
|
2414
|
-
};
|
|
2415
|
-
s.typeOf = function(e, t, n) {
|
|
2416
|
-
new i(e, n, s.typeOf, !0).to.be.a(t);
|
|
2417
|
-
};
|
|
2418
|
-
s.notTypeOf = function(e, t, n) {
|
|
2419
|
-
new i(e, n, s.notTypeOf, !0).to.not.be.a(t);
|
|
2420
|
-
};
|
|
2421
|
-
s.instanceOf = function(e, t, n) {
|
|
2422
|
-
new i(e, n, s.instanceOf, !0).to.be.instanceOf(t);
|
|
2423
|
-
};
|
|
2424
|
-
s.notInstanceOf = function(e, t, n) {
|
|
2425
|
-
new i(e, n, s.notInstanceOf, !0).to.not.be.instanceOf(t);
|
|
2426
|
-
};
|
|
2427
|
-
s.include = function(e, t, n) {
|
|
2428
|
-
new i(e, n, s.include, !0).include(t);
|
|
2429
|
-
};
|
|
2430
|
-
s.notInclude = function(e, t, n) {
|
|
2431
|
-
new i(e, n, s.notInclude, !0).not.include(t);
|
|
2432
|
-
};
|
|
2433
|
-
s.deepInclude = function(e, t, n) {
|
|
2434
|
-
new i(e, n, s.deepInclude, !0).deep.include(t);
|
|
2435
|
-
};
|
|
2436
|
-
s.notDeepInclude = function(e, t, n) {
|
|
2437
|
-
new i(e, n, s.notDeepInclude, !0).not.deep.include(t);
|
|
2438
|
-
};
|
|
2439
|
-
s.nestedInclude = function(e, t, n) {
|
|
2440
|
-
new i(e, n, s.nestedInclude, !0).nested.include(t);
|
|
2441
|
-
};
|
|
2442
|
-
s.notNestedInclude = function(e, t, n) {
|
|
2443
|
-
new i(e, n, s.notNestedInclude, !0).not.nested.include(t);
|
|
2444
|
-
};
|
|
2445
|
-
s.deepNestedInclude = function(e, t, n) {
|
|
2446
|
-
new i(e, n, s.deepNestedInclude, !0).deep.nested.include(t);
|
|
2447
|
-
};
|
|
2448
|
-
s.notDeepNestedInclude = function(e, t, n) {
|
|
2449
|
-
new i(e, n, s.notDeepNestedInclude, !0).not.deep.nested.include(t);
|
|
2450
|
-
};
|
|
2451
|
-
s.ownInclude = function(e, t, n) {
|
|
2452
|
-
new i(e, n, s.ownInclude, !0).own.include(t);
|
|
2453
|
-
};
|
|
2454
|
-
s.notOwnInclude = function(e, t, n) {
|
|
2455
|
-
new i(e, n, s.notOwnInclude, !0).not.own.include(t);
|
|
2456
|
-
};
|
|
2457
|
-
s.deepOwnInclude = function(e, t, n) {
|
|
2458
|
-
new i(e, n, s.deepOwnInclude, !0).deep.own.include(t);
|
|
2459
|
-
};
|
|
2460
|
-
s.notDeepOwnInclude = function(e, t, n) {
|
|
2461
|
-
new i(e, n, s.notDeepOwnInclude, !0).not.deep.own.include(t);
|
|
2462
|
-
};
|
|
2463
|
-
s.match = function(e, t, n) {
|
|
2464
|
-
new i(e, n, s.match, !0).to.match(t);
|
|
2465
|
-
};
|
|
2466
|
-
s.notMatch = function(e, t, n) {
|
|
2467
|
-
new i(e, n, s.notMatch, !0).to.not.match(t);
|
|
2468
|
-
};
|
|
2469
|
-
s.property = function(e, t, n) {
|
|
2470
|
-
new i(e, n, s.property, !0).to.have.property(t);
|
|
2471
|
-
};
|
|
2472
|
-
s.notProperty = function(e, t, n) {
|
|
2473
|
-
new i(e, n, s.notProperty, !0).to.not.have.property(t);
|
|
2474
|
-
};
|
|
2475
|
-
s.propertyVal = function(e, t, n, r) {
|
|
2476
|
-
new i(e, r, s.propertyVal, !0).to.have.property(t, n);
|
|
2477
|
-
};
|
|
2478
|
-
s.notPropertyVal = function(e, t, n, r) {
|
|
2479
|
-
new i(e, r, s.notPropertyVal, !0).to.not.have.property(t, n);
|
|
2480
|
-
};
|
|
2481
|
-
s.deepPropertyVal = function(e, t, n, r) {
|
|
2482
|
-
new i(e, r, s.deepPropertyVal, !0).to.have.deep.property(t, n);
|
|
2483
|
-
};
|
|
2484
|
-
s.notDeepPropertyVal = function(e, t, n, r) {
|
|
2485
|
-
new i(e, r, s.notDeepPropertyVal, !0).to.not.have.deep.property(t, n);
|
|
2486
|
-
};
|
|
2487
|
-
s.ownProperty = function(e, t, n) {
|
|
2488
|
-
new i(e, n, s.ownProperty, !0).to.have.own.property(t);
|
|
2489
|
-
};
|
|
2490
|
-
s.notOwnProperty = function(e, t, n) {
|
|
2491
|
-
new i(e, n, s.notOwnProperty, !0).to.not.have.own.property(t);
|
|
2492
|
-
};
|
|
2493
|
-
s.ownPropertyVal = function(e, t, n, r) {
|
|
2494
|
-
new i(e, r, s.ownPropertyVal, !0).to.have.own.property(t, n);
|
|
2495
|
-
};
|
|
2496
|
-
s.notOwnPropertyVal = function(e, t, n, r) {
|
|
2497
|
-
new i(e, r, s.notOwnPropertyVal, !0).to.not.have.own.property(t, n);
|
|
2498
|
-
};
|
|
2499
|
-
s.deepOwnPropertyVal = function(e, t, n, r) {
|
|
2500
|
-
new i(e, r, s.deepOwnPropertyVal, !0).to.have.deep.own.property(t, n);
|
|
2501
|
-
};
|
|
2502
|
-
s.notDeepOwnPropertyVal = function(e, t, n, r) {
|
|
2503
|
-
new i(e, r, s.notDeepOwnPropertyVal, !0).to.not.have.deep.own.property(t, n);
|
|
2504
|
-
};
|
|
2505
|
-
s.nestedProperty = function(e, t, n) {
|
|
2506
|
-
new i(e, n, s.nestedProperty, !0).to.have.nested.property(t);
|
|
2507
|
-
};
|
|
2508
|
-
s.notNestedProperty = function(e, t, n) {
|
|
2509
|
-
new i(e, n, s.notNestedProperty, !0).to.not.have.nested.property(t);
|
|
2510
|
-
};
|
|
2511
|
-
s.nestedPropertyVal = function(e, t, n, r) {
|
|
2512
|
-
new i(e, r, s.nestedPropertyVal, !0).to.have.nested.property(t, n);
|
|
2513
|
-
};
|
|
2514
|
-
s.notNestedPropertyVal = function(e, t, n, r) {
|
|
2515
|
-
new i(e, r, s.notNestedPropertyVal, !0).to.not.have.nested.property(t, n);
|
|
2516
|
-
};
|
|
2517
|
-
s.deepNestedPropertyVal = function(e, t, n, r) {
|
|
2518
|
-
new i(e, r, s.deepNestedPropertyVal, !0).to.have.deep.nested.property(t, n);
|
|
2519
|
-
};
|
|
2520
|
-
s.notDeepNestedPropertyVal = function(e, t, n, r) {
|
|
2521
|
-
new i(e, r, s.notDeepNestedPropertyVal, !0).to.not.have.deep.nested.property(t, n);
|
|
2522
|
-
};
|
|
2523
|
-
s.lengthOf = function(e, t, n) {
|
|
2524
|
-
new i(e, n, s.lengthOf, !0).to.have.lengthOf(t);
|
|
2525
|
-
};
|
|
2526
|
-
s.hasAnyKeys = function(e, t, n) {
|
|
2527
|
-
new i(e, n, s.hasAnyKeys, !0).to.have.any.keys(t);
|
|
2528
|
-
};
|
|
2529
|
-
s.hasAllKeys = function(e, t, n) {
|
|
2530
|
-
new i(e, n, s.hasAllKeys, !0).to.have.all.keys(t);
|
|
2531
|
-
};
|
|
2532
|
-
s.containsAllKeys = function(e, t, n) {
|
|
2533
|
-
new i(e, n, s.containsAllKeys, !0).to.contain.all.keys(t);
|
|
2534
|
-
};
|
|
2535
|
-
s.doesNotHaveAnyKeys = function(e, t, n) {
|
|
2536
|
-
new i(e, n, s.doesNotHaveAnyKeys, !0).to.not.have.any.keys(t);
|
|
2537
|
-
};
|
|
2538
|
-
s.doesNotHaveAllKeys = function(e, t, n) {
|
|
2539
|
-
new i(e, n, s.doesNotHaveAllKeys, !0).to.not.have.all.keys(t);
|
|
2540
|
-
};
|
|
2541
|
-
s.hasAnyDeepKeys = function(e, t, n) {
|
|
2542
|
-
new i(e, n, s.hasAnyDeepKeys, !0).to.have.any.deep.keys(t);
|
|
2543
|
-
};
|
|
2544
|
-
s.hasAllDeepKeys = function(e, t, n) {
|
|
2545
|
-
new i(e, n, s.hasAllDeepKeys, !0).to.have.all.deep.keys(t);
|
|
2546
|
-
};
|
|
2547
|
-
s.containsAllDeepKeys = function(e, t, n) {
|
|
2548
|
-
new i(e, n, s.containsAllDeepKeys, !0).to.contain.all.deep.keys(t);
|
|
2549
|
-
};
|
|
2550
|
-
s.doesNotHaveAnyDeepKeys = function(e, t, n) {
|
|
2551
|
-
new i(e, n, s.doesNotHaveAnyDeepKeys, !0).to.not.have.any.deep.keys(t);
|
|
2552
|
-
};
|
|
2553
|
-
s.doesNotHaveAllDeepKeys = function(e, t, n) {
|
|
2554
|
-
new i(e, n, s.doesNotHaveAllDeepKeys, !0).to.not.have.all.deep.keys(t);
|
|
2555
|
-
};
|
|
2556
|
-
s.throws = function(e, t, n, r) {
|
|
2557
|
-
(typeof t == "string" || t instanceof RegExp) && (n = t, t = null);
|
|
2558
|
-
var o = new i(e, r, s.throws, !0).to.throw(t, n);
|
|
2559
|
-
return v(o, "object");
|
|
2560
|
-
};
|
|
2561
|
-
s.doesNotThrow = function(e, t, n, r) {
|
|
2562
|
-
(typeof t == "string" || t instanceof RegExp) && (n = t, t = null), new i(e, r, s.doesNotThrow, !0).to.not.throw(t, n);
|
|
2563
|
-
};
|
|
2564
|
-
s.operator = function(e, t, n, r) {
|
|
2565
|
-
var o;
|
|
2566
|
-
switch (t) {
|
|
2567
|
-
case "==":
|
|
2568
|
-
o = e == n;
|
|
2569
|
-
break;
|
|
2570
|
-
case "===":
|
|
2571
|
-
o = e === n;
|
|
2572
|
-
break;
|
|
2573
|
-
case ">":
|
|
2574
|
-
o = e > n;
|
|
2575
|
-
break;
|
|
2576
|
-
case ">=":
|
|
2577
|
-
o = e >= n;
|
|
2578
|
-
break;
|
|
2579
|
-
case "<":
|
|
2580
|
-
o = e < n;
|
|
2581
|
-
break;
|
|
2582
|
-
case "<=":
|
|
2583
|
-
o = e <= n;
|
|
2584
|
-
break;
|
|
2585
|
-
case "!=":
|
|
2586
|
-
o = e != n;
|
|
2587
|
-
break;
|
|
2588
|
-
case "!==":
|
|
2589
|
-
o = e !== n;
|
|
2590
|
-
break;
|
|
2591
|
-
default:
|
|
2592
|
-
throw r = r && r + ": ", new E(
|
|
2593
|
-
r + 'Invalid operator "' + t + '"',
|
|
2594
|
-
void 0,
|
|
2595
|
-
s.operator
|
|
2596
|
-
);
|
|
2597
|
-
}
|
|
2598
|
-
var a = new i(o, r, s.operator, !0);
|
|
2599
|
-
a.assert(
|
|
2600
|
-
v(a, "object") === !0,
|
|
2601
|
-
"expected " + S(e) + " to be " + t + " " + S(n),
|
|
2602
|
-
"expected " + S(e) + " to not be " + t + " " + S(n)
|
|
2603
|
-
);
|
|
2604
|
-
};
|
|
2605
|
-
s.closeTo = function(e, t, n, r) {
|
|
2606
|
-
new i(e, r, s.closeTo, !0).to.be.closeTo(t, n);
|
|
2607
|
-
};
|
|
2608
|
-
s.approximately = function(e, t, n, r) {
|
|
2609
|
-
new i(e, r, s.approximately, !0).to.be.approximately(t, n);
|
|
2610
|
-
};
|
|
2611
|
-
s.sameMembers = function(e, t, n) {
|
|
2612
|
-
new i(e, n, s.sameMembers, !0).to.have.same.members(t);
|
|
2613
|
-
};
|
|
2614
|
-
s.notSameMembers = function(e, t, n) {
|
|
2615
|
-
new i(e, n, s.notSameMembers, !0).to.not.have.same.members(t);
|
|
2616
|
-
};
|
|
2617
|
-
s.sameDeepMembers = function(e, t, n) {
|
|
2618
|
-
new i(e, n, s.sameDeepMembers, !0).to.have.same.deep.members(t);
|
|
2619
|
-
};
|
|
2620
|
-
s.notSameDeepMembers = function(e, t, n) {
|
|
2621
|
-
new i(e, n, s.notSameDeepMembers, !0).to.not.have.same.deep.members(t);
|
|
2622
|
-
};
|
|
2623
|
-
s.sameOrderedMembers = function(e, t, n) {
|
|
2624
|
-
new i(e, n, s.sameOrderedMembers, !0).to.have.same.ordered.members(t);
|
|
2625
|
-
};
|
|
2626
|
-
s.notSameOrderedMembers = function(e, t, n) {
|
|
2627
|
-
new i(e, n, s.notSameOrderedMembers, !0).to.not.have.same.ordered.members(t);
|
|
2628
|
-
};
|
|
2629
|
-
s.sameDeepOrderedMembers = function(e, t, n) {
|
|
2630
|
-
new i(e, n, s.sameDeepOrderedMembers, !0).to.have.same.deep.ordered.members(t);
|
|
2631
|
-
};
|
|
2632
|
-
s.notSameDeepOrderedMembers = function(e, t, n) {
|
|
2633
|
-
new i(e, n, s.notSameDeepOrderedMembers, !0).to.not.have.same.deep.ordered.members(t);
|
|
2634
|
-
};
|
|
2635
|
-
s.includeMembers = function(e, t, n) {
|
|
2636
|
-
new i(e, n, s.includeMembers, !0).to.include.members(t);
|
|
2637
|
-
};
|
|
2638
|
-
s.notIncludeMembers = function(e, t, n) {
|
|
2639
|
-
new i(e, n, s.notIncludeMembers, !0).to.not.include.members(t);
|
|
2640
|
-
};
|
|
2641
|
-
s.includeDeepMembers = function(e, t, n) {
|
|
2642
|
-
new i(e, n, s.includeDeepMembers, !0).to.include.deep.members(t);
|
|
2643
|
-
};
|
|
2644
|
-
s.notIncludeDeepMembers = function(e, t, n) {
|
|
2645
|
-
new i(e, n, s.notIncludeDeepMembers, !0).to.not.include.deep.members(t);
|
|
2646
|
-
};
|
|
2647
|
-
s.includeOrderedMembers = function(e, t, n) {
|
|
2648
|
-
new i(e, n, s.includeOrderedMembers, !0).to.include.ordered.members(t);
|
|
2649
|
-
};
|
|
2650
|
-
s.notIncludeOrderedMembers = function(e, t, n) {
|
|
2651
|
-
new i(e, n, s.notIncludeOrderedMembers, !0).to.not.include.ordered.members(t);
|
|
2652
|
-
};
|
|
2653
|
-
s.includeDeepOrderedMembers = function(e, t, n) {
|
|
2654
|
-
new i(e, n, s.includeDeepOrderedMembers, !0).to.include.deep.ordered.members(t);
|
|
2655
|
-
};
|
|
2656
|
-
s.notIncludeDeepOrderedMembers = function(e, t, n) {
|
|
2657
|
-
new i(e, n, s.notIncludeDeepOrderedMembers, !0).to.not.include.deep.ordered.members(t);
|
|
2658
|
-
};
|
|
2659
|
-
s.oneOf = function(e, t, n) {
|
|
2660
|
-
new i(e, n, s.oneOf, !0).to.be.oneOf(t);
|
|
2661
|
-
};
|
|
2662
|
-
s.isIterable = function(e, t) {
|
|
2663
|
-
if (e == null || !e[Symbol.iterator])
|
|
2664
|
-
throw t = t ? `${t} expected ${S(e)} to be an iterable` : `expected ${S(e)} to be an iterable`, new E(
|
|
2665
|
-
t,
|
|
2666
|
-
void 0,
|
|
2667
|
-
s.isIterable
|
|
2668
|
-
);
|
|
2669
|
-
};
|
|
2670
|
-
s.changes = function(e, t, n, r) {
|
|
2671
|
-
arguments.length === 3 && typeof t == "function" && (r = n, n = null), new i(e, r, s.changes, !0).to.change(t, n);
|
|
2672
|
-
};
|
|
2673
|
-
s.changesBy = function(e, t, n, r, o) {
|
|
2674
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2675
|
-
var a = r;
|
|
2676
|
-
r = n, o = a;
|
|
2677
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2678
|
-
new i(e, o, s.changesBy, !0).to.change(t, n).by(r);
|
|
2679
|
-
};
|
|
2680
|
-
s.doesNotChange = function(e, t, n, r) {
|
|
2681
|
-
return arguments.length === 3 && typeof t == "function" && (r = n, n = null), new i(e, r, s.doesNotChange, !0).to.not.change(t, n);
|
|
2682
|
-
};
|
|
2683
|
-
s.changesButNotBy = function(e, t, n, r, o) {
|
|
2684
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2685
|
-
var a = r;
|
|
2686
|
-
r = n, o = a;
|
|
2687
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2688
|
-
new i(e, o, s.changesButNotBy, !0).to.change(t, n).but.not.by(r);
|
|
2689
|
-
};
|
|
2690
|
-
s.increases = function(e, t, n, r) {
|
|
2691
|
-
return arguments.length === 3 && typeof t == "function" && (r = n, n = null), new i(e, r, s.increases, !0).to.increase(t, n);
|
|
2692
|
-
};
|
|
2693
|
-
s.increasesBy = function(e, t, n, r, o) {
|
|
2694
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2695
|
-
var a = r;
|
|
2696
|
-
r = n, o = a;
|
|
2697
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2698
|
-
new i(e, o, s.increasesBy, !0).to.increase(t, n).by(r);
|
|
2699
|
-
};
|
|
2700
|
-
s.doesNotIncrease = function(e, t, n, r) {
|
|
2701
|
-
return arguments.length === 3 && typeof t == "function" && (r = n, n = null), new i(e, r, s.doesNotIncrease, !0).to.not.increase(t, n);
|
|
2702
|
-
};
|
|
2703
|
-
s.increasesButNotBy = function(e, t, n, r, o) {
|
|
2704
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2705
|
-
var a = r;
|
|
2706
|
-
r = n, o = a;
|
|
2707
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2708
|
-
new i(e, o, s.increasesButNotBy, !0).to.increase(t, n).but.not.by(r);
|
|
2709
|
-
};
|
|
2710
|
-
s.decreases = function(e, t, n, r) {
|
|
2711
|
-
return arguments.length === 3 && typeof t == "function" && (r = n, n = null), new i(e, r, s.decreases, !0).to.decrease(t, n);
|
|
2712
|
-
};
|
|
2713
|
-
s.decreasesBy = function(e, t, n, r, o) {
|
|
2714
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2715
|
-
var a = r;
|
|
2716
|
-
r = n, o = a;
|
|
2717
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2718
|
-
new i(e, o, s.decreasesBy, !0).to.decrease(t, n).by(r);
|
|
2719
|
-
};
|
|
2720
|
-
s.doesNotDecrease = function(e, t, n, r) {
|
|
2721
|
-
return arguments.length === 3 && typeof t == "function" && (r = n, n = null), new i(e, r, s.doesNotDecrease, !0).to.not.decrease(t, n);
|
|
2722
|
-
};
|
|
2723
|
-
s.doesNotDecreaseBy = function(e, t, n, r, o) {
|
|
2724
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2725
|
-
var a = r;
|
|
2726
|
-
r = n, o = a;
|
|
2727
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2728
|
-
return new i(e, o, s.doesNotDecreaseBy, !0).to.not.decrease(t, n).by(r);
|
|
2729
|
-
};
|
|
2730
|
-
s.decreasesButNotBy = function(e, t, n, r, o) {
|
|
2731
|
-
if (arguments.length === 4 && typeof t == "function") {
|
|
2732
|
-
var a = r;
|
|
2733
|
-
r = n, o = a;
|
|
2734
|
-
} else arguments.length === 3 && (r = n, n = null);
|
|
2735
|
-
new i(e, o, s.decreasesButNotBy, !0).to.decrease(t, n).but.not.by(r);
|
|
2736
|
-
};
|
|
2737
|
-
s.ifError = function(e) {
|
|
2738
|
-
if (e)
|
|
2739
|
-
throw e;
|
|
2740
|
-
};
|
|
2741
|
-
s.isExtensible = function(e, t) {
|
|
2742
|
-
new i(e, t, s.isExtensible, !0).to.be.extensible;
|
|
2743
|
-
};
|
|
2744
|
-
s.isNotExtensible = function(e, t) {
|
|
2745
|
-
new i(e, t, s.isNotExtensible, !0).to.not.be.extensible;
|
|
2746
|
-
};
|
|
2747
|
-
s.isSealed = function(e, t) {
|
|
2748
|
-
new i(e, t, s.isSealed, !0).to.be.sealed;
|
|
2749
|
-
};
|
|
2750
|
-
s.isNotSealed = function(e, t) {
|
|
2751
|
-
new i(e, t, s.isNotSealed, !0).to.not.be.sealed;
|
|
2752
|
-
};
|
|
2753
|
-
s.isFrozen = function(e, t) {
|
|
2754
|
-
new i(e, t, s.isFrozen, !0).to.be.frozen;
|
|
2755
|
-
};
|
|
2756
|
-
s.isNotFrozen = function(e, t) {
|
|
2757
|
-
new i(e, t, s.isNotFrozen, !0).to.not.be.frozen;
|
|
2758
|
-
};
|
|
2759
|
-
s.isEmpty = function(e, t) {
|
|
2760
|
-
new i(e, t, s.isEmpty, !0).to.be.empty;
|
|
2761
|
-
};
|
|
2762
|
-
s.isNotEmpty = function(e, t) {
|
|
2763
|
-
new i(e, t, s.isNotEmpty, !0).to.not.be.empty;
|
|
2764
|
-
};
|
|
2765
|
-
(/* @__PURE__ */ l(function e(t, n) {
|
|
2766
|
-
return s[n] = s[t], e;
|
|
2767
|
-
}, "alias"))("isOk", "ok")("isNotOk", "notOk")("throws", "throw")("throws", "Throw")("isExtensible", "extensible")("isNotExtensible", "notExtensible")("isSealed", "sealed")("isNotSealed", "notSealed")("isFrozen", "frozen")("isNotFrozen", "notFrozen")("isEmpty", "empty")("isNotEmpty", "notEmpty")("isCallable", "isFunction")("isNotCallable", "isNotFunction");
|
|
2768
|
-
var Kt = [];
|
|
2769
|
-
function qn(e) {
|
|
2770
|
-
const t = {
|
|
2771
|
-
AssertionError: E,
|
|
2772
|
-
util: pe,
|
|
2773
|
-
config: $,
|
|
2774
|
-
expect: k,
|
|
2775
|
-
assert: s,
|
|
2776
|
-
Assertion: i,
|
|
2777
|
-
..._n
|
|
2778
|
-
};
|
|
2779
|
-
return ~Kt.indexOf(e) || (e(t, pe), Kt.push(e)), t;
|
|
2780
|
-
}
|
|
2781
|
-
l(qn, "use");
|
|
2782
|
-
/*!
|
|
2783
|
-
* Chai - flag utility
|
|
2784
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2785
|
-
* MIT Licensed
|
|
2786
|
-
*/
|
|
2787
|
-
/*!
|
|
2788
|
-
* Chai - test utility
|
|
2789
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2790
|
-
* MIT Licensed
|
|
2791
|
-
*/
|
|
2792
|
-
/*!
|
|
2793
|
-
* Chai - expectTypes utility
|
|
2794
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2795
|
-
* MIT Licensed
|
|
2796
|
-
*/
|
|
2797
|
-
/*!
|
|
2798
|
-
* Chai - getActual utility
|
|
2799
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2800
|
-
* MIT Licensed
|
|
2801
|
-
*/
|
|
2802
|
-
/*!
|
|
2803
|
-
* Chai - message composition utility
|
|
2804
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2805
|
-
* MIT Licensed
|
|
2806
|
-
*/
|
|
2807
|
-
/*!
|
|
2808
|
-
* Chai - transferFlags utility
|
|
2809
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2810
|
-
* MIT Licensed
|
|
2811
|
-
*/
|
|
2812
|
-
/*!
|
|
2813
|
-
* chai
|
|
2814
|
-
* http://chaijs.com
|
|
2815
|
-
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2816
|
-
* MIT Licensed
|
|
2817
|
-
*/
|
|
2818
|
-
/*!
|
|
2819
|
-
* Chai - isProxyEnabled helper
|
|
2820
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2821
|
-
* MIT Licensed
|
|
2822
|
-
*/
|
|
2823
|
-
/*!
|
|
2824
|
-
* Chai - addProperty utility
|
|
2825
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2826
|
-
* MIT Licensed
|
|
2827
|
-
*/
|
|
2828
|
-
/*!
|
|
2829
|
-
* Chai - addLengthGuard utility
|
|
2830
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2831
|
-
* MIT Licensed
|
|
2832
|
-
*/
|
|
2833
|
-
/*!
|
|
2834
|
-
* Chai - getProperties utility
|
|
2835
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2836
|
-
* MIT Licensed
|
|
2837
|
-
*/
|
|
2838
|
-
/*!
|
|
2839
|
-
* Chai - proxify utility
|
|
2840
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2841
|
-
* MIT Licensed
|
|
2842
|
-
*/
|
|
2843
|
-
/*!
|
|
2844
|
-
* Chai - addMethod utility
|
|
2845
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2846
|
-
* MIT Licensed
|
|
2847
|
-
*/
|
|
2848
|
-
/*!
|
|
2849
|
-
* Chai - overwriteProperty utility
|
|
2850
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2851
|
-
* MIT Licensed
|
|
2852
|
-
*/
|
|
2853
|
-
/*!
|
|
2854
|
-
* Chai - overwriteMethod utility
|
|
2855
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2856
|
-
* MIT Licensed
|
|
2857
|
-
*/
|
|
2858
|
-
/*!
|
|
2859
|
-
* Chai - addChainingMethod utility
|
|
2860
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2861
|
-
* MIT Licensed
|
|
2862
|
-
*/
|
|
2863
|
-
/*!
|
|
2864
|
-
* Chai - overwriteChainableMethod utility
|
|
2865
|
-
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2866
|
-
* MIT Licensed
|
|
2867
|
-
*/
|
|
2868
|
-
/*!
|
|
2869
|
-
* Chai - compareByInspect utility
|
|
2870
|
-
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
|
2871
|
-
* MIT Licensed
|
|
2872
|
-
*/
|
|
2873
|
-
/*!
|
|
2874
|
-
* Chai - getOwnEnumerablePropertySymbols utility
|
|
2875
|
-
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
|
2876
|
-
* MIT Licensed
|
|
2877
|
-
*/
|
|
2878
|
-
/*!
|
|
2879
|
-
* Chai - getOwnEnumerableProperties utility
|
|
2880
|
-
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
|
2881
|
-
* MIT Licensed
|
|
2882
|
-
*/
|
|
2883
|
-
/*!
|
|
2884
|
-
* Chai - isNaN utility
|
|
2885
|
-
* Copyright(c) 2012-2015 Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
|
2886
|
-
* MIT Licensed
|
|
2887
|
-
*/
|
|
2888
|
-
/*!
|
|
2889
|
-
* chai
|
|
2890
|
-
* Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
|
|
2891
|
-
* MIT Licensed
|
|
2892
|
-
*/
|
|
2893
|
-
/*!
|
|
2894
|
-
* chai
|
|
2895
|
-
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
|
2896
|
-
* MIT Licensed
|
|
2897
|
-
*/
|
|
2898
|
-
/*! Bundled license information:
|
|
2899
|
-
|
|
2900
|
-
deep-eql/index.js:
|
|
2901
|
-
(*!
|
|
2902
|
-
* deep-eql
|
|
2903
|
-
* Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
|
|
2904
|
-
* MIT Licensed
|
|
2905
|
-
*)
|
|
2906
|
-
(*!
|
|
2907
|
-
* Check to see if the MemoizeMap has recorded a result of the two operands
|
|
2908
|
-
*
|
|
2909
|
-
* @param {Mixed} leftHandOperand
|
|
2910
|
-
* @param {Mixed} rightHandOperand
|
|
2911
|
-
* @param {MemoizeMap} memoizeMap
|
|
2912
|
-
* @returns {Boolean|null} result
|
|
2913
|
-
*)
|
|
2914
|
-
(*!
|
|
2915
|
-
* Set the result of the equality into the MemoizeMap
|
|
2916
|
-
*
|
|
2917
|
-
* @param {Mixed} leftHandOperand
|
|
2918
|
-
* @param {Mixed} rightHandOperand
|
|
2919
|
-
* @param {MemoizeMap} memoizeMap
|
|
2920
|
-
* @param {Boolean} result
|
|
2921
|
-
*)
|
|
2922
|
-
(*!
|
|
2923
|
-
* Primary Export
|
|
2924
|
-
*)
|
|
2925
|
-
(*!
|
|
2926
|
-
* The main logic of the `deepEqual` function.
|
|
2927
|
-
*
|
|
2928
|
-
* @param {Mixed} leftHandOperand
|
|
2929
|
-
* @param {Mixed} rightHandOperand
|
|
2930
|
-
* @param {Object} [options] (optional) Additional options
|
|
2931
|
-
* @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality.
|
|
2932
|
-
* @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of
|
|
2933
|
-
complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular
|
|
2934
|
-
references to blow the stack.
|
|
2935
|
-
* @return {Boolean} equal match
|
|
2936
|
-
*)
|
|
2937
|
-
(*!
|
|
2938
|
-
* Compare two Regular Expressions for equality.
|
|
2939
|
-
*
|
|
2940
|
-
* @param {RegExp} leftHandOperand
|
|
2941
|
-
* @param {RegExp} rightHandOperand
|
|
2942
|
-
* @return {Boolean} result
|
|
2943
|
-
*)
|
|
2944
|
-
(*!
|
|
2945
|
-
* Compare two Sets/Maps for equality. Faster than other equality functions.
|
|
2946
|
-
*
|
|
2947
|
-
* @param {Set} leftHandOperand
|
|
2948
|
-
* @param {Set} rightHandOperand
|
|
2949
|
-
* @param {Object} [options] (Optional)
|
|
2950
|
-
* @return {Boolean} result
|
|
2951
|
-
*)
|
|
2952
|
-
(*!
|
|
2953
|
-
* Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers.
|
|
2954
|
-
*
|
|
2955
|
-
* @param {Iterable} leftHandOperand
|
|
2956
|
-
* @param {Iterable} rightHandOperand
|
|
2957
|
-
* @param {Object} [options] (Optional)
|
|
2958
|
-
* @return {Boolean} result
|
|
2959
|
-
*)
|
|
2960
|
-
(*!
|
|
2961
|
-
* Simple equality for generator objects such as those returned by generator functions.
|
|
2962
|
-
*
|
|
2963
|
-
* @param {Iterable} leftHandOperand
|
|
2964
|
-
* @param {Iterable} rightHandOperand
|
|
2965
|
-
* @param {Object} [options] (Optional)
|
|
2966
|
-
* @return {Boolean} result
|
|
2967
|
-
*)
|
|
2968
|
-
(*!
|
|
2969
|
-
* Determine if the given object has an @@iterator function.
|
|
2970
|
-
*
|
|
2971
|
-
* @param {Object} target
|
|
2972
|
-
* @return {Boolean} `true` if the object has an @@iterator function.
|
|
2973
|
-
*)
|
|
2974
|
-
(*!
|
|
2975
|
-
* Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array.
|
|
2976
|
-
* This will consume the iterator - which could have side effects depending on the @@iterator implementation.
|
|
2977
|
-
*
|
|
2978
|
-
* @param {Object} target
|
|
2979
|
-
* @returns {Array} an array of entries from the @@iterator function
|
|
2980
|
-
*)
|
|
2981
|
-
(*!
|
|
2982
|
-
* Gets all entries from a Generator. This will consume the generator - which could have side effects.
|
|
2983
|
-
*
|
|
2984
|
-
* @param {Generator} target
|
|
2985
|
-
* @returns {Array} an array of entries from the Generator.
|
|
2986
|
-
*)
|
|
2987
|
-
(*!
|
|
2988
|
-
* Gets all own and inherited enumerable keys from a target.
|
|
2989
|
-
*
|
|
2990
|
-
* @param {Object} target
|
|
2991
|
-
* @returns {Array} an array of own and inherited enumerable keys from the target.
|
|
2992
|
-
*)
|
|
2993
|
-
(*!
|
|
2994
|
-
* Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
|
|
2995
|
-
* each key. If any value of the given key is not equal, the function will return false (early).
|
|
2996
|
-
*
|
|
2997
|
-
* @param {Mixed} leftHandOperand
|
|
2998
|
-
* @param {Mixed} rightHandOperand
|
|
2999
|
-
* @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against
|
|
3000
|
-
* @param {Object} [options] (Optional)
|
|
3001
|
-
* @return {Boolean} result
|
|
3002
|
-
*)
|
|
3003
|
-
(*!
|
|
3004
|
-
* Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual`
|
|
3005
|
-
* for each enumerable key in the object.
|
|
3006
|
-
*
|
|
3007
|
-
* @param {Mixed} leftHandOperand
|
|
3008
|
-
* @param {Mixed} rightHandOperand
|
|
3009
|
-
* @param {Object} [options] (Optional)
|
|
3010
|
-
* @return {Boolean} result
|
|
3011
|
-
*)
|
|
3012
|
-
(*!
|
|
3013
|
-
* Returns true if the argument is a primitive.
|
|
3014
|
-
*
|
|
3015
|
-
* This intentionally returns true for all objects that can be compared by reference,
|
|
3016
|
-
* including functions and symbols.
|
|
3017
|
-
*
|
|
3018
|
-
* @param {Mixed} value
|
|
3019
|
-
* @return {Boolean} result
|
|
3020
|
-
*)
|
|
3021
|
-
*/
|
|
3022
|
-
function Dt(e) {
|
|
3023
|
-
return e instanceof Error || Object.prototype.toString.call(e) === "[object Error]";
|
|
3024
|
-
}
|
|
3025
|
-
function cr(e) {
|
|
3026
|
-
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
3027
|
-
}
|
|
3028
|
-
function ur(e, t) {
|
|
3029
|
-
return Dt(t) && e === t;
|
|
3030
|
-
}
|
|
3031
|
-
function fr(e, t) {
|
|
3032
|
-
return Dt(t) ? e.constructor === t.constructor || e instanceof t.constructor : (typeof t == "object" || typeof t == "function") && t.prototype ? e.constructor === t || e instanceof t : !1;
|
|
3033
|
-
}
|
|
3034
|
-
function lr(e, t) {
|
|
3035
|
-
const n = typeof e == "string" ? e : e.message;
|
|
3036
|
-
return cr(t) ? t.test(n) : typeof t == "string" ? n.indexOf(t) !== -1 : !1;
|
|
3037
|
-
}
|
|
3038
|
-
function hr(e) {
|
|
3039
|
-
let t = e;
|
|
3040
|
-
return Dt(e) ? t = e.constructor.name : typeof e == "function" && (t = e.name, t === "" && (t = new e().name || t)), t;
|
|
3041
|
-
}
|
|
3042
|
-
function dr(e) {
|
|
3043
|
-
let t = "";
|
|
3044
|
-
return e && e.message ? t = e.message : typeof e == "string" && (t = e), t;
|
|
3045
|
-
}
|
|
3046
|
-
const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3047
|
-
__proto__: null,
|
|
3048
|
-
compatibleConstructor: fr,
|
|
3049
|
-
compatibleInstance: ur,
|
|
3050
|
-
compatibleMessage: lr,
|
|
3051
|
-
getConstructorName: hr,
|
|
3052
|
-
getMessage: dr
|
|
3053
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3054
|
-
let J = pr;
|
|
3055
|
-
function gr(e, t) {
|
|
3056
|
-
const n = e.Assertion, r = e.assert, o = t.proxify;
|
|
3057
|
-
t.checkError && (J = t.checkError);
|
|
3058
|
-
function a(d) {
|
|
3059
|
-
return typeof d.catch != "function" && typeof d.always == "function" && typeof d.done == "function" && typeof d.fail == "function" && typeof d.pipe == "function" && typeof d.progress == "function" && typeof d.state == "function";
|
|
3060
|
-
}
|
|
3061
|
-
function c(d) {
|
|
3062
|
-
if (typeof d._obj.then != "function")
|
|
3063
|
-
throw new TypeError(
|
|
3064
|
-
t.inspect(d._obj) + " is not a thenable."
|
|
3065
|
-
);
|
|
3066
|
-
if (a(d._obj))
|
|
3067
|
-
throw new TypeError(
|
|
3068
|
-
"Chai as Promised is incompatible with thenables of jQuery<3.0.0, sorry! Please upgrade jQuery or use another Promises/A+ compatible library (see http://promisesaplus.com/)."
|
|
3069
|
-
);
|
|
3070
|
-
}
|
|
3071
|
-
function u(d) {
|
|
3072
|
-
return o === void 0 ? d : o(d);
|
|
3073
|
-
}
|
|
3074
|
-
function h(d, g) {
|
|
3075
|
-
t.addMethod(n.prototype, d, function() {
|
|
3076
|
-
return c(this), g.apply(this, arguments);
|
|
3077
|
-
});
|
|
3078
|
-
}
|
|
3079
|
-
function p(d, g) {
|
|
3080
|
-
t.addProperty(n.prototype, d, function() {
|
|
3081
|
-
return c(this), u(g.apply(this, arguments));
|
|
3082
|
-
});
|
|
3083
|
-
}
|
|
3084
|
-
function b(d, g) {
|
|
3085
|
-
d.then(() => g(), g);
|
|
3086
|
-
}
|
|
3087
|
-
function y(d, g, P) {
|
|
3088
|
-
d.assert(!0, null, g, P.expected, P.actual);
|
|
3089
|
-
}
|
|
3090
|
-
function x(d, g, P) {
|
|
3091
|
-
d.assert(!1, g, null, P.expected, P.actual);
|
|
3092
|
-
}
|
|
3093
|
-
function m(d) {
|
|
3094
|
-
return typeof d.then == "function" ? d : d._obj;
|
|
3095
|
-
}
|
|
3096
|
-
function w(d) {
|
|
3097
|
-
return d instanceof Error ? d.toString() : J.getConstructorName(d);
|
|
3098
|
-
}
|
|
3099
|
-
const j = Object.getOwnPropertyNames(n.prototype), N = {};
|
|
3100
|
-
for (const d of j)
|
|
3101
|
-
N[d] = Object.getOwnPropertyDescriptor(
|
|
3102
|
-
n.prototype,
|
|
3103
|
-
d
|
|
3104
|
-
);
|
|
3105
|
-
p("fulfilled", function() {
|
|
3106
|
-
const d = m(this).then(
|
|
3107
|
-
(g) => (y(
|
|
3108
|
-
this,
|
|
3109
|
-
"expected promise not to be fulfilled but it was fulfilled with #{act}",
|
|
3110
|
-
{ actual: g }
|
|
3111
|
-
), g),
|
|
3112
|
-
(g) => (x(
|
|
3113
|
-
this,
|
|
3114
|
-
"expected promise to be fulfilled but it was rejected with #{act}",
|
|
3115
|
-
{ actual: w(g) }
|
|
3116
|
-
), g)
|
|
3117
|
-
);
|
|
3118
|
-
return de(this, d), this;
|
|
3119
|
-
}), p("rejected", function() {
|
|
3120
|
-
const d = m(this).then(
|
|
3121
|
-
(g) => (x(
|
|
3122
|
-
this,
|
|
3123
|
-
"expected promise to be rejected but it was fulfilled with #{act}",
|
|
3124
|
-
{ actual: g }
|
|
3125
|
-
), g),
|
|
3126
|
-
(g) => (y(
|
|
3127
|
-
this,
|
|
3128
|
-
"expected promise not to be rejected but it was rejected with #{act}",
|
|
3129
|
-
{ actual: w(g) }
|
|
3130
|
-
), g)
|
|
3131
|
-
);
|
|
3132
|
-
return de(this, d), this;
|
|
3133
|
-
}), h("rejectedWith", function(d, g, P) {
|
|
3134
|
-
let I = null;
|
|
3135
|
-
const q = t.flag(this, "negate") || !1;
|
|
3136
|
-
if (d === void 0 && g === void 0 && P === void 0)
|
|
3137
|
-
return this.rejected;
|
|
3138
|
-
P !== void 0 && t.flag(this, "message", P), d instanceof RegExp || typeof d == "string" ? (g = d, d = null) : d && d instanceof Error ? I = d.toString() : typeof d == "function" ? I = J.getConstructorName(d) : d = null;
|
|
3139
|
-
const F = !!(d && g);
|
|
3140
|
-
let U = "including";
|
|
3141
|
-
g instanceof RegExp && (U = "matching");
|
|
3142
|
-
const Fn = m(this).then(
|
|
3143
|
-
(R) => {
|
|
3144
|
-
let L = null, H = null;
|
|
3145
|
-
return d ? (L = "expected promise to be rejected with #{exp} but it was fulfilled with #{act}", H = I) : g && (L = `expected promise to be rejected with an error ${U} #{exp} but it was fulfilled with #{act}`, H = g), x(this, L, { expected: H, actual: R }), R;
|
|
3146
|
-
},
|
|
3147
|
-
(R) => {
|
|
3148
|
-
const L = d && (d instanceof Error ? J.compatibleInstance(R, d) : J.compatibleConstructor(R, d)), H = g === R || g && R && J.compatibleMessage(R, g), $t = w(R);
|
|
3149
|
-
return q && F ? L && H && this.assert(
|
|
3150
|
-
!0,
|
|
3151
|
-
null,
|
|
3152
|
-
"expected promise not to be rejected with #{exp} but it was rejected with #{act}",
|
|
3153
|
-
I,
|
|
3154
|
-
$t
|
|
3155
|
-
) : (d && this.assert(
|
|
3156
|
-
L,
|
|
3157
|
-
"expected promise to be rejected with #{exp} but it was rejected with #{act}",
|
|
3158
|
-
"expected promise not to be rejected with #{exp} but it was rejected with #{act}",
|
|
3159
|
-
I,
|
|
3160
|
-
$t
|
|
3161
|
-
), g && this.assert(
|
|
3162
|
-
H,
|
|
3163
|
-
`expected promise to be rejected with an error ${U} #{exp} but got #{act}`,
|
|
3164
|
-
`expected promise not to be rejected with an error ${U} #{exp}`,
|
|
3165
|
-
g,
|
|
3166
|
-
J.getMessage(R)
|
|
3167
|
-
)), R;
|
|
3168
|
-
}
|
|
3169
|
-
);
|
|
3170
|
-
return de(this, Fn), this;
|
|
3171
|
-
}), p("eventually", function() {
|
|
3172
|
-
return t.flag(this, "eventually", !0), this;
|
|
3173
|
-
}), h("notify", function(d) {
|
|
3174
|
-
return b(m(this), d), this;
|
|
3175
|
-
}), h("become", function(d, g) {
|
|
3176
|
-
return this.eventually.deep.equal(d, g);
|
|
3177
|
-
}), j.filter((d) => d !== "assert" && typeof N[d].value == "function").forEach((d) => {
|
|
3178
|
-
n.overwriteMethod(
|
|
3179
|
-
d,
|
|
3180
|
-
(g) => function() {
|
|
3181
|
-
return T(g, this, arguments);
|
|
3182
|
-
}
|
|
3183
|
-
);
|
|
3184
|
-
}), j.filter((d) => d !== "_obj" && typeof N[d].get == "function").forEach((d) => {
|
|
3185
|
-
Object.prototype.hasOwnProperty.call(
|
|
3186
|
-
n.prototype.__methods,
|
|
3187
|
-
d
|
|
3188
|
-
) ? n.overwriteChainableMethod(
|
|
3189
|
-
d,
|
|
3190
|
-
(P) => function() {
|
|
3191
|
-
return T(P, this, arguments);
|
|
3192
|
-
},
|
|
3193
|
-
(P) => function() {
|
|
3194
|
-
return T(P, this);
|
|
3195
|
-
}
|
|
3196
|
-
) : n.overwriteProperty(
|
|
3197
|
-
d,
|
|
3198
|
-
(P) => function() {
|
|
3199
|
-
return u(
|
|
3200
|
-
T(P, this)
|
|
3201
|
-
);
|
|
3202
|
-
}
|
|
3203
|
-
);
|
|
3204
|
-
});
|
|
3205
|
-
function T(d, g, P) {
|
|
3206
|
-
if (!t.flag(g, "eventually"))
|
|
3207
|
-
return d.apply(g, P), g;
|
|
3208
|
-
const I = m(g).then((q) => (g._obj = q, t.flag(g, "eventually", !1), P && yr(P))).then((q) => (d.apply(g, q), g._obj));
|
|
3209
|
-
return de(g, I), g;
|
|
3210
|
-
}
|
|
3211
|
-
const M = Object.getOwnPropertyNames(r).filter(
|
|
3212
|
-
(d) => typeof r[d] == "function"
|
|
3213
|
-
);
|
|
3214
|
-
r.isFulfilled = (d, g) => new n(d, g).to.be.fulfilled, r.isRejected = (d, g, P, I) => new n(d, I).to.be.rejectedWith(g, P, I), r.becomes = (d, g, P) => r.eventually.deepEqual(d, g, P), r.doesNotBecome = (d, g, P) => r.eventually.notDeepEqual(d, g, P), r.eventually = {}, M.forEach((d) => {
|
|
3215
|
-
r.eventually[d] = function(g) {
|
|
3216
|
-
const P = Array.prototype.slice.call(arguments, 1);
|
|
3217
|
-
let I;
|
|
3218
|
-
const q = arguments[r[d].length - 1];
|
|
3219
|
-
typeof q == "string" && (I = (U) => {
|
|
3220
|
-
throw new e.AssertionError(
|
|
3221
|
-
`${q}
|
|
3222
|
-
|
|
3223
|
-
Original reason: ${t.inspect(U)}`
|
|
3224
|
-
);
|
|
3225
|
-
});
|
|
3226
|
-
const F = g.then(
|
|
3227
|
-
(U) => r[d].apply(
|
|
3228
|
-
r,
|
|
3229
|
-
[U].concat(P)
|
|
3230
|
-
),
|
|
3231
|
-
I
|
|
3232
|
-
);
|
|
3233
|
-
return F.notify = (U) => {
|
|
3234
|
-
b(F, U);
|
|
3235
|
-
}, F;
|
|
3236
|
-
};
|
|
3237
|
-
});
|
|
3238
|
-
}
|
|
3239
|
-
function br(e, t) {
|
|
3240
|
-
e.then = t.then.bind(t);
|
|
3241
|
-
}
|
|
3242
|
-
function de(e, t) {
|
|
3243
|
-
br(e, t);
|
|
3244
|
-
}
|
|
3245
|
-
function yr(e) {
|
|
3246
|
-
return e;
|
|
3247
|
-
}
|
|
3248
|
-
const D = [];
|
|
3249
|
-
for (let e = 0; e < 256; ++e)
|
|
3250
|
-
D.push((e + 256).toString(16).slice(1));
|
|
3251
|
-
function mr(e, t = 0) {
|
|
3252
|
-
return (D[e[t + 0]] + D[e[t + 1]] + D[e[t + 2]] + D[e[t + 3]] + "-" + D[e[t + 4]] + D[e[t + 5]] + "-" + D[e[t + 6]] + D[e[t + 7]] + "-" + D[e[t + 8]] + D[e[t + 9]] + "-" + D[e[t + 10]] + D[e[t + 11]] + D[e[t + 12]] + D[e[t + 13]] + D[e[t + 14]] + D[e[t + 15]]).toLowerCase();
|
|
3253
|
-
}
|
|
3254
|
-
let qe;
|
|
3255
|
-
const wr = new Uint8Array(16);
|
|
3256
|
-
function vr() {
|
|
3257
|
-
if (!qe) {
|
|
3258
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
3259
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
3260
|
-
qe = crypto.getRandomValues.bind(crypto);
|
|
3261
|
-
}
|
|
3262
|
-
return qe(wr);
|
|
3263
|
-
}
|
|
3264
|
-
const xr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), kt = { randomUUID: xr };
|
|
3265
|
-
function Pr(e, t, n) {
|
|
3266
|
-
if (kt.randomUUID && !t && !e)
|
|
3267
|
-
return kt.randomUUID();
|
|
3268
|
-
e = e || {};
|
|
3269
|
-
const r = e.random || (e.rng || vr)();
|
|
3270
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, mr(r);
|
|
3271
|
-
}
|
|
3272
|
-
const se = "__OSRA__", Sr = "__OSRA_DEFAULT_KEY__", re = "__OSRA_PROXY__", zn = (e) => !!(globalThis.SharedArrayBuffer && e instanceof globalThis.SharedArrayBuffer), Bn = (e) => globalThis.ArrayBuffer && e instanceof globalThis.ArrayBuffer || globalThis.MessagePort && e instanceof globalThis.MessagePort || globalThis.ReadableStream && e instanceof globalThis.ReadableStream || globalThis.WritableStream && e instanceof globalThis.WritableStream || globalThis.TransformStream && e instanceof globalThis.TransformStream ? !0 : !!(globalThis.ImageBitmap && e instanceof globalThis.ImageBitmap), Ce = (e) => {
|
|
3273
|
-
const t = [], n = (r) => zn(r) ? void 0 : Bn(r) ? t.push(r) : Array.isArray(r) ? r.map(n) : r && typeof r == "object" ? Object.values(r).map(n) : void 0;
|
|
3274
|
-
return n(e), t;
|
|
3275
|
-
}, Er = (e, t) => {
|
|
3276
|
-
const n = "portId" in e ? e.portId : void 0, r = "port" in e ? e.port : n ? t.addIncomingProxiedMessagePort(n) : void 0;
|
|
3277
|
-
if (!r) throw new Error("No ports received for proxied function");
|
|
3278
|
-
const o = (...a) => new Promise((c, u) => {
|
|
3279
|
-
const { port1: h, port2: p } = new MessageChannel(), b = X([p, a], t), y = Ce(b), x = (m) => {
|
|
3280
|
-
const w = De(m.data, t);
|
|
3281
|
-
if (!(w instanceof Promise)) throw new Error("Proxied function did not return a promise");
|
|
3282
|
-
w.then(c).catch(u).finally(() => h.close());
|
|
3283
|
-
};
|
|
3284
|
-
h.addEventListener("message", x, { once: !0 }), h.start(), r.postMessage(b, { transfer: y });
|
|
3285
|
-
});
|
|
3286
|
-
return n && t.finalizationRegistry.register(o, Number(n.split("/")[1])), o;
|
|
3287
|
-
}, jr = (e, t) => {
|
|
3288
|
-
const n = t.envCheck.supportsPorts && "port" in e ? e.port : "portId" in e ? t.addIncomingProxiedMessagePort(e.portId) : void 0;
|
|
3289
|
-
if (!n) throw new Error("No ports received for proxied message port");
|
|
3290
|
-
return n;
|
|
3291
|
-
}, Mr = (e, t) => new Error(e.message, { cause: e.stack }), Or = (e, t) => new Promise((n, r) => {
|
|
3292
|
-
const o = "port" in e ? e.port : "portId" in e ? t.addIncomingProxiedMessagePort(e.portId) : void 0;
|
|
3293
|
-
if (!o) throw new Error("No ports received for proxied promise");
|
|
3294
|
-
const a = async (c) => {
|
|
3295
|
-
const u = await De(c.data, t);
|
|
3296
|
-
u instanceof Error ? r(u) : n(u), o.close();
|
|
3297
|
-
};
|
|
3298
|
-
o.addEventListener("message", a, { once: !0 }), o.start();
|
|
3299
|
-
}), De = (e, t) => xe(
|
|
3300
|
-
e,
|
|
3301
|
-
(n) => !!(n && typeof n == "object" && re in n && n[re]),
|
|
3302
|
-
(n) => {
|
|
3303
|
-
if (n.type === "function")
|
|
3304
|
-
return Er(n, t);
|
|
3305
|
-
if (n.type === "error")
|
|
3306
|
-
return Mr(n);
|
|
3307
|
-
if (n.type === "messagePort")
|
|
3308
|
-
return jr(n, t);
|
|
3309
|
-
if (n.type === "promise")
|
|
3310
|
-
return Or(n, t);
|
|
3311
|
-
throw new Error(`Unknown incoming proxied type: ${e}`);
|
|
3312
|
-
}
|
|
3313
|
-
), Nr = (e, t) => ({
|
|
3314
|
-
[re]: !0,
|
|
3315
|
-
type: "error",
|
|
3316
|
-
message: e.message,
|
|
3317
|
-
stack: e.stack
|
|
3318
|
-
}), Ar = (e, t) => ({
|
|
3319
|
-
[re]: !0,
|
|
3320
|
-
type: "messagePort",
|
|
3321
|
-
...t.envCheck.supportsPorts ? { port: e } : { portId: t.addOutgoingProxiedMessagePort(e) }
|
|
3322
|
-
}), Tr = (e, t) => {
|
|
3323
|
-
const { port1: n, port2: r } = new MessageChannel(), o = (a) => {
|
|
3324
|
-
const c = X(a, t), u = Ce(c);
|
|
3325
|
-
n.postMessage(c, { transfer: u }), n.close();
|
|
3326
|
-
};
|
|
3327
|
-
return e.then(o).catch(o), {
|
|
3328
|
-
[re]: !0,
|
|
3329
|
-
type: "promise",
|
|
3330
|
-
port: X(r, t)
|
|
3331
|
-
};
|
|
3332
|
-
}, Ir = (e, t) => {
|
|
3333
|
-
const { port1: n, port2: r } = new MessageChannel();
|
|
3334
|
-
return n.addEventListener("message", async (o) => {
|
|
3335
|
-
const [a, c] = De(o.data, t), u = (async () => e(...c))(), h = X(u, t), p = Ce(h);
|
|
3336
|
-
a.postMessage(h, { transfer: p }), a.close();
|
|
3337
|
-
}), n.start(), {
|
|
3338
|
-
[re]: !0,
|
|
3339
|
-
type: "function",
|
|
3340
|
-
port: X(r, t)
|
|
3341
|
-
};
|
|
3342
|
-
}, X = (e, t) => xe(
|
|
3343
|
-
e,
|
|
3344
|
-
(n) => typeof n == "function" || n instanceof Error || n instanceof MessagePort || n instanceof Promise,
|
|
3345
|
-
(n) => {
|
|
3346
|
-
if (typeof n == "function")
|
|
3347
|
-
return Ir(n, t);
|
|
3348
|
-
if (n instanceof Error)
|
|
3349
|
-
return Nr(n);
|
|
3350
|
-
if (n instanceof MessagePort)
|
|
3351
|
-
return Ar(n, t);
|
|
3352
|
-
if (n instanceof Promise)
|
|
3353
|
-
return Tr(n, t);
|
|
3354
|
-
throw new Error(`Unknown outgoing proxied type: ${n}`);
|
|
3355
|
-
}
|
|
3356
|
-
), xe = (e, t, n) => zn(e) || Bn(e) ? e : t(e) ? n(e) : Array.isArray(e) ? e.map((r) => xe(r, t, n)) : e && typeof e == "object" ? Object.fromEntries(
|
|
3357
|
-
Object.entries(e).map(([r, o]) => [
|
|
3358
|
-
r,
|
|
3359
|
-
xe(o, t, n)
|
|
3360
|
-
])
|
|
3361
|
-
) : e, Cr = () => {
|
|
3362
|
-
let e = 0;
|
|
3363
|
-
const t = /* @__PURE__ */ new Set();
|
|
3364
|
-
return {
|
|
3365
|
-
alloc: () => {
|
|
3366
|
-
if (t.size > 0) {
|
|
3367
|
-
const n = t.values().next().value;
|
|
3368
|
-
if (n === void 0)
|
|
3369
|
-
throw new Error("Tried to allocate number from freedUnused but result was undefined");
|
|
3370
|
-
return t.delete(n), n;
|
|
3371
|
-
}
|
|
3372
|
-
return e++, e;
|
|
3373
|
-
},
|
|
3374
|
-
free: (n) => {
|
|
3375
|
-
t.add(n);
|
|
3376
|
-
}
|
|
3377
|
-
};
|
|
3378
|
-
}, Dr = ({ numberAllocator: e }) => {
|
|
3379
|
-
const t = /* @__PURE__ */ new Map();
|
|
3380
|
-
return {
|
|
3381
|
-
alloc: (a) => {
|
|
3382
|
-
const c = e.alloc();
|
|
3383
|
-
return t.set(c, a), c;
|
|
3384
|
-
},
|
|
3385
|
-
get: (a) => t.get(a),
|
|
3386
|
-
free: (a) => {
|
|
3387
|
-
t.delete(a), e.free(a);
|
|
3388
|
-
}
|
|
3389
|
-
};
|
|
3390
|
-
}, Y = async (e, {
|
|
3391
|
-
remote: t,
|
|
3392
|
-
local: n,
|
|
3393
|
-
key: r = Sr,
|
|
3394
|
-
origin: o = "*"
|
|
3395
|
-
}) => {
|
|
3396
|
-
const a = Pr();
|
|
3397
|
-
let c;
|
|
3398
|
-
const u = new FinalizationRegistry((M) => {
|
|
3399
|
-
const d = p.get(M);
|
|
3400
|
-
if (!d) throw new Error(`Osra received a port-closed message with an invalid portId "${M}".`);
|
|
3401
|
-
d(), p.free(M);
|
|
3402
|
-
}), h = Cr(), p = Dr({ numberAllocator: h }), b = /* @__PURE__ */ new Map(), y = (M) => {
|
|
3403
|
-
const { port1: d, port2: g } = new MessageChannel();
|
|
3404
|
-
return b.set(M, d), g;
|
|
3405
|
-
}, x = (M) => {
|
|
3406
|
-
const d = p.alloc(() => {
|
|
3407
|
-
M.close();
|
|
3408
|
-
});
|
|
3409
|
-
return M.addEventListener("message", async (g) => {
|
|
3410
|
-
T(
|
|
3411
|
-
{
|
|
3412
|
-
[se]: !0,
|
|
3413
|
-
key: r,
|
|
3414
|
-
type: "message",
|
|
3415
|
-
portId: `${a}/${d}`,
|
|
3416
|
-
data: X(g.data, m())
|
|
3417
|
-
},
|
|
3418
|
-
[]
|
|
3419
|
-
);
|
|
3420
|
-
}), M.addEventListener("close", () => {
|
|
3421
|
-
h.free(d), T(
|
|
3422
|
-
{
|
|
3423
|
-
[se]: !0,
|
|
3424
|
-
key: r,
|
|
3425
|
-
type: "port-closed",
|
|
3426
|
-
portId: `${a}/${d}`
|
|
3427
|
-
},
|
|
3428
|
-
[]
|
|
3429
|
-
);
|
|
3430
|
-
}), `${a}/${d}`;
|
|
3431
|
-
}, m = () => {
|
|
3432
|
-
if (!c) throw new Error("Osra context was accessed before the ready message was received.");
|
|
3433
|
-
return {
|
|
3434
|
-
addIncomingProxiedMessagePort: y,
|
|
3435
|
-
addOutgoingProxiedMessagePort: x,
|
|
3436
|
-
envCheck: c,
|
|
3437
|
-
finalizationRegistry: u
|
|
3438
|
-
};
|
|
3439
|
-
};
|
|
3440
|
-
let w;
|
|
3441
|
-
const j = new Promise((M, d) => {
|
|
3442
|
-
w = M;
|
|
3443
|
-
}), N = () => {
|
|
3444
|
-
const M = new ArrayBuffer(1), { port1: d } = new MessageChannel();
|
|
3445
|
-
T(
|
|
3446
|
-
{
|
|
3447
|
-
[se]: !0,
|
|
3448
|
-
key: r,
|
|
3449
|
-
type: "ready",
|
|
3450
|
-
envCheck: { buffer: M, port: d }
|
|
3451
|
-
},
|
|
3452
|
-
[M, d]
|
|
3453
|
-
);
|
|
3454
|
-
};
|
|
3455
|
-
let B = !1;
|
|
3456
|
-
const A = async (M) => {
|
|
3457
|
-
if (!M.data || typeof M.data != "object" || !M.data[se] || M.data.key !== r) return;
|
|
3458
|
-
const { type: d } = M.data;
|
|
3459
|
-
if (d === "ready" && !B) {
|
|
3460
|
-
B = !0, c = {
|
|
3461
|
-
uuid: a,
|
|
3462
|
-
supportsPorts: M.data.envCheck.port instanceof MessagePort,
|
|
3463
|
-
jsonOnly: M.data.envCheck.buffer instanceof ArrayBuffer
|
|
3464
|
-
}, N();
|
|
3465
|
-
const g = X(e, m()), P = Ce(g);
|
|
3466
|
-
T(
|
|
3467
|
-
{
|
|
3468
|
-
[se]: !0,
|
|
3469
|
-
key: r,
|
|
3470
|
-
type: "init",
|
|
3471
|
-
data: g
|
|
3472
|
-
},
|
|
3473
|
-
P
|
|
3474
|
-
);
|
|
3475
|
-
return;
|
|
3476
|
-
}
|
|
3477
|
-
if (!B || !c) throw new Error("Osra received a message before the ready message.");
|
|
3478
|
-
if (d === "init") {
|
|
3479
|
-
w(
|
|
3480
|
-
De(
|
|
3481
|
-
M.data.data,
|
|
3482
|
-
m()
|
|
3483
|
-
)
|
|
3484
|
-
);
|
|
3485
|
-
return;
|
|
3486
|
-
}
|
|
3487
|
-
if (d === "message") {
|
|
3488
|
-
const { portId: g, data: P } = M.data, I = b.get(g);
|
|
3489
|
-
if (!I) throw new Error(`Osra received a message with portId set to "${g}" but no port was found.`);
|
|
3490
|
-
I.postMessage(P);
|
|
3491
|
-
} else if (d === "port-closed") {
|
|
3492
|
-
const { portId: g } = M.data, [P, I] = g.split("/"), q = Number(I);
|
|
3493
|
-
if (!q) throw new Error(`Osra received a port-closed message with an invalid portId "${g}".`);
|
|
3494
|
-
if (P !== a && P !== c.uuid) throw new Error(`Osra received a port-closed message with an invalid portId's uuid "${g}".`);
|
|
3495
|
-
if (P === a) {
|
|
3496
|
-
const F = p.get(q);
|
|
3497
|
-
if (!F) throw new Error(`Osra received a port-closed message with an invalid portId "${g}".`);
|
|
3498
|
-
F();
|
|
3499
|
-
} else if (P === c.uuid) {
|
|
3500
|
-
const F = b.get(g);
|
|
3501
|
-
if (!F) throw new Error(`Osra received a message with portId set to "${g}" but no port was found.`);
|
|
3502
|
-
F.close(), b.delete(g);
|
|
3503
|
-
}
|
|
3504
|
-
}
|
|
3505
|
-
}, T = typeof t == "function" ? t : (M, d = []) => t.postMessage(M, { targetOrigin: o, transfer: d });
|
|
3506
|
-
return typeof n == "function" ? n(A) : n.addEventListener("message", A), N(), j;
|
|
3507
|
-
};
|
|
3508
|
-
qn(gr);
|
|
3509
|
-
const $r = async () => {
|
|
3510
|
-
Y({
|
|
3511
|
-
test: async (n, r) => {
|
|
3512
|
-
if (n.foo !== 1)
|
|
3513
|
-
throw new Error("foo is not 1");
|
|
3514
|
-
if (r !== "bar")
|
|
3515
|
-
throw new Error("bar is not bar");
|
|
3516
|
-
return 1;
|
|
3517
|
-
}
|
|
3518
|
-
}, { remote: window, local: window });
|
|
3519
|
-
const { test: t } = await Y({}, { remote: window, local: window });
|
|
3520
|
-
await k(t({ foo: 1 }, "bar")).to.eventually.equal(1), await k(t({ foo: 0 }, "baz")).to.be.rejected;
|
|
3521
|
-
}, _r = async () => {
|
|
3522
|
-
Y({ test: async () => async () => 1 }, { remote: window, local: window });
|
|
3523
|
-
const { test: t } = await Y({}, { remote: window, local: window }), n = await t();
|
|
3524
|
-
await k(n()).to.eventually.equal(1);
|
|
3525
|
-
}, qr = async () => {
|
|
3526
|
-
Y({ test: async (r) => r() }, { remote: window, local: window });
|
|
3527
|
-
const { test: t } = await Y({}, { remote: window, local: window }), n = await t(() => 1);
|
|
3528
|
-
await k(n).to.equal(1);
|
|
3529
|
-
}, zr = async () => {
|
|
3530
|
-
Y({ test: async (r) => r() }, { remote: window, local: window });
|
|
3531
|
-
const { test: t } = await Y({}, { remote: window, local: window }), n = await t(() => 1);
|
|
3532
|
-
await k(n).to.equal(1);
|
|
3533
|
-
}, Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3534
|
-
__proto__: null,
|
|
3535
|
-
baseArgsAndResponse: $r,
|
|
3536
|
-
callback: _r,
|
|
3537
|
-
callbackAsArg: qr,
|
|
3538
|
-
polyfilledMessageChannel: zr
|
|
3539
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3540
|
-
globalThis.tests = Br;
|
|
3541
|
-
export {
|
|
3542
|
-
Br as default
|
|
3543
|
-
};
|
|
3544
|
-
//# sourceMappingURL=test.js.map
|