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