@farming-labs/theme 0.0.24 → 0.0.26

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.
Files changed (53) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +26 -1
  2. package/dist/docs-api.mjs +3 -1
  3. package/dist/docs-layout.mjs +9 -4
  4. package/dist/get-app-dir.d.mts +9 -0
  5. package/dist/get-app-dir.mjs +16 -0
  6. package/dist/get-app-dir.test.d.mts +1 -0
  7. package/dist/get-app-dir.test.mjs +41 -0
  8. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +77 -0
  9. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.mjs +1356 -0
  10. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.mjs +1119 -0
  11. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.mjs +1091 -0
  12. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.mjs +4 -0
  13. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.mjs +3 -0
  14. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.mjs +1821 -0
  15. package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.mjs +171 -0
  16. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.mjs +124 -0
  17. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.mjs +1334 -0
  18. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.mjs +105 -0
  19. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.mjs +118 -0
  20. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.mjs +455 -0
  21. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.mjs +168 -0
  22. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.mjs +3087 -0
  23. package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.mjs +384 -0
  24. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.mjs +11 -0
  25. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.mjs +16 -0
  26. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.mjs +11 -0
  27. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.mjs +15 -0
  28. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.mjs +13 -0
  29. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.mjs +34 -0
  30. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.mjs +12 -0
  31. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.mjs +122 -0
  32. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.mjs +39 -0
  33. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.mjs +99 -0
  34. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.mjs +25 -0
  35. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.mjs +14 -0
  36. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.mjs +21 -0
  37. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.mjs +5 -0
  38. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.mjs +12 -0
  39. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.mjs +18 -0
  40. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.mjs +25 -0
  41. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.mjs +8 -0
  42. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.mjs +30 -0
  43. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +939 -0
  44. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +81 -0
  45. package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs +51 -0
  46. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.mjs +81 -0
  47. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.mjs +9 -0
  48. package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.mjs +125 -0
  49. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.mjs +8 -0
  50. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.mjs +50 -0
  51. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/utils.XdZDrNZV.mjs +48 -0
  52. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.mjs +2613 -0
  53. package/package.json +6 -3
@@ -0,0 +1,3087 @@
1
+ //#region ../../node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", {
4
+ value,
5
+ configurable: true
6
+ });
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var utils_exports = {};
14
+ __export(utils_exports, {
15
+ addChainableMethod: () => addChainableMethod,
16
+ addLengthGuard: () => addLengthGuard,
17
+ addMethod: () => addMethod,
18
+ addProperty: () => addProperty,
19
+ checkError: () => check_error_exports,
20
+ compareByInspect: () => compareByInspect,
21
+ eql: () => deep_eql_default,
22
+ expectTypes: () => expectTypes,
23
+ flag: () => flag,
24
+ getActual: () => getActual,
25
+ getMessage: () => getMessage2,
26
+ getName: () => getName,
27
+ getOperator: () => getOperator,
28
+ getOwnEnumerableProperties: () => getOwnEnumerableProperties,
29
+ getOwnEnumerablePropertySymbols: () => getOwnEnumerablePropertySymbols,
30
+ getPathInfo: () => getPathInfo,
31
+ hasProperty: () => hasProperty,
32
+ inspect: () => inspect2,
33
+ isNaN: () => isNaN2,
34
+ isNumeric: () => isNumeric,
35
+ isProxyEnabled: () => isProxyEnabled,
36
+ isRegExp: () => isRegExp2,
37
+ objDisplay: () => objDisplay,
38
+ overwriteChainableMethod: () => overwriteChainableMethod,
39
+ overwriteMethod: () => overwriteMethod,
40
+ overwriteProperty: () => overwriteProperty,
41
+ proxify: () => proxify,
42
+ test: () => test,
43
+ transferFlags: () => transferFlags,
44
+ type: () => type
45
+ });
46
+ var check_error_exports = {};
47
+ __export(check_error_exports, {
48
+ compatibleConstructor: () => compatibleConstructor,
49
+ compatibleInstance: () => compatibleInstance,
50
+ compatibleMessage: () => compatibleMessage,
51
+ getConstructorName: () => getConstructorName,
52
+ getMessage: () => getMessage
53
+ });
54
+ function isErrorInstance(obj) {
55
+ return obj instanceof Error || Object.prototype.toString.call(obj) === "[object Error]";
56
+ }
57
+ __name(isErrorInstance, "isErrorInstance");
58
+ function isRegExp(obj) {
59
+ return Object.prototype.toString.call(obj) === "[object RegExp]";
60
+ }
61
+ __name(isRegExp, "isRegExp");
62
+ function compatibleInstance(thrown, errorLike) {
63
+ return isErrorInstance(errorLike) && thrown === errorLike;
64
+ }
65
+ __name(compatibleInstance, "compatibleInstance");
66
+ function compatibleConstructor(thrown, errorLike) {
67
+ if (isErrorInstance(errorLike)) return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor;
68
+ else if ((typeof errorLike === "object" || typeof errorLike === "function") && errorLike.prototype) return thrown.constructor === errorLike || thrown instanceof errorLike;
69
+ return false;
70
+ }
71
+ __name(compatibleConstructor, "compatibleConstructor");
72
+ function compatibleMessage(thrown, errMatcher) {
73
+ const comparisonString = typeof thrown === "string" ? thrown : thrown.message;
74
+ if (isRegExp(errMatcher)) return errMatcher.test(comparisonString);
75
+ else if (typeof errMatcher === "string") return comparisonString.indexOf(errMatcher) !== -1;
76
+ return false;
77
+ }
78
+ __name(compatibleMessage, "compatibleMessage");
79
+ function getConstructorName(errorLike) {
80
+ let constructorName = errorLike;
81
+ if (isErrorInstance(errorLike)) constructorName = errorLike.constructor.name;
82
+ else if (typeof errorLike === "function") {
83
+ constructorName = errorLike.name;
84
+ if (constructorName === "") constructorName = new errorLike().name || constructorName;
85
+ }
86
+ return constructorName;
87
+ }
88
+ __name(getConstructorName, "getConstructorName");
89
+ function getMessage(errorLike) {
90
+ let msg = "";
91
+ if (errorLike && errorLike.message) msg = errorLike.message;
92
+ else if (typeof errorLike === "string") msg = errorLike;
93
+ return msg;
94
+ }
95
+ __name(getMessage, "getMessage");
96
+ function flag(obj, key, value) {
97
+ let flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null));
98
+ if (arguments.length === 3) flags[key] = value;
99
+ else return flags[key];
100
+ }
101
+ __name(flag, "flag");
102
+ function test(obj, args) {
103
+ let negate = flag(obj, "negate"), expr = args[0];
104
+ return negate ? !expr : expr;
105
+ }
106
+ __name(test, "test");
107
+ function type(obj) {
108
+ if (typeof obj === "undefined") return "undefined";
109
+ if (obj === null) return "null";
110
+ const stringTag = obj[Symbol.toStringTag];
111
+ if (typeof stringTag === "string") return stringTag;
112
+ return Object.prototype.toString.call(obj).slice(8, -1);
113
+ }
114
+ __name(type, "type");
115
+ var canElideFrames = "captureStackTrace" in Error;
116
+ var AssertionError = class _AssertionError extends Error {
117
+ static {
118
+ __name(this, "AssertionError");
119
+ }
120
+ message;
121
+ get name() {
122
+ return "AssertionError";
123
+ }
124
+ get ok() {
125
+ return false;
126
+ }
127
+ constructor(message = "Unspecified AssertionError", props, ssf) {
128
+ super(message);
129
+ this.message = message;
130
+ if (canElideFrames) Error.captureStackTrace(this, ssf || _AssertionError);
131
+ for (const key in props) if (!(key in this)) this[key] = props[key];
132
+ }
133
+ toJSON(stack) {
134
+ return {
135
+ ...this,
136
+ name: this.name,
137
+ message: this.message,
138
+ ok: false,
139
+ stack: stack !== false ? this.stack : void 0
140
+ };
141
+ }
142
+ };
143
+ function expectTypes(obj, types) {
144
+ let flagMsg = flag(obj, "message");
145
+ let ssfi = flag(obj, "ssfi");
146
+ flagMsg = flagMsg ? flagMsg + ": " : "";
147
+ obj = flag(obj, "object");
148
+ types = types.map(function(t) {
149
+ return t.toLowerCase();
150
+ });
151
+ types.sort();
152
+ let str = types.map(function(t, index) {
153
+ let art = ~[
154
+ "a",
155
+ "e",
156
+ "i",
157
+ "o",
158
+ "u"
159
+ ].indexOf(t.charAt(0)) ? "an" : "a";
160
+ return (types.length > 1 && index === types.length - 1 ? "or " : "") + art + " " + t;
161
+ }).join(", ");
162
+ let objType = type(obj).toLowerCase();
163
+ if (!types.some(function(expected) {
164
+ return objType === expected;
165
+ })) throw new AssertionError(flagMsg + "object tested must be " + str + ", but " + objType + " given", void 0, ssfi);
166
+ }
167
+ __name(expectTypes, "expectTypes");
168
+ function getActual(obj, args) {
169
+ return args.length > 4 ? args[4] : obj._obj;
170
+ }
171
+ __name(getActual, "getActual");
172
+ var ansiColors = {
173
+ bold: ["1", "22"],
174
+ dim: ["2", "22"],
175
+ italic: ["3", "23"],
176
+ underline: ["4", "24"],
177
+ inverse: ["7", "27"],
178
+ hidden: ["8", "28"],
179
+ strike: ["9", "29"],
180
+ black: ["30", "39"],
181
+ red: ["31", "39"],
182
+ green: ["32", "39"],
183
+ yellow: ["33", "39"],
184
+ blue: ["34", "39"],
185
+ magenta: ["35", "39"],
186
+ cyan: ["36", "39"],
187
+ white: ["37", "39"],
188
+ brightblack: ["30;1", "39"],
189
+ brightred: ["31;1", "39"],
190
+ brightgreen: ["32;1", "39"],
191
+ brightyellow: ["33;1", "39"],
192
+ brightblue: ["34;1", "39"],
193
+ brightmagenta: ["35;1", "39"],
194
+ brightcyan: ["36;1", "39"],
195
+ brightwhite: ["37;1", "39"],
196
+ grey: ["90", "39"]
197
+ };
198
+ var styles = {
199
+ special: "cyan",
200
+ number: "yellow",
201
+ bigint: "yellow",
202
+ boolean: "yellow",
203
+ undefined: "grey",
204
+ null: "bold",
205
+ string: "green",
206
+ symbol: "green",
207
+ date: "magenta",
208
+ regexp: "red"
209
+ };
210
+ var truncator = "…";
211
+ function colorise(value, styleType) {
212
+ const color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
213
+ if (!color) return String(value);
214
+ return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`;
215
+ }
216
+ __name(colorise, "colorise");
217
+ function normaliseOptions({ showHidden = false, depth = 2, colors = false, customInspect = true, showProxy = false, maxArrayLength = Infinity, breakLength = Infinity, seen = [], truncate: truncate2 = Infinity, stylize = String } = {}, inspect3) {
218
+ const options = {
219
+ showHidden: Boolean(showHidden),
220
+ depth: Number(depth),
221
+ colors: Boolean(colors),
222
+ customInspect: Boolean(customInspect),
223
+ showProxy: Boolean(showProxy),
224
+ maxArrayLength: Number(maxArrayLength),
225
+ breakLength: Number(breakLength),
226
+ truncate: Number(truncate2),
227
+ seen,
228
+ inspect: inspect3,
229
+ stylize
230
+ };
231
+ if (options.colors) options.stylize = colorise;
232
+ return options;
233
+ }
234
+ __name(normaliseOptions, "normaliseOptions");
235
+ function isHighSurrogate(char) {
236
+ return char >= "\ud800" && char <= "\udbff";
237
+ }
238
+ __name(isHighSurrogate, "isHighSurrogate");
239
+ function truncate(string, length, tail = truncator) {
240
+ string = String(string);
241
+ const tailLength = tail.length;
242
+ const stringLength = string.length;
243
+ if (tailLength > length && stringLength > tailLength) return tail;
244
+ if (stringLength > length && stringLength > tailLength) {
245
+ let end = length - tailLength;
246
+ if (end > 0 && isHighSurrogate(string[end - 1])) end = end - 1;
247
+ return `${string.slice(0, end)}${tail}`;
248
+ }
249
+ return string;
250
+ }
251
+ __name(truncate, "truncate");
252
+ function inspectList(list, options, inspectItem, separator = ", ") {
253
+ inspectItem = inspectItem || options.inspect;
254
+ const size = list.length;
255
+ if (size === 0) return "";
256
+ const originalLength = options.truncate;
257
+ let output = "";
258
+ let peek = "";
259
+ let truncated = "";
260
+ for (let i = 0; i < size; i += 1) {
261
+ const last = i + 1 === list.length;
262
+ const secondToLast = i + 2 === list.length;
263
+ truncated = `${truncator}(${list.length - i})`;
264
+ const value = list[i];
265
+ options.truncate = originalLength - output.length - (last ? 0 : separator.length);
266
+ const string = peek || inspectItem(value, options) + (last ? "" : separator);
267
+ const nextLength = output.length + string.length;
268
+ const truncatedLength = nextLength + truncated.length;
269
+ if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) break;
270
+ if (!last && !secondToLast && truncatedLength > originalLength) break;
271
+ peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
272
+ if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) break;
273
+ output += string;
274
+ if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
275
+ truncated = `${truncator}(${list.length - i - 1})`;
276
+ break;
277
+ }
278
+ truncated = "";
279
+ }
280
+ return `${output}${truncated}`;
281
+ }
282
+ __name(inspectList, "inspectList");
283
+ function quoteComplexKey(key) {
284
+ if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) return key;
285
+ return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'");
286
+ }
287
+ __name(quoteComplexKey, "quoteComplexKey");
288
+ function inspectProperty([key, value], options) {
289
+ options.truncate -= 2;
290
+ if (typeof key === "string") key = quoteComplexKey(key);
291
+ else if (typeof key !== "number") key = `[${options.inspect(key, options)}]`;
292
+ options.truncate -= key.length;
293
+ value = options.inspect(value, options);
294
+ return `${key}: ${value}`;
295
+ }
296
+ __name(inspectProperty, "inspectProperty");
297
+ function inspectArray(array, options) {
298
+ const nonIndexProperties = Object.keys(array).slice(array.length);
299
+ if (!array.length && !nonIndexProperties.length) return "[]";
300
+ options.truncate -= 4;
301
+ const listContents = inspectList(array, options);
302
+ options.truncate -= listContents.length;
303
+ let propertyContents = "";
304
+ if (nonIndexProperties.length) propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
305
+ return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
306
+ }
307
+ __name(inspectArray, "inspectArray");
308
+ var getArrayName = /* @__PURE__ */ __name((array) => {
309
+ if (typeof Buffer === "function" && array instanceof Buffer) return "Buffer";
310
+ if (array[Symbol.toStringTag]) return array[Symbol.toStringTag];
311
+ return array.constructor.name;
312
+ }, "getArrayName");
313
+ function inspectTypedArray(array, options) {
314
+ const name = getArrayName(array);
315
+ options.truncate -= name.length + 4;
316
+ const nonIndexProperties = Object.keys(array).slice(array.length);
317
+ if (!array.length && !nonIndexProperties.length) return `${name}[]`;
318
+ let output = "";
319
+ for (let i = 0; i < array.length; i++) {
320
+ const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
321
+ options.truncate -= string.length;
322
+ if (array[i] !== array.length && options.truncate <= 3) {
323
+ output += `${truncator}(${array.length - array[i] + 1})`;
324
+ break;
325
+ }
326
+ output += string;
327
+ }
328
+ let propertyContents = "";
329
+ if (nonIndexProperties.length) propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
330
+ return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
331
+ }
332
+ __name(inspectTypedArray, "inspectTypedArray");
333
+ function inspectDate(dateObject, options) {
334
+ const stringRepresentation = dateObject.toJSON();
335
+ if (stringRepresentation === null) return "Invalid Date";
336
+ const split = stringRepresentation.split("T");
337
+ const date = split[0];
338
+ return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
339
+ }
340
+ __name(inspectDate, "inspectDate");
341
+ function inspectFunction(func, options) {
342
+ const functionType = func[Symbol.toStringTag] || "Function";
343
+ const name = func.name;
344
+ if (!name) return options.stylize(`[${functionType}]`, "special");
345
+ return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special");
346
+ }
347
+ __name(inspectFunction, "inspectFunction");
348
+ function inspectMapEntry([key, value], options) {
349
+ options.truncate -= 4;
350
+ key = options.inspect(key, options);
351
+ options.truncate -= key.length;
352
+ value = options.inspect(value, options);
353
+ return `${key} => ${value}`;
354
+ }
355
+ __name(inspectMapEntry, "inspectMapEntry");
356
+ function mapToEntries(map) {
357
+ const entries = [];
358
+ map.forEach((value, key) => {
359
+ entries.push([key, value]);
360
+ });
361
+ return entries;
362
+ }
363
+ __name(mapToEntries, "mapToEntries");
364
+ function inspectMap(map, options) {
365
+ if (map.size === 0) return "Map{}";
366
+ options.truncate -= 7;
367
+ return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
368
+ }
369
+ __name(inspectMap, "inspectMap");
370
+ var isNaN = Number.isNaN || ((i) => i !== i);
371
+ function inspectNumber(number, options) {
372
+ if (isNaN(number)) return options.stylize("NaN", "number");
373
+ if (number === Infinity) return options.stylize("Infinity", "number");
374
+ if (number === -Infinity) return options.stylize("-Infinity", "number");
375
+ if (number === 0) return options.stylize(1 / number === Infinity ? "+0" : "-0", "number");
376
+ return options.stylize(truncate(String(number), options.truncate), "number");
377
+ }
378
+ __name(inspectNumber, "inspectNumber");
379
+ function inspectBigInt(number, options) {
380
+ let nums = truncate(number.toString(), options.truncate - 1);
381
+ if (nums !== truncator) nums += "n";
382
+ return options.stylize(nums, "bigint");
383
+ }
384
+ __name(inspectBigInt, "inspectBigInt");
385
+ function inspectRegExp(value, options) {
386
+ const flags = value.toString().split("/")[2];
387
+ const sourceLength = options.truncate - (2 + flags.length);
388
+ const source = value.source;
389
+ return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp");
390
+ }
391
+ __name(inspectRegExp, "inspectRegExp");
392
+ function arrayFromSet(set2) {
393
+ const values = [];
394
+ set2.forEach((value) => {
395
+ values.push(value);
396
+ });
397
+ return values;
398
+ }
399
+ __name(arrayFromSet, "arrayFromSet");
400
+ function inspectSet(set2, options) {
401
+ if (set2.size === 0) return "Set{}";
402
+ options.truncate -= 7;
403
+ return `Set{ ${inspectList(arrayFromSet(set2), options)} }`;
404
+ }
405
+ __name(inspectSet, "inspectSet");
406
+ var stringEscapeChars = /* @__PURE__ */ new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
407
+ var escapeCharacters = {
408
+ "\b": "\\b",
409
+ " ": "\\t",
410
+ "\n": "\\n",
411
+ "\f": "\\f",
412
+ "\r": "\\r",
413
+ "'": "\\'",
414
+ "\\": "\\\\"
415
+ };
416
+ var hex = 16;
417
+ var unicodeLength = 4;
418
+ function escape(char) {
419
+ return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`;
420
+ }
421
+ __name(escape, "escape");
422
+ function inspectString(string, options) {
423
+ if (stringEscapeChars.test(string)) string = string.replace(stringEscapeChars, escape);
424
+ return options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string");
425
+ }
426
+ __name(inspectString, "inspectString");
427
+ function inspectSymbol(value) {
428
+ if ("description" in Symbol.prototype) return value.description ? `Symbol(${value.description})` : "Symbol()";
429
+ return value.toString();
430
+ }
431
+ __name(inspectSymbol, "inspectSymbol");
432
+ var promise_default = /* @__PURE__ */ __name(() => "Promise{…}", "getPromiseValue");
433
+ function inspectObject(object, options) {
434
+ const properties = Object.getOwnPropertyNames(object);
435
+ const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
436
+ if (properties.length === 0 && symbols.length === 0) return "{}";
437
+ options.truncate -= 4;
438
+ options.seen = options.seen || [];
439
+ if (options.seen.includes(object)) return "[Circular]";
440
+ options.seen.push(object);
441
+ const propertyContents = inspectList(properties.map((key) => [key, object[key]]), options, inspectProperty);
442
+ const symbolContents = inspectList(symbols.map((key) => [key, object[key]]), options, inspectProperty);
443
+ options.seen.pop();
444
+ let sep = "";
445
+ if (propertyContents && symbolContents) sep = ", ";
446
+ return `{ ${propertyContents}${sep}${symbolContents} }`;
447
+ }
448
+ __name(inspectObject, "inspectObject");
449
+ var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
450
+ function inspectClass(value, options) {
451
+ let name = "";
452
+ if (toStringTag && toStringTag in value) name = value[toStringTag];
453
+ name = name || value.constructor.name;
454
+ if (!name || name === "_class") name = "<Anonymous Class>";
455
+ options.truncate -= name.length;
456
+ return `${name}${inspectObject(value, options)}`;
457
+ }
458
+ __name(inspectClass, "inspectClass");
459
+ function inspectArguments(args, options) {
460
+ if (args.length === 0) return "Arguments[]";
461
+ options.truncate -= 13;
462
+ return `Arguments[ ${inspectList(args, options)} ]`;
463
+ }
464
+ __name(inspectArguments, "inspectArguments");
465
+ var errorKeys = [
466
+ "stack",
467
+ "line",
468
+ "column",
469
+ "name",
470
+ "message",
471
+ "fileName",
472
+ "lineNumber",
473
+ "columnNumber",
474
+ "number",
475
+ "description",
476
+ "cause"
477
+ ];
478
+ function inspectObject2(error, options) {
479
+ const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1);
480
+ const name = error.name;
481
+ options.truncate -= name.length;
482
+ let message = "";
483
+ if (typeof error.message === "string") message = truncate(error.message, options.truncate);
484
+ else properties.unshift("message");
485
+ message = message ? `: ${message}` : "";
486
+ options.truncate -= message.length + 5;
487
+ options.seen = options.seen || [];
488
+ if (options.seen.includes(error)) return "[Circular]";
489
+ options.seen.push(error);
490
+ const propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty);
491
+ return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
492
+ }
493
+ __name(inspectObject2, "inspectObject");
494
+ function inspectAttribute([key, value], options) {
495
+ options.truncate -= 3;
496
+ if (!value) return `${options.stylize(String(key), "yellow")}`;
497
+ return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
498
+ }
499
+ __name(inspectAttribute, "inspectAttribute");
500
+ function inspectNodeCollection(collection, options) {
501
+ return inspectList(collection, options, inspectNode, "\n");
502
+ }
503
+ __name(inspectNodeCollection, "inspectNodeCollection");
504
+ function inspectNode(node, options) {
505
+ switch (node.nodeType) {
506
+ case 1: return inspectHTML(node, options);
507
+ case 3: return options.inspect(node.data, options);
508
+ default: return options.inspect(node, options);
509
+ }
510
+ }
511
+ __name(inspectNode, "inspectNode");
512
+ function inspectHTML(element, options) {
513
+ const properties = element.getAttributeNames();
514
+ const name = element.tagName.toLowerCase();
515
+ const head = options.stylize(`<${name}`, "special");
516
+ const headClose = options.stylize(`>`, "special");
517
+ const tail = options.stylize(`</${name}>`, "special");
518
+ options.truncate -= name.length * 2 + 5;
519
+ let propertyContents = "";
520
+ if (properties.length > 0) {
521
+ propertyContents += " ";
522
+ propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ");
523
+ }
524
+ options.truncate -= propertyContents.length;
525
+ const truncate2 = options.truncate;
526
+ let children = inspectNodeCollection(element.children, options);
527
+ if (children && children.length > truncate2) children = `${truncator}(${element.children.length})`;
528
+ return `${head}${propertyContents}${headClose}${children}${tail}`;
529
+ }
530
+ __name(inspectHTML, "inspectHTML");
531
+ var chaiInspect = typeof Symbol === "function" && typeof Symbol.for === "function" ? Symbol.for("chai/inspect") : "@@chai/inspect";
532
+ var nodeInspect = Symbol.for("nodejs.util.inspect.custom");
533
+ var constructorMap = /* @__PURE__ */ new WeakMap();
534
+ var stringTagMap = {};
535
+ var baseTypesMap = {
536
+ undefined: /* @__PURE__ */ __name((value, options) => options.stylize("undefined", "undefined"), "undefined"),
537
+ null: /* @__PURE__ */ __name((value, options) => options.stylize("null", "null"), "null"),
538
+ boolean: /* @__PURE__ */ __name((value, options) => options.stylize(String(value), "boolean"), "boolean"),
539
+ Boolean: /* @__PURE__ */ __name((value, options) => options.stylize(String(value), "boolean"), "Boolean"),
540
+ number: inspectNumber,
541
+ Number: inspectNumber,
542
+ bigint: inspectBigInt,
543
+ BigInt: inspectBigInt,
544
+ string: inspectString,
545
+ String: inspectString,
546
+ function: inspectFunction,
547
+ Function: inspectFunction,
548
+ symbol: inspectSymbol,
549
+ Symbol: inspectSymbol,
550
+ Array: inspectArray,
551
+ Date: inspectDate,
552
+ Map: inspectMap,
553
+ Set: inspectSet,
554
+ RegExp: inspectRegExp,
555
+ Promise: promise_default,
556
+ WeakSet: /* @__PURE__ */ __name((value, options) => options.stylize("WeakSet{…}", "special"), "WeakSet"),
557
+ WeakMap: /* @__PURE__ */ __name((value, options) => options.stylize("WeakMap{…}", "special"), "WeakMap"),
558
+ Arguments: inspectArguments,
559
+ Int8Array: inspectTypedArray,
560
+ Uint8Array: inspectTypedArray,
561
+ Uint8ClampedArray: inspectTypedArray,
562
+ Int16Array: inspectTypedArray,
563
+ Uint16Array: inspectTypedArray,
564
+ Int32Array: inspectTypedArray,
565
+ Uint32Array: inspectTypedArray,
566
+ Float32Array: inspectTypedArray,
567
+ Float64Array: inspectTypedArray,
568
+ Generator: /* @__PURE__ */ __name(() => "", "Generator"),
569
+ DataView: /* @__PURE__ */ __name(() => "", "DataView"),
570
+ ArrayBuffer: /* @__PURE__ */ __name(() => "", "ArrayBuffer"),
571
+ Error: inspectObject2,
572
+ HTMLCollection: inspectNodeCollection,
573
+ NodeList: inspectNodeCollection
574
+ };
575
+ var inspectCustom = /* @__PURE__ */ __name((value, options, type3) => {
576
+ if (chaiInspect in value && typeof value[chaiInspect] === "function") return value[chaiInspect](options);
577
+ if (nodeInspect in value && typeof value[nodeInspect] === "function") return value[nodeInspect](options.depth, options);
578
+ if ("inspect" in value && typeof value.inspect === "function") return value.inspect(options.depth, options);
579
+ if ("constructor" in value && constructorMap.has(value.constructor)) return constructorMap.get(value.constructor)(value, options);
580
+ if (stringTagMap[type3]) return stringTagMap[type3](value, options);
581
+ return "";
582
+ }, "inspectCustom");
583
+ var toString = Object.prototype.toString;
584
+ function inspect(value, opts = {}) {
585
+ const options = normaliseOptions(opts, inspect);
586
+ const { customInspect } = options;
587
+ let type3 = value === null ? "null" : typeof value;
588
+ if (type3 === "object") type3 = toString.call(value).slice(8, -1);
589
+ if (type3 in baseTypesMap) return baseTypesMap[type3](value, options);
590
+ if (customInspect && value) {
591
+ const output = inspectCustom(value, options, type3);
592
+ if (output) {
593
+ if (typeof output === "string") return output;
594
+ return inspect(output, options);
595
+ }
596
+ }
597
+ const proto = value ? Object.getPrototypeOf(value) : false;
598
+ if (proto === Object.prototype || proto === null) return inspectObject(value, options);
599
+ if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) return inspectHTML(value, options);
600
+ if ("constructor" in value) {
601
+ if (value.constructor !== Object) return inspectClass(value, options);
602
+ return inspectObject(value, options);
603
+ }
604
+ if (value === Object(value)) return inspectObject(value, options);
605
+ return options.stylize(String(value), type3);
606
+ }
607
+ __name(inspect, "inspect");
608
+ var config = {
609
+ includeStack: false,
610
+ showDiff: true,
611
+ truncateThreshold: 40,
612
+ useProxy: true,
613
+ proxyExcludedKeys: [
614
+ "then",
615
+ "catch",
616
+ "inspect",
617
+ "toJSON"
618
+ ],
619
+ deepEqual: null
620
+ };
621
+ function inspect2(obj, showHidden, depth, colors) {
622
+ return inspect(obj, {
623
+ colors,
624
+ depth: typeof depth === "undefined" ? 2 : depth,
625
+ showHidden,
626
+ truncate: config.truncateThreshold ? config.truncateThreshold : Infinity
627
+ });
628
+ }
629
+ __name(inspect2, "inspect");
630
+ function objDisplay(obj) {
631
+ let str = inspect2(obj), type3 = Object.prototype.toString.call(obj);
632
+ if (config.truncateThreshold && str.length >= config.truncateThreshold) if (type3 === "[object Function]") return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]";
633
+ else if (type3 === "[object Array]") return "[ Array(" + obj.length + ") ]";
634
+ else if (type3 === "[object Object]") {
635
+ let keys = Object.keys(obj);
636
+ return "{ Object (" + (keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", ")) + ") }";
637
+ } else return str;
638
+ else return str;
639
+ }
640
+ __name(objDisplay, "objDisplay");
641
+ function getMessage2(obj, args) {
642
+ let negate = flag(obj, "negate");
643
+ let val = flag(obj, "object");
644
+ let expected = args[3];
645
+ let actual = getActual(obj, args);
646
+ let msg = negate ? args[2] : args[1];
647
+ let flagMsg = flag(obj, "message");
648
+ if (typeof msg === "function") msg = msg();
649
+ msg = msg || "";
650
+ msg = msg.replace(/#\{this\}/g, function() {
651
+ return objDisplay(val);
652
+ }).replace(/#\{act\}/g, function() {
653
+ return objDisplay(actual);
654
+ }).replace(/#\{exp\}/g, function() {
655
+ return objDisplay(expected);
656
+ });
657
+ return flagMsg ? flagMsg + ": " + msg : msg;
658
+ }
659
+ __name(getMessage2, "getMessage");
660
+ function transferFlags(assertion, object, includeAll) {
661
+ let flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null));
662
+ if (!object.__flags) object.__flags = /* @__PURE__ */ Object.create(null);
663
+ includeAll = arguments.length === 3 ? includeAll : true;
664
+ for (let flag3 in flags) if (includeAll || flag3 !== "object" && flag3 !== "ssfi" && flag3 !== "lockSsfi" && flag3 != "message") object.__flags[flag3] = flags[flag3];
665
+ }
666
+ __name(transferFlags, "transferFlags");
667
+ function type2(obj) {
668
+ if (typeof obj === "undefined") return "undefined";
669
+ if (obj === null) return "null";
670
+ const stringTag = obj[Symbol.toStringTag];
671
+ if (typeof stringTag === "string") return stringTag;
672
+ return Object.prototype.toString.call(obj).slice(8, -1);
673
+ }
674
+ __name(type2, "type");
675
+ function FakeMap() {
676
+ this._key = "chai/deep-eql__" + Math.random() + Date.now();
677
+ }
678
+ __name(FakeMap, "FakeMap");
679
+ FakeMap.prototype = {
680
+ get: /* @__PURE__ */ __name(function get(key) {
681
+ return key[this._key];
682
+ }, "get"),
683
+ set: /* @__PURE__ */ __name(function set(key, value) {
684
+ if (Object.isExtensible(key)) Object.defineProperty(key, this._key, {
685
+ value,
686
+ configurable: true
687
+ });
688
+ }, "set")
689
+ };
690
+ var MemoizeMap = typeof WeakMap === "function" ? WeakMap : FakeMap;
691
+ function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) {
692
+ if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) return null;
693
+ var leftHandMap = memoizeMap.get(leftHandOperand);
694
+ if (leftHandMap) {
695
+ var result = leftHandMap.get(rightHandOperand);
696
+ if (typeof result === "boolean") return result;
697
+ }
698
+ return null;
699
+ }
700
+ __name(memoizeCompare, "memoizeCompare");
701
+ function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) {
702
+ if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) return;
703
+ var leftHandMap = memoizeMap.get(leftHandOperand);
704
+ if (leftHandMap) leftHandMap.set(rightHandOperand, result);
705
+ else {
706
+ leftHandMap = new MemoizeMap();
707
+ leftHandMap.set(rightHandOperand, result);
708
+ memoizeMap.set(leftHandOperand, leftHandMap);
709
+ }
710
+ }
711
+ __name(memoizeSet, "memoizeSet");
712
+ var deep_eql_default = deepEqual;
713
+ function deepEqual(leftHandOperand, rightHandOperand, options) {
714
+ if (options && options.comparator) return extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
715
+ var simpleResult = simpleEqual(leftHandOperand, rightHandOperand);
716
+ if (simpleResult !== null) return simpleResult;
717
+ return extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
718
+ }
719
+ __name(deepEqual, "deepEqual");
720
+ function simpleEqual(leftHandOperand, rightHandOperand) {
721
+ if (leftHandOperand === rightHandOperand) return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand;
722
+ if (leftHandOperand !== leftHandOperand && rightHandOperand !== rightHandOperand) return true;
723
+ if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) return false;
724
+ return null;
725
+ }
726
+ __name(simpleEqual, "simpleEqual");
727
+ function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) {
728
+ options = options || {};
729
+ options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap();
730
+ var comparator = options && options.comparator;
731
+ var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize);
732
+ if (memoizeResultLeft !== null) return memoizeResultLeft;
733
+ var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize);
734
+ if (memoizeResultRight !== null) return memoizeResultRight;
735
+ if (comparator) {
736
+ var comparatorResult = comparator(leftHandOperand, rightHandOperand);
737
+ if (comparatorResult === false || comparatorResult === true) {
738
+ memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult);
739
+ return comparatorResult;
740
+ }
741
+ var simpleResult = simpleEqual(leftHandOperand, rightHandOperand);
742
+ if (simpleResult !== null) return simpleResult;
743
+ }
744
+ var leftHandType = type2(leftHandOperand);
745
+ if (leftHandType !== type2(rightHandOperand)) {
746
+ memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false);
747
+ return false;
748
+ }
749
+ memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true);
750
+ var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options);
751
+ memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result);
752
+ return result;
753
+ }
754
+ __name(extensiveDeepEqual, "extensiveDeepEqual");
755
+ function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) {
756
+ switch (leftHandType) {
757
+ case "String":
758
+ case "Number":
759
+ case "Boolean":
760
+ case "Date": return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf());
761
+ case "Promise":
762
+ case "Symbol":
763
+ case "function":
764
+ case "WeakMap":
765
+ case "WeakSet": return leftHandOperand === rightHandOperand;
766
+ case "Error": return keysEqual(leftHandOperand, rightHandOperand, [
767
+ "name",
768
+ "message",
769
+ "code"
770
+ ], options);
771
+ case "Arguments":
772
+ case "Int8Array":
773
+ case "Uint8Array":
774
+ case "Uint8ClampedArray":
775
+ case "Int16Array":
776
+ case "Uint16Array":
777
+ case "Int32Array":
778
+ case "Uint32Array":
779
+ case "Float32Array":
780
+ case "Float64Array":
781
+ case "Array": return iterableEqual(leftHandOperand, rightHandOperand, options);
782
+ case "RegExp": return regexpEqual(leftHandOperand, rightHandOperand);
783
+ case "Generator": return generatorEqual(leftHandOperand, rightHandOperand, options);
784
+ case "DataView": return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options);
785
+ case "ArrayBuffer": return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options);
786
+ case "Set": return entriesEqual(leftHandOperand, rightHandOperand, options);
787
+ case "Map": return entriesEqual(leftHandOperand, rightHandOperand, options);
788
+ case "Temporal.PlainDate":
789
+ case "Temporal.PlainTime":
790
+ case "Temporal.PlainDateTime":
791
+ case "Temporal.Instant":
792
+ case "Temporal.ZonedDateTime":
793
+ case "Temporal.PlainYearMonth":
794
+ case "Temporal.PlainMonthDay": return leftHandOperand.equals(rightHandOperand);
795
+ case "Temporal.Duration": return leftHandOperand.total("nanoseconds") === rightHandOperand.total("nanoseconds");
796
+ case "Temporal.TimeZone":
797
+ case "Temporal.Calendar": return leftHandOperand.toString() === rightHandOperand.toString();
798
+ default: return objectEqual(leftHandOperand, rightHandOperand, options);
799
+ }
800
+ }
801
+ __name(extensiveDeepEqualByType, "extensiveDeepEqualByType");
802
+ function regexpEqual(leftHandOperand, rightHandOperand) {
803
+ return leftHandOperand.toString() === rightHandOperand.toString();
804
+ }
805
+ __name(regexpEqual, "regexpEqual");
806
+ function entriesEqual(leftHandOperand, rightHandOperand, options) {
807
+ try {
808
+ if (leftHandOperand.size !== rightHandOperand.size) return false;
809
+ if (leftHandOperand.size === 0) return true;
810
+ } catch (sizeError) {
811
+ return false;
812
+ }
813
+ var leftHandItems = [];
814
+ var rightHandItems = [];
815
+ leftHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) {
816
+ leftHandItems.push([key, value]);
817
+ }, "gatherEntries"));
818
+ rightHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) {
819
+ rightHandItems.push([key, value]);
820
+ }, "gatherEntries"));
821
+ return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options);
822
+ }
823
+ __name(entriesEqual, "entriesEqual");
824
+ function iterableEqual(leftHandOperand, rightHandOperand, options) {
825
+ var length = leftHandOperand.length;
826
+ if (length !== rightHandOperand.length) return false;
827
+ if (length === 0) return true;
828
+ var index = -1;
829
+ while (++index < length) if (deepEqual(leftHandOperand[index], rightHandOperand[index], options) === false) return false;
830
+ return true;
831
+ }
832
+ __name(iterableEqual, "iterableEqual");
833
+ function generatorEqual(leftHandOperand, rightHandOperand, options) {
834
+ return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options);
835
+ }
836
+ __name(generatorEqual, "generatorEqual");
837
+ function hasIteratorFunction(target) {
838
+ return typeof Symbol !== "undefined" && typeof target === "object" && typeof Symbol.iterator !== "undefined" && typeof target[Symbol.iterator] === "function";
839
+ }
840
+ __name(hasIteratorFunction, "hasIteratorFunction");
841
+ function getIteratorEntries(target) {
842
+ if (hasIteratorFunction(target)) try {
843
+ return getGeneratorEntries(target[Symbol.iterator]());
844
+ } catch (iteratorError) {
845
+ return [];
846
+ }
847
+ return [];
848
+ }
849
+ __name(getIteratorEntries, "getIteratorEntries");
850
+ function getGeneratorEntries(generator) {
851
+ var generatorResult = generator.next();
852
+ var accumulator = [generatorResult.value];
853
+ while (generatorResult.done === false) {
854
+ generatorResult = generator.next();
855
+ accumulator.push(generatorResult.value);
856
+ }
857
+ return accumulator;
858
+ }
859
+ __name(getGeneratorEntries, "getGeneratorEntries");
860
+ function getEnumerableKeys(target) {
861
+ var keys = [];
862
+ for (var key in target) keys.push(key);
863
+ return keys;
864
+ }
865
+ __name(getEnumerableKeys, "getEnumerableKeys");
866
+ function getEnumerableSymbols(target) {
867
+ var keys = [];
868
+ var allKeys = Object.getOwnPropertySymbols(target);
869
+ for (var i = 0; i < allKeys.length; i += 1) {
870
+ var key = allKeys[i];
871
+ if (Object.getOwnPropertyDescriptor(target, key).enumerable) keys.push(key);
872
+ }
873
+ return keys;
874
+ }
875
+ __name(getEnumerableSymbols, "getEnumerableSymbols");
876
+ function keysEqual(leftHandOperand, rightHandOperand, keys, options) {
877
+ var length = keys.length;
878
+ if (length === 0) return true;
879
+ for (var i = 0; i < length; i += 1) if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) return false;
880
+ return true;
881
+ }
882
+ __name(keysEqual, "keysEqual");
883
+ function objectEqual(leftHandOperand, rightHandOperand, options) {
884
+ var leftHandKeys = getEnumerableKeys(leftHandOperand);
885
+ var rightHandKeys = getEnumerableKeys(rightHandOperand);
886
+ var leftHandSymbols = getEnumerableSymbols(leftHandOperand);
887
+ var rightHandSymbols = getEnumerableSymbols(rightHandOperand);
888
+ leftHandKeys = leftHandKeys.concat(leftHandSymbols);
889
+ rightHandKeys = rightHandKeys.concat(rightHandSymbols);
890
+ if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) {
891
+ if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) return false;
892
+ return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options);
893
+ }
894
+ var leftHandEntries = getIteratorEntries(leftHandOperand);
895
+ var rightHandEntries = getIteratorEntries(rightHandOperand);
896
+ if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) {
897
+ leftHandEntries.sort();
898
+ rightHandEntries.sort();
899
+ return iterableEqual(leftHandEntries, rightHandEntries, options);
900
+ }
901
+ if (leftHandKeys.length === 0 && leftHandEntries.length === 0 && rightHandKeys.length === 0 && rightHandEntries.length === 0) return true;
902
+ return false;
903
+ }
904
+ __name(objectEqual, "objectEqual");
905
+ function isPrimitive(value) {
906
+ return value === null || typeof value !== "object";
907
+ }
908
+ __name(isPrimitive, "isPrimitive");
909
+ function mapSymbols(arr) {
910
+ return arr.map(/* @__PURE__ */ __name(function mapSymbol(entry) {
911
+ if (typeof entry === "symbol") return entry.toString();
912
+ return entry;
913
+ }, "mapSymbol"));
914
+ }
915
+ __name(mapSymbols, "mapSymbols");
916
+ function hasProperty(obj, name) {
917
+ if (typeof obj === "undefined" || obj === null) return false;
918
+ return name in Object(obj);
919
+ }
920
+ __name(hasProperty, "hasProperty");
921
+ function parsePath(path) {
922
+ return path.replace(/([^\\])\[/g, "$1.[").match(/(\\\.|[^.]+?)+/g).map((value) => {
923
+ if (value === "constructor" || value === "__proto__" || value === "prototype") return {};
924
+ const mArr = /^\[(\d+)\]$/.exec(value);
925
+ let parsed = null;
926
+ if (mArr) parsed = { i: parseFloat(mArr[1]) };
927
+ else parsed = { p: value.replace(/\\([.[\]])/g, "$1") };
928
+ return parsed;
929
+ });
930
+ }
931
+ __name(parsePath, "parsePath");
932
+ function internalGetPathValue(obj, parsed, pathDepth) {
933
+ let temporaryValue = obj;
934
+ let res = null;
935
+ pathDepth = typeof pathDepth === "undefined" ? parsed.length : pathDepth;
936
+ for (let i = 0; i < pathDepth; i++) {
937
+ const part = parsed[i];
938
+ if (temporaryValue) {
939
+ if (typeof part.p === "undefined") temporaryValue = temporaryValue[part.i];
940
+ else temporaryValue = temporaryValue[part.p];
941
+ if (i === pathDepth - 1) res = temporaryValue;
942
+ }
943
+ }
944
+ return res;
945
+ }
946
+ __name(internalGetPathValue, "internalGetPathValue");
947
+ function getPathInfo(obj, path) {
948
+ const parsed = parsePath(path);
949
+ const last = parsed[parsed.length - 1];
950
+ const info = {
951
+ parent: parsed.length > 1 ? internalGetPathValue(obj, parsed, parsed.length - 1) : obj,
952
+ name: last.p || last.i,
953
+ value: internalGetPathValue(obj, parsed)
954
+ };
955
+ info.exists = hasProperty(info.parent, info.name);
956
+ return info;
957
+ }
958
+ __name(getPathInfo, "getPathInfo");
959
+ var Assertion = class _Assertion {
960
+ static {
961
+ __name(this, "Assertion");
962
+ }
963
+ /** @type {{}} */
964
+ __flags = {};
965
+ /**
966
+ * Creates object for chaining.
967
+ * `Assertion` objects contain metadata in the form of flags. Three flags can
968
+ * be assigned during instantiation by passing arguments to this constructor:
969
+ *
970
+ * - `object`: This flag contains the target of the assertion. For example, in
971
+ * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will
972
+ * contain `numKittens` so that the `equal` assertion can reference it when
973
+ * needed.
974
+ *
975
+ * - `message`: This flag contains an optional custom error message to be
976
+ * prepended to the error message that's generated by the assertion when it
977
+ * fails.
978
+ *
979
+ * - `ssfi`: This flag stands for "start stack function indicator". It
980
+ * contains a function reference that serves as the starting point for
981
+ * removing frames from the stack trace of the error that's created by the
982
+ * assertion when it fails. The goal is to provide a cleaner stack trace to
983
+ * end users by removing Chai's internal functions. Note that it only works
984
+ * in environments that support `Error.captureStackTrace`, and only when
985
+ * `Chai.config.includeStack` hasn't been set to `false`.
986
+ *
987
+ * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
988
+ * should retain its current value, even as assertions are chained off of
989
+ * this object. This is usually set to `true` when creating a new assertion
990
+ * from within another assertion. It's also temporarily set to `true` before
991
+ * an overwritten assertion gets called by the overwriting assertion.
992
+ *
993
+ * - `eql`: This flag contains the deepEqual function to be used by the assertion.
994
+ *
995
+ * @param {unknown} obj target of the assertion
996
+ * @param {string} [msg] (optional) custom error message
997
+ * @param {Function} [ssfi] (optional) starting point for removing stack frames
998
+ * @param {boolean} [lockSsfi] (optional) whether or not the ssfi flag is locked
999
+ */
1000
+ constructor(obj, msg, ssfi, lockSsfi) {
1001
+ flag(this, "ssfi", ssfi || _Assertion);
1002
+ flag(this, "lockSsfi", lockSsfi);
1003
+ flag(this, "object", obj);
1004
+ flag(this, "message", msg);
1005
+ flag(this, "eql", config.deepEqual || deep_eql_default);
1006
+ return proxify(this);
1007
+ }
1008
+ /** @returns {boolean} */
1009
+ static get includeStack() {
1010
+ console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");
1011
+ return config.includeStack;
1012
+ }
1013
+ /** @param {boolean} value */
1014
+ static set includeStack(value) {
1015
+ console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");
1016
+ config.includeStack = value;
1017
+ }
1018
+ /** @returns {boolean} */
1019
+ static get showDiff() {
1020
+ console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");
1021
+ return config.showDiff;
1022
+ }
1023
+ /** @param {boolean} value */
1024
+ static set showDiff(value) {
1025
+ console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");
1026
+ config.showDiff = value;
1027
+ }
1028
+ /**
1029
+ * @param {string} name
1030
+ * @param {Function} fn
1031
+ */
1032
+ static addProperty(name, fn) {
1033
+ addProperty(this.prototype, name, fn);
1034
+ }
1035
+ /**
1036
+ * @param {string} name
1037
+ * @param {Function} fn
1038
+ */
1039
+ static addMethod(name, fn) {
1040
+ addMethod(this.prototype, name, fn);
1041
+ }
1042
+ /**
1043
+ * @param {string} name
1044
+ * @param {Function} fn
1045
+ * @param {Function} chainingBehavior
1046
+ */
1047
+ static addChainableMethod(name, fn, chainingBehavior) {
1048
+ addChainableMethod(this.prototype, name, fn, chainingBehavior);
1049
+ }
1050
+ /**
1051
+ * @param {string} name
1052
+ * @param {Function} fn
1053
+ */
1054
+ static overwriteProperty(name, fn) {
1055
+ overwriteProperty(this.prototype, name, fn);
1056
+ }
1057
+ /**
1058
+ * @param {string} name
1059
+ * @param {Function} fn
1060
+ */
1061
+ static overwriteMethod(name, fn) {
1062
+ overwriteMethod(this.prototype, name, fn);
1063
+ }
1064
+ /**
1065
+ * @param {string} name
1066
+ * @param {Function} fn
1067
+ * @param {Function} chainingBehavior
1068
+ */
1069
+ static overwriteChainableMethod(name, fn, chainingBehavior) {
1070
+ overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
1071
+ }
1072
+ /**
1073
+ * ### .assert(expression, message, negateMessage, expected, actual, showDiff)
1074
+ *
1075
+ * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
1076
+ *
1077
+ * @name assert
1078
+ * @param {unknown} _expr to be tested
1079
+ * @param {string | Function} msg or function that returns message to display if expression fails
1080
+ * @param {string | Function} _negateMsg or function that returns negatedMessage to display if negated expression fails
1081
+ * @param {unknown} expected value (remember to check for negation)
1082
+ * @param {unknown} _actual (optional) will default to `this.obj`
1083
+ * @param {boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
1084
+ * @returns {void}
1085
+ */
1086
+ assert(_expr, msg, _negateMsg, expected, _actual, showDiff) {
1087
+ const ok = test(this, arguments);
1088
+ if (false !== showDiff) showDiff = true;
1089
+ if (void 0 === expected && void 0 === _actual) showDiff = false;
1090
+ if (true !== config.showDiff) showDiff = false;
1091
+ if (!ok) {
1092
+ msg = getMessage2(this, arguments);
1093
+ const assertionErrorObjectProperties = {
1094
+ actual: getActual(this, arguments),
1095
+ expected,
1096
+ showDiff
1097
+ };
1098
+ const operator = getOperator(this, arguments);
1099
+ if (operator) assertionErrorObjectProperties.operator = operator;
1100
+ throw new AssertionError(msg, assertionErrorObjectProperties, config.includeStack ? this.assert : flag(this, "ssfi"));
1101
+ }
1102
+ }
1103
+ /**
1104
+ * Quick reference to stored `actual` value for plugin developers.
1105
+ *
1106
+ * @returns {unknown}
1107
+ */
1108
+ get _obj() {
1109
+ return flag(this, "object");
1110
+ }
1111
+ /**
1112
+ * Quick reference to stored `actual` value for plugin developers.
1113
+ *
1114
+ * @param {unknown} val
1115
+ */
1116
+ set _obj(val) {
1117
+ flag(this, "object", val);
1118
+ }
1119
+ };
1120
+ function isProxyEnabled() {
1121
+ return config.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined";
1122
+ }
1123
+ __name(isProxyEnabled, "isProxyEnabled");
1124
+ function addProperty(ctx, name, getter) {
1125
+ getter = getter === void 0 ? function() {} : getter;
1126
+ Object.defineProperty(ctx, name, {
1127
+ get: /* @__PURE__ */ __name(function propertyGetter() {
1128
+ if (!isProxyEnabled() && !flag(this, "lockSsfi")) flag(this, "ssfi", propertyGetter);
1129
+ let result = getter.call(this);
1130
+ if (result !== void 0) return result;
1131
+ let newAssertion = new Assertion();
1132
+ transferFlags(this, newAssertion);
1133
+ return newAssertion;
1134
+ }, "propertyGetter"),
1135
+ configurable: true
1136
+ });
1137
+ }
1138
+ __name(addProperty, "addProperty");
1139
+ var fnLengthDesc = Object.getOwnPropertyDescriptor(function() {}, "length");
1140
+ function addLengthGuard(fn, assertionName, isChainable) {
1141
+ if (!fnLengthDesc.configurable) return fn;
1142
+ Object.defineProperty(fn, "length", { get: /* @__PURE__ */ __name(function() {
1143
+ if (isChainable) throw Error("Invalid Chai property: " + assertionName + ".length. Due to a compatibility issue, \"length\" cannot directly follow \"" + assertionName + "\". Use \"" + assertionName + ".lengthOf\" instead.");
1144
+ throw Error("Invalid Chai property: " + assertionName + ".length. See docs for proper usage of \"" + assertionName + "\".");
1145
+ }, "get") });
1146
+ return fn;
1147
+ }
1148
+ __name(addLengthGuard, "addLengthGuard");
1149
+ function getProperties(object) {
1150
+ let result = Object.getOwnPropertyNames(object);
1151
+ function addProperty2(property) {
1152
+ if (result.indexOf(property) === -1) result.push(property);
1153
+ }
1154
+ __name(addProperty2, "addProperty");
1155
+ let proto = Object.getPrototypeOf(object);
1156
+ while (proto !== null) {
1157
+ Object.getOwnPropertyNames(proto).forEach(addProperty2);
1158
+ proto = Object.getPrototypeOf(proto);
1159
+ }
1160
+ return result;
1161
+ }
1162
+ __name(getProperties, "getProperties");
1163
+ var builtins = [
1164
+ "__flags",
1165
+ "__methods",
1166
+ "_obj",
1167
+ "assert"
1168
+ ];
1169
+ function proxify(obj, nonChainableMethodName) {
1170
+ if (!isProxyEnabled()) return obj;
1171
+ return new Proxy(obj, { get: /* @__PURE__ */ __name(function proxyGetter(target, property) {
1172
+ if (typeof property === "string" && config.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) {
1173
+ if (nonChainableMethodName) throw Error("Invalid Chai property: " + nonChainableMethodName + "." + property + ". See docs for proper usage of \"" + nonChainableMethodName + "\".");
1174
+ let suggestion = null;
1175
+ let suggestionDistance = 4;
1176
+ getProperties(target).forEach(function(prop) {
1177
+ if (!Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1) {
1178
+ let dist = stringDistanceCapped(property, prop, suggestionDistance);
1179
+ if (dist < suggestionDistance) {
1180
+ suggestion = prop;
1181
+ suggestionDistance = dist;
1182
+ }
1183
+ }
1184
+ });
1185
+ if (suggestion !== null) throw Error("Invalid Chai property: " + property + ". Did you mean \"" + suggestion + "\"?");
1186
+ else throw Error("Invalid Chai property: " + property);
1187
+ }
1188
+ if (builtins.indexOf(property) === -1 && !flag(target, "lockSsfi")) flag(target, "ssfi", proxyGetter);
1189
+ return Reflect.get(target, property);
1190
+ }, "proxyGetter") });
1191
+ }
1192
+ __name(proxify, "proxify");
1193
+ function stringDistanceCapped(strA, strB, cap) {
1194
+ if (Math.abs(strA.length - strB.length) >= cap) return cap;
1195
+ let memo = [];
1196
+ for (let i = 0; i <= strA.length; i++) {
1197
+ memo[i] = Array(strB.length + 1).fill(0);
1198
+ memo[i][0] = i;
1199
+ }
1200
+ for (let j = 0; j < strB.length; j++) memo[0][j] = j;
1201
+ for (let i = 1; i <= strA.length; i++) {
1202
+ let ch = strA.charCodeAt(i - 1);
1203
+ for (let j = 1; j <= strB.length; j++) {
1204
+ if (Math.abs(i - j) >= cap) {
1205
+ memo[i][j] = cap;
1206
+ continue;
1207
+ }
1208
+ memo[i][j] = Math.min(memo[i - 1][j] + 1, memo[i][j - 1] + 1, memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1));
1209
+ }
1210
+ }
1211
+ return memo[strA.length][strB.length];
1212
+ }
1213
+ __name(stringDistanceCapped, "stringDistanceCapped");
1214
+ function addMethod(ctx, name, method) {
1215
+ let methodWrapper = /* @__PURE__ */ __name(function() {
1216
+ if (!flag(this, "lockSsfi")) flag(this, "ssfi", methodWrapper);
1217
+ let result = method.apply(this, arguments);
1218
+ if (result !== void 0) return result;
1219
+ let newAssertion = new Assertion();
1220
+ transferFlags(this, newAssertion);
1221
+ return newAssertion;
1222
+ }, "methodWrapper");
1223
+ addLengthGuard(methodWrapper, name, false);
1224
+ ctx[name] = proxify(methodWrapper, name);
1225
+ }
1226
+ __name(addMethod, "addMethod");
1227
+ function overwriteProperty(ctx, name, getter) {
1228
+ let _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ __name(function() {}, "_super");
1229
+ if (_get && "function" === typeof _get.get) _super = _get.get;
1230
+ Object.defineProperty(ctx, name, {
1231
+ get: /* @__PURE__ */ __name(function overwritingPropertyGetter() {
1232
+ if (!isProxyEnabled() && !flag(this, "lockSsfi")) flag(this, "ssfi", overwritingPropertyGetter);
1233
+ let origLockSsfi = flag(this, "lockSsfi");
1234
+ flag(this, "lockSsfi", true);
1235
+ let result = getter(_super).call(this);
1236
+ flag(this, "lockSsfi", origLockSsfi);
1237
+ if (result !== void 0) return result;
1238
+ let newAssertion = new Assertion();
1239
+ transferFlags(this, newAssertion);
1240
+ return newAssertion;
1241
+ }, "overwritingPropertyGetter"),
1242
+ configurable: true
1243
+ });
1244
+ }
1245
+ __name(overwriteProperty, "overwriteProperty");
1246
+ function overwriteMethod(ctx, name, method) {
1247
+ let _method = ctx[name], _super = /* @__PURE__ */ __name(function() {
1248
+ throw new Error(name + " is not a function");
1249
+ }, "_super");
1250
+ if (_method && "function" === typeof _method) _super = _method;
1251
+ let overwritingMethodWrapper = /* @__PURE__ */ __name(function() {
1252
+ if (!flag(this, "lockSsfi")) flag(this, "ssfi", overwritingMethodWrapper);
1253
+ let origLockSsfi = flag(this, "lockSsfi");
1254
+ flag(this, "lockSsfi", true);
1255
+ let result = method(_super).apply(this, arguments);
1256
+ flag(this, "lockSsfi", origLockSsfi);
1257
+ if (result !== void 0) return result;
1258
+ let newAssertion = new Assertion();
1259
+ transferFlags(this, newAssertion);
1260
+ return newAssertion;
1261
+ }, "overwritingMethodWrapper");
1262
+ addLengthGuard(overwritingMethodWrapper, name, false);
1263
+ ctx[name] = proxify(overwritingMethodWrapper, name);
1264
+ }
1265
+ __name(overwriteMethod, "overwriteMethod");
1266
+ var canSetPrototype = typeof Object.setPrototypeOf === "function";
1267
+ var testFn = /* @__PURE__ */ __name(function() {}, "testFn");
1268
+ var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
1269
+ let propDesc = Object.getOwnPropertyDescriptor(testFn, name);
1270
+ if (typeof propDesc !== "object") return true;
1271
+ return !propDesc.configurable;
1272
+ });
1273
+ var call = Function.prototype.call;
1274
+ var apply = Function.prototype.apply;
1275
+ function addChainableMethod(ctx, name, method, chainingBehavior) {
1276
+ if (typeof chainingBehavior !== "function") chainingBehavior = /* @__PURE__ */ __name(function() {}, "chainingBehavior");
1277
+ let chainableBehavior = {
1278
+ method,
1279
+ chainingBehavior
1280
+ };
1281
+ if (!ctx.__methods) ctx.__methods = {};
1282
+ ctx.__methods[name] = chainableBehavior;
1283
+ Object.defineProperty(ctx, name, {
1284
+ get: /* @__PURE__ */ __name(function chainableMethodGetter() {
1285
+ chainableBehavior.chainingBehavior.call(this);
1286
+ let chainableMethodWrapper = /* @__PURE__ */ __name(function() {
1287
+ if (!flag(this, "lockSsfi")) flag(this, "ssfi", chainableMethodWrapper);
1288
+ let result = chainableBehavior.method.apply(this, arguments);
1289
+ if (result !== void 0) return result;
1290
+ let newAssertion = new Assertion();
1291
+ transferFlags(this, newAssertion);
1292
+ return newAssertion;
1293
+ }, "chainableMethodWrapper");
1294
+ addLengthGuard(chainableMethodWrapper, name, true);
1295
+ if (canSetPrototype) {
1296
+ let prototype = Object.create(this);
1297
+ prototype.call = call;
1298
+ prototype.apply = apply;
1299
+ Object.setPrototypeOf(chainableMethodWrapper, prototype);
1300
+ } else Object.getOwnPropertyNames(ctx).forEach(function(asserterName) {
1301
+ if (excludeNames.indexOf(asserterName) !== -1) return;
1302
+ let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
1303
+ Object.defineProperty(chainableMethodWrapper, asserterName, pd);
1304
+ });
1305
+ transferFlags(this, chainableMethodWrapper);
1306
+ return proxify(chainableMethodWrapper);
1307
+ }, "chainableMethodGetter"),
1308
+ configurable: true
1309
+ });
1310
+ }
1311
+ __name(addChainableMethod, "addChainableMethod");
1312
+ function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
1313
+ let chainableBehavior = ctx.__methods[name];
1314
+ let _chainingBehavior = chainableBehavior.chainingBehavior;
1315
+ chainableBehavior.chainingBehavior = /* @__PURE__ */ __name(function overwritingChainableMethodGetter() {
1316
+ let result = chainingBehavior(_chainingBehavior).call(this);
1317
+ if (result !== void 0) return result;
1318
+ let newAssertion = new Assertion();
1319
+ transferFlags(this, newAssertion);
1320
+ return newAssertion;
1321
+ }, "overwritingChainableMethodGetter");
1322
+ let _method = chainableBehavior.method;
1323
+ chainableBehavior.method = /* @__PURE__ */ __name(function overwritingChainableMethodWrapper() {
1324
+ let result = method(_method).apply(this, arguments);
1325
+ if (result !== void 0) return result;
1326
+ let newAssertion = new Assertion();
1327
+ transferFlags(this, newAssertion);
1328
+ return newAssertion;
1329
+ }, "overwritingChainableMethodWrapper");
1330
+ }
1331
+ __name(overwriteChainableMethod, "overwriteChainableMethod");
1332
+ function compareByInspect(a, b) {
1333
+ return inspect2(a) < inspect2(b) ? -1 : 1;
1334
+ }
1335
+ __name(compareByInspect, "compareByInspect");
1336
+ function getOwnEnumerablePropertySymbols(obj) {
1337
+ if (typeof Object.getOwnPropertySymbols !== "function") return [];
1338
+ return Object.getOwnPropertySymbols(obj).filter(function(sym) {
1339
+ return Object.getOwnPropertyDescriptor(obj, sym).enumerable;
1340
+ });
1341
+ }
1342
+ __name(getOwnEnumerablePropertySymbols, "getOwnEnumerablePropertySymbols");
1343
+ function getOwnEnumerableProperties(obj) {
1344
+ return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj));
1345
+ }
1346
+ __name(getOwnEnumerableProperties, "getOwnEnumerableProperties");
1347
+ var isNaN2 = Number.isNaN;
1348
+ function isObjectType(obj) {
1349
+ let objectType = type(obj);
1350
+ return [
1351
+ "Array",
1352
+ "Object",
1353
+ "Function"
1354
+ ].indexOf(objectType) !== -1;
1355
+ }
1356
+ __name(isObjectType, "isObjectType");
1357
+ function getOperator(obj, args) {
1358
+ let operator = flag(obj, "operator");
1359
+ let negate = flag(obj, "negate");
1360
+ let expected = args[3];
1361
+ let msg = negate ? args[2] : args[1];
1362
+ if (operator) return operator;
1363
+ if (typeof msg === "function") msg = msg();
1364
+ msg = msg || "";
1365
+ if (!msg) return;
1366
+ if (/\shave\s/.test(msg)) return;
1367
+ let isObject = isObjectType(expected);
1368
+ if (/\snot\s/.test(msg)) return isObject ? "notDeepStrictEqual" : "notStrictEqual";
1369
+ return isObject ? "deepStrictEqual" : "strictEqual";
1370
+ }
1371
+ __name(getOperator, "getOperator");
1372
+ function getName(fn) {
1373
+ return fn.name;
1374
+ }
1375
+ __name(getName, "getName");
1376
+ function isRegExp2(obj) {
1377
+ return Object.prototype.toString.call(obj) === "[object RegExp]";
1378
+ }
1379
+ __name(isRegExp2, "isRegExp");
1380
+ function isNumeric(obj) {
1381
+ return ["Number", "BigInt"].includes(type(obj));
1382
+ }
1383
+ __name(isNumeric, "isNumeric");
1384
+ var { flag: flag2 } = utils_exports;
1385
+ [
1386
+ "to",
1387
+ "be",
1388
+ "been",
1389
+ "is",
1390
+ "and",
1391
+ "has",
1392
+ "have",
1393
+ "with",
1394
+ "that",
1395
+ "which",
1396
+ "at",
1397
+ "of",
1398
+ "same",
1399
+ "but",
1400
+ "does",
1401
+ "still",
1402
+ "also"
1403
+ ].forEach(function(chain) {
1404
+ Assertion.addProperty(chain);
1405
+ });
1406
+ Assertion.addProperty("not", function() {
1407
+ flag2(this, "negate", true);
1408
+ });
1409
+ Assertion.addProperty("deep", function() {
1410
+ flag2(this, "deep", true);
1411
+ });
1412
+ Assertion.addProperty("nested", function() {
1413
+ flag2(this, "nested", true);
1414
+ });
1415
+ Assertion.addProperty("own", function() {
1416
+ flag2(this, "own", true);
1417
+ });
1418
+ Assertion.addProperty("ordered", function() {
1419
+ flag2(this, "ordered", true);
1420
+ });
1421
+ Assertion.addProperty("any", function() {
1422
+ flag2(this, "any", true);
1423
+ flag2(this, "all", false);
1424
+ });
1425
+ Assertion.addProperty("all", function() {
1426
+ flag2(this, "all", true);
1427
+ flag2(this, "any", false);
1428
+ });
1429
+ var functionTypes = {
1430
+ function: [
1431
+ "function",
1432
+ "asyncfunction",
1433
+ "generatorfunction",
1434
+ "asyncgeneratorfunction"
1435
+ ],
1436
+ asyncfunction: ["asyncfunction", "asyncgeneratorfunction"],
1437
+ generatorfunction: ["generatorfunction", "asyncgeneratorfunction"],
1438
+ asyncgeneratorfunction: ["asyncgeneratorfunction"]
1439
+ };
1440
+ function an(type3, msg) {
1441
+ if (msg) flag2(this, "message", msg);
1442
+ type3 = type3.toLowerCase();
1443
+ let obj = flag2(this, "object"), article = ~[
1444
+ "a",
1445
+ "e",
1446
+ "i",
1447
+ "o",
1448
+ "u"
1449
+ ].indexOf(type3.charAt(0)) ? "an " : "a ";
1450
+ const detectedType = type(obj).toLowerCase();
1451
+ if (functionTypes["function"].includes(type3)) this.assert(functionTypes[type3].includes(detectedType), "expected #{this} to be " + article + type3, "expected #{this} not to be " + article + type3);
1452
+ else this.assert(type3 === detectedType, "expected #{this} to be " + article + type3, "expected #{this} not to be " + article + type3);
1453
+ }
1454
+ __name(an, "an");
1455
+ Assertion.addChainableMethod("an", an);
1456
+ Assertion.addChainableMethod("a", an);
1457
+ function SameValueZero(a, b) {
1458
+ return isNaN2(a) && isNaN2(b) || a === b;
1459
+ }
1460
+ __name(SameValueZero, "SameValueZero");
1461
+ function includeChainingBehavior() {
1462
+ flag2(this, "contains", true);
1463
+ }
1464
+ __name(includeChainingBehavior, "includeChainingBehavior");
1465
+ function include(val, msg) {
1466
+ if (msg) flag2(this, "message", msg);
1467
+ let 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;
1468
+ flagMsg = flagMsg ? flagMsg + ": " : "";
1469
+ let included = false;
1470
+ switch (objType) {
1471
+ case "string":
1472
+ included = obj.indexOf(val) !== -1;
1473
+ break;
1474
+ case "weakset":
1475
+ if (isDeep) throw new AssertionError(flagMsg + "unable to use .deep.include with WeakSet", void 0, ssfi);
1476
+ included = obj.has(val);
1477
+ break;
1478
+ case "map":
1479
+ obj.forEach(function(item) {
1480
+ included = included || isEql(item, val);
1481
+ });
1482
+ break;
1483
+ case "set":
1484
+ if (isDeep) obj.forEach(function(item) {
1485
+ included = included || isEql(item, val);
1486
+ });
1487
+ else included = obj.has(val);
1488
+ break;
1489
+ case "array":
1490
+ if (isDeep) included = obj.some(function(item) {
1491
+ return isEql(item, val);
1492
+ });
1493
+ else included = obj.indexOf(val) !== -1;
1494
+ break;
1495
+ default: {
1496
+ if (val !== Object(val)) throw new AssertionError(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(), void 0, ssfi);
1497
+ let props = Object.keys(val);
1498
+ let firstErr = null;
1499
+ let numErrs = 0;
1500
+ props.forEach(function(prop) {
1501
+ let propAssertion = new Assertion(obj);
1502
+ transferFlags(this, propAssertion, true);
1503
+ flag2(propAssertion, "lockSsfi", true);
1504
+ if (!negate || props.length === 1) {
1505
+ propAssertion.property(prop, val[prop]);
1506
+ return;
1507
+ }
1508
+ try {
1509
+ propAssertion.property(prop, val[prop]);
1510
+ } catch (err) {
1511
+ if (!check_error_exports.compatibleConstructor(err, AssertionError)) throw err;
1512
+ if (firstErr === null) firstErr = err;
1513
+ numErrs++;
1514
+ }
1515
+ }, this);
1516
+ if (negate && props.length > 1 && numErrs === props.length) throw firstErr;
1517
+ return;
1518
+ }
1519
+ }
1520
+ this.assert(included, "expected #{this} to " + descriptor + "include " + inspect2(val), "expected #{this} to not " + descriptor + "include " + inspect2(val));
1521
+ }
1522
+ __name(include, "include");
1523
+ Assertion.addChainableMethod("include", include, includeChainingBehavior);
1524
+ Assertion.addChainableMethod("contain", include, includeChainingBehavior);
1525
+ Assertion.addChainableMethod("contains", include, includeChainingBehavior);
1526
+ Assertion.addChainableMethod("includes", include, includeChainingBehavior);
1527
+ Assertion.addProperty("ok", function() {
1528
+ this.assert(flag2(this, "object"), "expected #{this} to be truthy", "expected #{this} to be falsy");
1529
+ });
1530
+ Assertion.addProperty("true", function() {
1531
+ this.assert(true === flag2(this, "object"), "expected #{this} to be true", "expected #{this} to be false", flag2(this, "negate") ? false : true);
1532
+ });
1533
+ Assertion.addProperty("numeric", function() {
1534
+ const object = flag2(this, "object");
1535
+ this.assert(["Number", "BigInt"].includes(type(object)), "expected #{this} to be numeric", "expected #{this} to not be numeric", flag2(this, "negate") ? false : true);
1536
+ });
1537
+ Assertion.addProperty("callable", function() {
1538
+ const val = flag2(this, "object");
1539
+ const ssfi = flag2(this, "ssfi");
1540
+ const message = flag2(this, "message");
1541
+ const msg = message ? `${message}: ` : "";
1542
+ const negate = flag2(this, "negate");
1543
+ const assertionMessage = negate ? `${msg}expected ${inspect2(val)} not to be a callable function` : `${msg}expected ${inspect2(val)} to be a callable function`;
1544
+ const isCallable = [
1545
+ "Function",
1546
+ "AsyncFunction",
1547
+ "GeneratorFunction",
1548
+ "AsyncGeneratorFunction"
1549
+ ].includes(type(val));
1550
+ if (isCallable && negate || !isCallable && !negate) throw new AssertionError(assertionMessage, void 0, ssfi);
1551
+ });
1552
+ Assertion.addProperty("false", function() {
1553
+ this.assert(false === flag2(this, "object"), "expected #{this} to be false", "expected #{this} to be true", flag2(this, "negate") ? true : false);
1554
+ });
1555
+ Assertion.addProperty("null", function() {
1556
+ this.assert(null === flag2(this, "object"), "expected #{this} to be null", "expected #{this} not to be null");
1557
+ });
1558
+ Assertion.addProperty("undefined", function() {
1559
+ this.assert(void 0 === flag2(this, "object"), "expected #{this} to be undefined", "expected #{this} not to be undefined");
1560
+ });
1561
+ Assertion.addProperty("NaN", function() {
1562
+ this.assert(isNaN2(flag2(this, "object")), "expected #{this} to be NaN", "expected #{this} not to be NaN");
1563
+ });
1564
+ function assertExist() {
1565
+ let val = flag2(this, "object");
1566
+ this.assert(val !== null && val !== void 0, "expected #{this} to exist", "expected #{this} to not exist");
1567
+ }
1568
+ __name(assertExist, "assertExist");
1569
+ Assertion.addProperty("exist", assertExist);
1570
+ Assertion.addProperty("exists", assertExist);
1571
+ Assertion.addProperty("empty", function() {
1572
+ let val = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), itemsCount;
1573
+ flagMsg = flagMsg ? flagMsg + ": " : "";
1574
+ switch (type(val).toLowerCase()) {
1575
+ case "array":
1576
+ case "string":
1577
+ itemsCount = val.length;
1578
+ break;
1579
+ case "map":
1580
+ case "set":
1581
+ itemsCount = val.size;
1582
+ break;
1583
+ case "weakmap":
1584
+ case "weakset": throw new AssertionError(flagMsg + ".empty was passed a weak collection", void 0, ssfi);
1585
+ case "function": throw new AssertionError((flagMsg + ".empty was passed a function " + getName(val)).trim(), void 0, ssfi);
1586
+ default:
1587
+ if (val !== Object(val)) throw new AssertionError(flagMsg + ".empty was passed non-string primitive " + inspect2(val), void 0, ssfi);
1588
+ itemsCount = Object.keys(val).length;
1589
+ }
1590
+ this.assert(0 === itemsCount, "expected #{this} to be empty", "expected #{this} not to be empty");
1591
+ });
1592
+ function checkArguments() {
1593
+ let type3 = type(flag2(this, "object"));
1594
+ this.assert("Arguments" === type3, "expected #{this} to be arguments but got " + type3, "expected #{this} to not be arguments");
1595
+ }
1596
+ __name(checkArguments, "checkArguments");
1597
+ Assertion.addProperty("arguments", checkArguments);
1598
+ Assertion.addProperty("Arguments", checkArguments);
1599
+ function assertEqual(val, msg) {
1600
+ if (msg) flag2(this, "message", msg);
1601
+ let obj = flag2(this, "object");
1602
+ if (flag2(this, "deep")) {
1603
+ let prevLockSsfi = flag2(this, "lockSsfi");
1604
+ flag2(this, "lockSsfi", true);
1605
+ this.eql(val);
1606
+ flag2(this, "lockSsfi", prevLockSsfi);
1607
+ } else this.assert(val === obj, "expected #{this} to equal #{exp}", "expected #{this} to not equal #{exp}", val, this._obj, true);
1608
+ }
1609
+ __name(assertEqual, "assertEqual");
1610
+ Assertion.addMethod("equal", assertEqual);
1611
+ Assertion.addMethod("equals", assertEqual);
1612
+ Assertion.addMethod("eq", assertEqual);
1613
+ function assertEql(obj, msg) {
1614
+ if (msg) flag2(this, "message", msg);
1615
+ let eql = flag2(this, "eql");
1616
+ this.assert(eql(obj, flag2(this, "object")), "expected #{this} to deeply equal #{exp}", "expected #{this} to not deeply equal #{exp}", obj, this._obj, true);
1617
+ }
1618
+ __name(assertEql, "assertEql");
1619
+ Assertion.addMethod("eql", assertEql);
1620
+ Assertion.addMethod("eqls", assertEql);
1621
+ function assertAbove(n, msg) {
1622
+ if (msg) flag2(this, "message", msg);
1623
+ let 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();
1624
+ if (doLength && objType !== "map" && objType !== "set") new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
1625
+ if (!doLength && objType === "date" && nType !== "date") throw new AssertionError(msgPrefix + "the argument to above must be a date", void 0, ssfi);
1626
+ else if (!isNumeric(n) && (doLength || isNumeric(obj))) throw new AssertionError(msgPrefix + "the argument to above must be a number", void 0, ssfi);
1627
+ else if (!doLength && objType !== "date" && !isNumeric(obj)) {
1628
+ let printObj = objType === "string" ? "'" + obj + "'" : obj;
1629
+ throw new AssertionError(msgPrefix + "expected " + printObj + " to be a number or a date", void 0, ssfi);
1630
+ }
1631
+ if (doLength) {
1632
+ let descriptor = "length", itemsCount;
1633
+ if (objType === "map" || objType === "set") {
1634
+ descriptor = "size";
1635
+ itemsCount = obj.size;
1636
+ } else itemsCount = obj.length;
1637
+ this.assert(itemsCount > n, "expected #{this} to have a " + descriptor + " above #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " above #{exp}", n, itemsCount);
1638
+ } else this.assert(obj > n, "expected #{this} to be above #{exp}", "expected #{this} to be at most #{exp}", n);
1639
+ }
1640
+ __name(assertAbove, "assertAbove");
1641
+ Assertion.addMethod("above", assertAbove);
1642
+ Assertion.addMethod("gt", assertAbove);
1643
+ Assertion.addMethod("greaterThan", assertAbove);
1644
+ function assertLeast(n, msg) {
1645
+ if (msg) flag2(this, "message", msg);
1646
+ let 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;
1647
+ if (doLength && objType !== "map" && objType !== "set") new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
1648
+ if (!doLength && objType === "date" && nType !== "date") errorMessage = msgPrefix + "the argument to least must be a date";
1649
+ else if (!isNumeric(n) && (doLength || isNumeric(obj))) errorMessage = msgPrefix + "the argument to least must be a number";
1650
+ else if (!doLength && objType !== "date" && !isNumeric(obj)) {
1651
+ let printObj = objType === "string" ? "'" + obj + "'" : obj;
1652
+ errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
1653
+ } else shouldThrow = false;
1654
+ if (shouldThrow) throw new AssertionError(errorMessage, void 0, ssfi);
1655
+ if (doLength) {
1656
+ let descriptor = "length", itemsCount;
1657
+ if (objType === "map" || objType === "set") {
1658
+ descriptor = "size";
1659
+ itemsCount = obj.size;
1660
+ } else itemsCount = obj.length;
1661
+ this.assert(itemsCount >= n, "expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}", "expected #{this} to have a " + descriptor + " below #{exp}", n, itemsCount);
1662
+ } else this.assert(obj >= n, "expected #{this} to be at least #{exp}", "expected #{this} to be below #{exp}", n);
1663
+ }
1664
+ __name(assertLeast, "assertLeast");
1665
+ Assertion.addMethod("least", assertLeast);
1666
+ Assertion.addMethod("gte", assertLeast);
1667
+ Assertion.addMethod("greaterThanOrEqual", assertLeast);
1668
+ function assertBelow(n, msg) {
1669
+ if (msg) flag2(this, "message", msg);
1670
+ let 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;
1671
+ if (doLength && objType !== "map" && objType !== "set") new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
1672
+ if (!doLength && objType === "date" && nType !== "date") errorMessage = msgPrefix + "the argument to below must be a date";
1673
+ else if (!isNumeric(n) && (doLength || isNumeric(obj))) errorMessage = msgPrefix + "the argument to below must be a number";
1674
+ else if (!doLength && objType !== "date" && !isNumeric(obj)) {
1675
+ let printObj = objType === "string" ? "'" + obj + "'" : obj;
1676
+ errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
1677
+ } else shouldThrow = false;
1678
+ if (shouldThrow) throw new AssertionError(errorMessage, void 0, ssfi);
1679
+ if (doLength) {
1680
+ let descriptor = "length", itemsCount;
1681
+ if (objType === "map" || objType === "set") {
1682
+ descriptor = "size";
1683
+ itemsCount = obj.size;
1684
+ } else itemsCount = obj.length;
1685
+ this.assert(itemsCount < n, "expected #{this} to have a " + descriptor + " below #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " below #{exp}", n, itemsCount);
1686
+ } else this.assert(obj < n, "expected #{this} to be below #{exp}", "expected #{this} to be at least #{exp}", n);
1687
+ }
1688
+ __name(assertBelow, "assertBelow");
1689
+ Assertion.addMethod("below", assertBelow);
1690
+ Assertion.addMethod("lt", assertBelow);
1691
+ Assertion.addMethod("lessThan", assertBelow);
1692
+ function assertMost(n, msg) {
1693
+ if (msg) flag2(this, "message", msg);
1694
+ let 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;
1695
+ if (doLength && objType !== "map" && objType !== "set") new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
1696
+ if (!doLength && objType === "date" && nType !== "date") errorMessage = msgPrefix + "the argument to most must be a date";
1697
+ else if (!isNumeric(n) && (doLength || isNumeric(obj))) errorMessage = msgPrefix + "the argument to most must be a number";
1698
+ else if (!doLength && objType !== "date" && !isNumeric(obj)) {
1699
+ let printObj = objType === "string" ? "'" + obj + "'" : obj;
1700
+ errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
1701
+ } else shouldThrow = false;
1702
+ if (shouldThrow) throw new AssertionError(errorMessage, void 0, ssfi);
1703
+ if (doLength) {
1704
+ let descriptor = "length", itemsCount;
1705
+ if (objType === "map" || objType === "set") {
1706
+ descriptor = "size";
1707
+ itemsCount = obj.size;
1708
+ } else itemsCount = obj.length;
1709
+ this.assert(itemsCount <= n, "expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}", "expected #{this} to have a " + descriptor + " above #{exp}", n, itemsCount);
1710
+ } else this.assert(obj <= n, "expected #{this} to be at most #{exp}", "expected #{this} to be above #{exp}", n);
1711
+ }
1712
+ __name(assertMost, "assertMost");
1713
+ Assertion.addMethod("most", assertMost);
1714
+ Assertion.addMethod("lte", assertMost);
1715
+ Assertion.addMethod("lessThanOrEqual", assertMost);
1716
+ Assertion.addMethod("within", function(start, finish, msg) {
1717
+ if (msg) flag2(this, "message", msg);
1718
+ let 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;
1719
+ if (doLength && objType !== "map" && objType !== "set") new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
1720
+ if (!doLength && objType === "date" && (startType !== "date" || finishType !== "date")) errorMessage = msgPrefix + "the arguments to within must be dates";
1721
+ else if ((!isNumeric(start) || !isNumeric(finish)) && (doLength || isNumeric(obj))) errorMessage = msgPrefix + "the arguments to within must be numbers";
1722
+ else if (!doLength && objType !== "date" && !isNumeric(obj)) {
1723
+ let printObj = objType === "string" ? "'" + obj + "'" : obj;
1724
+ errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
1725
+ } else shouldThrow = false;
1726
+ if (shouldThrow) throw new AssertionError(errorMessage, void 0, ssfi);
1727
+ if (doLength) {
1728
+ let descriptor = "length", itemsCount;
1729
+ if (objType === "map" || objType === "set") {
1730
+ descriptor = "size";
1731
+ itemsCount = obj.size;
1732
+ } else itemsCount = obj.length;
1733
+ this.assert(itemsCount >= start && itemsCount <= finish, "expected #{this} to have a " + descriptor + " within " + range, "expected #{this} to not have a " + descriptor + " within " + range);
1734
+ } else this.assert(obj >= start && obj <= finish, "expected #{this} to be within " + range, "expected #{this} to not be within " + range);
1735
+ });
1736
+ function assertInstanceOf(constructor, msg) {
1737
+ if (msg) flag2(this, "message", msg);
1738
+ let target = flag2(this, "object");
1739
+ let ssfi = flag2(this, "ssfi");
1740
+ let flagMsg = flag2(this, "message");
1741
+ let isInstanceOf;
1742
+ try {
1743
+ isInstanceOf = target instanceof constructor;
1744
+ } catch (err) {
1745
+ if (err instanceof TypeError) {
1746
+ flagMsg = flagMsg ? flagMsg + ": " : "";
1747
+ throw new AssertionError(flagMsg + "The instanceof assertion needs a constructor but " + type(constructor) + " was given.", void 0, ssfi);
1748
+ }
1749
+ throw err;
1750
+ }
1751
+ let name = getName(constructor);
1752
+ if (name == null) name = "an unnamed constructor";
1753
+ this.assert(isInstanceOf, "expected #{this} to be an instance of " + name, "expected #{this} to not be an instance of " + name);
1754
+ }
1755
+ __name(assertInstanceOf, "assertInstanceOf");
1756
+ Assertion.addMethod("instanceof", assertInstanceOf);
1757
+ Assertion.addMethod("instanceOf", assertInstanceOf);
1758
+ function assertProperty(name, val, msg) {
1759
+ if (msg) flag2(this, "message", msg);
1760
+ let isNested = flag2(this, "nested"), isOwn = flag2(this, "own"), flagMsg = flag2(this, "message"), obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), nameType = typeof name;
1761
+ flagMsg = flagMsg ? flagMsg + ": " : "";
1762
+ if (isNested) {
1763
+ if (nameType !== "string") throw new AssertionError(flagMsg + "the argument to property must be a string when using nested syntax", void 0, ssfi);
1764
+ } else if (nameType !== "string" && nameType !== "number" && nameType !== "symbol") throw new AssertionError(flagMsg + "the argument to property must be a string, number, or symbol", void 0, ssfi);
1765
+ if (isNested && isOwn) throw new AssertionError(flagMsg + "The \"nested\" and \"own\" flags cannot be combined.", void 0, ssfi);
1766
+ if (obj === null || obj === void 0) throw new AssertionError(flagMsg + "Target cannot be null or undefined.", void 0, ssfi);
1767
+ let 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;
1768
+ let descriptor = "";
1769
+ if (isDeep) descriptor += "deep ";
1770
+ if (isOwn) descriptor += "own ";
1771
+ if (isNested) descriptor += "nested ";
1772
+ descriptor += "property ";
1773
+ let hasProperty2;
1774
+ if (isOwn) hasProperty2 = Object.prototype.hasOwnProperty.call(obj, name);
1775
+ else if (isNested) hasProperty2 = pathInfo.exists;
1776
+ else hasProperty2 = hasProperty(obj, name);
1777
+ if (!negate || arguments.length === 1) this.assert(hasProperty2, "expected #{this} to have " + descriptor + inspect2(name), "expected #{this} to not have " + descriptor + inspect2(name));
1778
+ if (arguments.length > 1) this.assert(hasProperty2 && isEql(val, value), "expected #{this} to have " + descriptor + inspect2(name) + " of #{exp}, but got #{act}", "expected #{this} to not have " + descriptor + inspect2(name) + " of #{act}", val, value);
1779
+ flag2(this, "object", value);
1780
+ }
1781
+ __name(assertProperty, "assertProperty");
1782
+ Assertion.addMethod("property", assertProperty);
1783
+ function assertOwnProperty(_name, _value, _msg) {
1784
+ flag2(this, "own", true);
1785
+ assertProperty.apply(this, arguments);
1786
+ }
1787
+ __name(assertOwnProperty, "assertOwnProperty");
1788
+ Assertion.addMethod("ownProperty", assertOwnProperty);
1789
+ Assertion.addMethod("haveOwnProperty", assertOwnProperty);
1790
+ function assertOwnPropertyDescriptor(name, descriptor, msg) {
1791
+ if (typeof descriptor === "string") {
1792
+ msg = descriptor;
1793
+ descriptor = null;
1794
+ }
1795
+ if (msg) flag2(this, "message", msg);
1796
+ let obj = flag2(this, "object");
1797
+ let actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
1798
+ let eql = flag2(this, "eql");
1799
+ if (actualDescriptor && descriptor) this.assert(eql(descriptor, actualDescriptor), "expected the own property descriptor for " + inspect2(name) + " on #{this} to match " + inspect2(descriptor) + ", got " + inspect2(actualDescriptor), "expected the own property descriptor for " + inspect2(name) + " on #{this} to not match " + inspect2(descriptor), descriptor, actualDescriptor, true);
1800
+ else this.assert(actualDescriptor, "expected #{this} to have an own property descriptor for " + inspect2(name), "expected #{this} to not have an own property descriptor for " + inspect2(name));
1801
+ flag2(this, "object", actualDescriptor);
1802
+ }
1803
+ __name(assertOwnPropertyDescriptor, "assertOwnPropertyDescriptor");
1804
+ Assertion.addMethod("ownPropertyDescriptor", assertOwnPropertyDescriptor);
1805
+ Assertion.addMethod("haveOwnPropertyDescriptor", assertOwnPropertyDescriptor);
1806
+ function assertLengthChain() {
1807
+ flag2(this, "doLength", true);
1808
+ }
1809
+ __name(assertLengthChain, "assertLengthChain");
1810
+ function assertLength(n, msg) {
1811
+ if (msg) flag2(this, "message", msg);
1812
+ let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), descriptor = "length", itemsCount;
1813
+ switch (objType) {
1814
+ case "map":
1815
+ case "set":
1816
+ descriptor = "size";
1817
+ itemsCount = obj.size;
1818
+ break;
1819
+ default:
1820
+ new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
1821
+ itemsCount = obj.length;
1822
+ }
1823
+ this.assert(itemsCount == n, "expected #{this} to have a " + descriptor + " of #{exp} but got #{act}", "expected #{this} to not have a " + descriptor + " of #{act}", n, itemsCount);
1824
+ }
1825
+ __name(assertLength, "assertLength");
1826
+ Assertion.addChainableMethod("length", assertLength, assertLengthChain);
1827
+ Assertion.addChainableMethod("lengthOf", assertLength, assertLengthChain);
1828
+ function assertMatch(re, msg) {
1829
+ if (msg) flag2(this, "message", msg);
1830
+ let obj = flag2(this, "object");
1831
+ this.assert(re.exec(obj), "expected #{this} to match " + re, "expected #{this} not to match " + re);
1832
+ }
1833
+ __name(assertMatch, "assertMatch");
1834
+ Assertion.addMethod("match", assertMatch);
1835
+ Assertion.addMethod("matches", assertMatch);
1836
+ Assertion.addMethod("string", function(str, msg) {
1837
+ if (msg) flag2(this, "message", msg);
1838
+ let obj = flag2(this, "object");
1839
+ new Assertion(obj, flag2(this, "message"), flag2(this, "ssfi"), true).is.a("string");
1840
+ this.assert(~obj.indexOf(str), "expected #{this} to contain " + inspect2(str), "expected #{this} to not contain " + inspect2(str));
1841
+ });
1842
+ function assertKeys(keys) {
1843
+ let 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");
1844
+ flagMsg = flagMsg ? flagMsg + ": " : "";
1845
+ let mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
1846
+ if (objType === "Map" || objType === "Set") {
1847
+ deepStr = isDeep ? "deeply " : "";
1848
+ actual = [];
1849
+ obj.forEach(function(val, key) {
1850
+ actual.push(key);
1851
+ });
1852
+ if (keysType !== "Array") keys = Array.prototype.slice.call(arguments);
1853
+ } else {
1854
+ actual = getOwnEnumerableProperties(obj);
1855
+ switch (keysType) {
1856
+ case "Array":
1857
+ if (arguments.length > 1) throw new AssertionError(mixedArgsMsg, void 0, ssfi);
1858
+ break;
1859
+ case "Object":
1860
+ if (arguments.length > 1) throw new AssertionError(mixedArgsMsg, void 0, ssfi);
1861
+ keys = Object.keys(keys);
1862
+ break;
1863
+ default: keys = Array.prototype.slice.call(arguments);
1864
+ }
1865
+ keys = keys.map(function(val) {
1866
+ return typeof val === "symbol" ? val : String(val);
1867
+ });
1868
+ }
1869
+ if (!keys.length) throw new AssertionError(flagMsg + "keys required", void 0, ssfi);
1870
+ let len = keys.length, any = flag2(this, "any"), all = flag2(this, "all"), expected = keys, isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
1871
+ if (!any && !all) all = true;
1872
+ if (any) ok = expected.some(function(expectedKey) {
1873
+ return actual.some(function(actualKey) {
1874
+ return isEql(expectedKey, actualKey);
1875
+ });
1876
+ });
1877
+ if (all) {
1878
+ ok = expected.every(function(expectedKey) {
1879
+ return actual.some(function(actualKey) {
1880
+ return isEql(expectedKey, actualKey);
1881
+ });
1882
+ });
1883
+ if (!flag2(this, "contains")) ok = ok && keys.length == actual.length;
1884
+ }
1885
+ if (len > 1) {
1886
+ keys = keys.map(function(key) {
1887
+ return inspect2(key);
1888
+ });
1889
+ let last = keys.pop();
1890
+ if (all) str = keys.join(", ") + ", and " + last;
1891
+ if (any) str = keys.join(", ") + ", or " + last;
1892
+ } else str = inspect2(keys[0]);
1893
+ str = (len > 1 ? "keys " : "key ") + str;
1894
+ str = (flag2(this, "contains") ? "contain " : "have ") + str;
1895
+ this.assert(ok, "expected #{this} to " + deepStr + str, "expected #{this} to not " + deepStr + str, expected.slice(0).sort(compareByInspect), actual.sort(compareByInspect), true);
1896
+ }
1897
+ __name(assertKeys, "assertKeys");
1898
+ Assertion.addMethod("keys", assertKeys);
1899
+ Assertion.addMethod("key", assertKeys);
1900
+ function assertThrows(errorLike, errMsgMatcher, msg) {
1901
+ if (msg) flag2(this, "message", msg);
1902
+ let obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), negate = flag2(this, "negate") || false;
1903
+ new Assertion(obj, flagMsg, ssfi, true).is.a("function");
1904
+ if (isRegExp2(errorLike) || typeof errorLike === "string") {
1905
+ errMsgMatcher = errorLike;
1906
+ errorLike = null;
1907
+ }
1908
+ let caughtErr;
1909
+ let errorWasThrown = false;
1910
+ try {
1911
+ obj();
1912
+ } catch (err) {
1913
+ errorWasThrown = true;
1914
+ caughtErr = err;
1915
+ }
1916
+ let everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0;
1917
+ let everyArgIsDefined = Boolean(errorLike && errMsgMatcher);
1918
+ let errorLikeFail = false;
1919
+ let errMsgMatcherFail = false;
1920
+ if (everyArgIsUndefined || !everyArgIsUndefined && !negate) {
1921
+ let errorLikeString = "an error";
1922
+ if (errorLike instanceof Error) errorLikeString = "#{exp}";
1923
+ else if (errorLike) errorLikeString = check_error_exports.getConstructorName(errorLike);
1924
+ let actual = caughtErr;
1925
+ if (caughtErr instanceof Error) actual = caughtErr.toString();
1926
+ else if (typeof caughtErr === "string") actual = caughtErr;
1927
+ else if (caughtErr && (typeof caughtErr === "object" || typeof caughtErr === "function")) try {
1928
+ actual = check_error_exports.getConstructorName(caughtErr);
1929
+ } catch (_err) {}
1930
+ this.assert(errorWasThrown, "expected #{this} to throw " + errorLikeString, "expected #{this} to not throw an error but #{act} was thrown", errorLike && errorLike.toString(), actual);
1931
+ }
1932
+ if (errorLike && caughtErr) {
1933
+ if (errorLike instanceof Error) {
1934
+ if (check_error_exports.compatibleInstance(caughtErr, errorLike) === negate) if (everyArgIsDefined && negate) errorLikeFail = true;
1935
+ else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""), errorLike.toString(), caughtErr.toString());
1936
+ }
1937
+ if (check_error_exports.compatibleConstructor(caughtErr, errorLike) === negate) if (everyArgIsDefined && negate) errorLikeFail = true;
1938
+ else this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr));
1939
+ }
1940
+ if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) {
1941
+ let placeholder = "including";
1942
+ if (isRegExp2(errMsgMatcher)) placeholder = "matching";
1943
+ if (check_error_exports.compatibleMessage(caughtErr, errMsgMatcher) === negate) if (everyArgIsDefined && negate) errMsgMatcherFail = true;
1944
+ else this.assert(negate, "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}", "expected #{this} to throw error not " + placeholder + " #{exp}", errMsgMatcher, check_error_exports.getMessage(caughtErr));
1945
+ }
1946
+ if (errorLikeFail && errMsgMatcherFail) this.assert(negate, "expected #{this} to throw #{exp} but #{act} was thrown", "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr));
1947
+ flag2(this, "object", caughtErr);
1948
+ }
1949
+ __name(assertThrows, "assertThrows");
1950
+ Assertion.addMethod("throw", assertThrows);
1951
+ Assertion.addMethod("throws", assertThrows);
1952
+ Assertion.addMethod("Throw", assertThrows);
1953
+ function respondTo(method, msg) {
1954
+ if (msg) flag2(this, "message", msg);
1955
+ let obj = flag2(this, "object"), itself = flag2(this, "itself"), context = "function" === typeof obj && !itself ? obj.prototype[method] : obj[method];
1956
+ this.assert("function" === typeof context, "expected #{this} to respond to " + inspect2(method), "expected #{this} to not respond to " + inspect2(method));
1957
+ }
1958
+ __name(respondTo, "respondTo");
1959
+ Assertion.addMethod("respondTo", respondTo);
1960
+ Assertion.addMethod("respondsTo", respondTo);
1961
+ Assertion.addProperty("itself", function() {
1962
+ flag2(this, "itself", true);
1963
+ });
1964
+ function satisfy(matcher, msg) {
1965
+ if (msg) flag2(this, "message", msg);
1966
+ let result = matcher(flag2(this, "object"));
1967
+ this.assert(result, "expected #{this} to satisfy " + objDisplay(matcher), "expected #{this} to not satisfy" + objDisplay(matcher), flag2(this, "negate") ? false : true, result);
1968
+ }
1969
+ __name(satisfy, "satisfy");
1970
+ Assertion.addMethod("satisfy", satisfy);
1971
+ Assertion.addMethod("satisfies", satisfy);
1972
+ function closeTo(expected, delta, msg) {
1973
+ if (msg) flag2(this, "message", msg);
1974
+ let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
1975
+ new Assertion(obj, flagMsg, ssfi, true).is.numeric;
1976
+ let message = "A `delta` value is required for `closeTo`";
1977
+ if (delta == void 0) throw new AssertionError(flagMsg ? `${flagMsg}: ${message}` : message, void 0, ssfi);
1978
+ new Assertion(delta, flagMsg, ssfi, true).is.numeric;
1979
+ message = "A `expected` value is required for `closeTo`";
1980
+ if (expected == void 0) throw new AssertionError(flagMsg ? `${flagMsg}: ${message}` : message, void 0, ssfi);
1981
+ new Assertion(expected, flagMsg, ssfi, true).is.numeric;
1982
+ const abs = /* @__PURE__ */ __name((x) => x < 0n ? -x : x, "abs");
1983
+ const strip = /* @__PURE__ */ __name((number) => parseFloat(parseFloat(number).toPrecision(12)), "strip");
1984
+ this.assert(strip(abs(obj - expected)) <= delta, "expected #{this} to be close to " + expected + " +/- " + delta, "expected #{this} not to be close to " + expected + " +/- " + delta);
1985
+ }
1986
+ __name(closeTo, "closeTo");
1987
+ Assertion.addMethod("closeTo", closeTo);
1988
+ Assertion.addMethod("approximately", closeTo);
1989
+ function isSubsetOf(_subset, _superset, cmp, contains, ordered) {
1990
+ let superset = Array.from(_superset);
1991
+ let subset = Array.from(_subset);
1992
+ if (!contains) {
1993
+ if (subset.length !== superset.length) return false;
1994
+ superset = superset.slice();
1995
+ }
1996
+ return subset.every(function(elem, idx) {
1997
+ if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];
1998
+ if (!cmp) {
1999
+ let matchIdx = superset.indexOf(elem);
2000
+ if (matchIdx === -1) return false;
2001
+ if (!contains) superset.splice(matchIdx, 1);
2002
+ return true;
2003
+ }
2004
+ return superset.some(function(elem2, matchIdx) {
2005
+ if (!cmp(elem, elem2)) return false;
2006
+ if (!contains) superset.splice(matchIdx, 1);
2007
+ return true;
2008
+ });
2009
+ });
2010
+ }
2011
+ __name(isSubsetOf, "isSubsetOf");
2012
+ Assertion.addMethod("members", function(subset, msg) {
2013
+ if (msg) flag2(this, "message", msg);
2014
+ let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
2015
+ new Assertion(obj, flagMsg, ssfi, true).to.be.iterable;
2016
+ new Assertion(subset, flagMsg, ssfi, true).to.be.iterable;
2017
+ let contains = flag2(this, "contains");
2018
+ let ordered = flag2(this, "ordered");
2019
+ let subject, failMsg, failNegateMsg;
2020
+ if (contains) {
2021
+ subject = ordered ? "an ordered superset" : "a superset";
2022
+ failMsg = "expected #{this} to be " + subject + " of #{exp}";
2023
+ failNegateMsg = "expected #{this} to not be " + subject + " of #{exp}";
2024
+ } else {
2025
+ subject = ordered ? "ordered members" : "members";
2026
+ failMsg = "expected #{this} to have the same " + subject + " as #{exp}";
2027
+ failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}";
2028
+ }
2029
+ let cmp = flag2(this, "deep") ? flag2(this, "eql") : void 0;
2030
+ this.assert(isSubsetOf(subset, obj, cmp, contains, ordered), failMsg, failNegateMsg, subset, obj, true);
2031
+ });
2032
+ Assertion.addProperty("iterable", function(msg) {
2033
+ if (msg) flag2(this, "message", msg);
2034
+ let obj = flag2(this, "object");
2035
+ this.assert(obj != void 0 && obj[Symbol.iterator], "expected #{this} to be an iterable", "expected #{this} to not be an iterable", obj);
2036
+ });
2037
+ function oneOf(list, msg) {
2038
+ if (msg) flag2(this, "message", msg);
2039
+ let expected = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), contains = flag2(this, "contains"), isDeep = flag2(this, "deep"), eql = flag2(this, "eql");
2040
+ new Assertion(list, flagMsg, ssfi, true).to.be.an("array");
2041
+ if (contains) this.assert(list.some(function(possibility) {
2042
+ return expected.indexOf(possibility) > -1;
2043
+ }), "expected #{this} to contain one of #{exp}", "expected #{this} to not contain one of #{exp}", list, expected);
2044
+ else if (isDeep) this.assert(list.some(function(possibility) {
2045
+ return eql(expected, possibility);
2046
+ }), "expected #{this} to deeply equal one of #{exp}", "expected #{this} to deeply equal one of #{exp}", list, expected);
2047
+ else this.assert(list.indexOf(expected) > -1, "expected #{this} to be one of #{exp}", "expected #{this} to not be one of #{exp}", list, expected);
2048
+ }
2049
+ __name(oneOf, "oneOf");
2050
+ Assertion.addMethod("oneOf", oneOf);
2051
+ function assertChanges(subject, prop, msg) {
2052
+ if (msg) flag2(this, "message", msg);
2053
+ let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
2054
+ new Assertion(fn, flagMsg, ssfi, true).is.a("function");
2055
+ let initial;
2056
+ if (!prop) {
2057
+ new Assertion(subject, flagMsg, ssfi, true).is.a("function");
2058
+ initial = subject();
2059
+ } else {
2060
+ new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
2061
+ initial = subject[prop];
2062
+ }
2063
+ fn();
2064
+ let final = prop === void 0 || prop === null ? subject() : subject[prop];
2065
+ let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
2066
+ flag2(this, "deltaMsgObj", msgObj);
2067
+ flag2(this, "initialDeltaValue", initial);
2068
+ flag2(this, "finalDeltaValue", final);
2069
+ flag2(this, "deltaBehavior", "change");
2070
+ flag2(this, "realDelta", final !== initial);
2071
+ this.assert(initial !== final, "expected " + msgObj + " to change", "expected " + msgObj + " to not change");
2072
+ }
2073
+ __name(assertChanges, "assertChanges");
2074
+ Assertion.addMethod("change", assertChanges);
2075
+ Assertion.addMethod("changes", assertChanges);
2076
+ function assertIncreases(subject, prop, msg) {
2077
+ if (msg) flag2(this, "message", msg);
2078
+ let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
2079
+ new Assertion(fn, flagMsg, ssfi, true).is.a("function");
2080
+ let initial;
2081
+ if (!prop) {
2082
+ new Assertion(subject, flagMsg, ssfi, true).is.a("function");
2083
+ initial = subject();
2084
+ } else {
2085
+ new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
2086
+ initial = subject[prop];
2087
+ }
2088
+ new Assertion(initial, flagMsg, ssfi, true).is.a("number");
2089
+ fn();
2090
+ let final = prop === void 0 || prop === null ? subject() : subject[prop];
2091
+ let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
2092
+ flag2(this, "deltaMsgObj", msgObj);
2093
+ flag2(this, "initialDeltaValue", initial);
2094
+ flag2(this, "finalDeltaValue", final);
2095
+ flag2(this, "deltaBehavior", "increase");
2096
+ flag2(this, "realDelta", final - initial);
2097
+ this.assert(final - initial > 0, "expected " + msgObj + " to increase", "expected " + msgObj + " to not increase");
2098
+ }
2099
+ __name(assertIncreases, "assertIncreases");
2100
+ Assertion.addMethod("increase", assertIncreases);
2101
+ Assertion.addMethod("increases", assertIncreases);
2102
+ function assertDecreases(subject, prop, msg) {
2103
+ if (msg) flag2(this, "message", msg);
2104
+ let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
2105
+ new Assertion(fn, flagMsg, ssfi, true).is.a("function");
2106
+ let initial;
2107
+ if (!prop) {
2108
+ new Assertion(subject, flagMsg, ssfi, true).is.a("function");
2109
+ initial = subject();
2110
+ } else {
2111
+ new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
2112
+ initial = subject[prop];
2113
+ }
2114
+ new Assertion(initial, flagMsg, ssfi, true).is.a("number");
2115
+ fn();
2116
+ let final = prop === void 0 || prop === null ? subject() : subject[prop];
2117
+ let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
2118
+ flag2(this, "deltaMsgObj", msgObj);
2119
+ flag2(this, "initialDeltaValue", initial);
2120
+ flag2(this, "finalDeltaValue", final);
2121
+ flag2(this, "deltaBehavior", "decrease");
2122
+ flag2(this, "realDelta", initial - final);
2123
+ this.assert(final - initial < 0, "expected " + msgObj + " to decrease", "expected " + msgObj + " to not decrease");
2124
+ }
2125
+ __name(assertDecreases, "assertDecreases");
2126
+ Assertion.addMethod("decrease", assertDecreases);
2127
+ Assertion.addMethod("decreases", assertDecreases);
2128
+ function assertDelta(delta, msg) {
2129
+ if (msg) flag2(this, "message", msg);
2130
+ let msgObj = flag2(this, "deltaMsgObj");
2131
+ let initial = flag2(this, "initialDeltaValue");
2132
+ let final = flag2(this, "finalDeltaValue");
2133
+ let behavior = flag2(this, "deltaBehavior");
2134
+ let realDelta = flag2(this, "realDelta");
2135
+ let expression;
2136
+ if (behavior === "change") expression = Math.abs(final - initial) === Math.abs(delta);
2137
+ else expression = realDelta === Math.abs(delta);
2138
+ this.assert(expression, "expected " + msgObj + " to " + behavior + " by " + delta, "expected " + msgObj + " to not " + behavior + " by " + delta);
2139
+ }
2140
+ __name(assertDelta, "assertDelta");
2141
+ Assertion.addMethod("by", assertDelta);
2142
+ Assertion.addProperty("extensible", function() {
2143
+ let obj = flag2(this, "object");
2144
+ let isExtensible = obj === Object(obj) && Object.isExtensible(obj);
2145
+ this.assert(isExtensible, "expected #{this} to be extensible", "expected #{this} to not be extensible");
2146
+ });
2147
+ Assertion.addProperty("sealed", function() {
2148
+ let obj = flag2(this, "object");
2149
+ let isSealed = obj === Object(obj) ? Object.isSealed(obj) : true;
2150
+ this.assert(isSealed, "expected #{this} to be sealed", "expected #{this} to not be sealed");
2151
+ });
2152
+ Assertion.addProperty("frozen", function() {
2153
+ let obj = flag2(this, "object");
2154
+ let isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true;
2155
+ this.assert(isFrozen, "expected #{this} to be frozen", "expected #{this} to not be frozen");
2156
+ });
2157
+ Assertion.addProperty("finite", function(_msg) {
2158
+ let obj = flag2(this, "object");
2159
+ this.assert(typeof obj === "number" && isFinite(obj), "expected #{this} to be a finite number", "expected #{this} to not be a finite number");
2160
+ });
2161
+ function compareSubset(expected, actual) {
2162
+ if (expected === actual) return true;
2163
+ if (typeof actual !== typeof expected) return false;
2164
+ if (typeof expected !== "object" || expected === null) return expected === actual;
2165
+ if (!actual) return false;
2166
+ if (Array.isArray(expected)) {
2167
+ if (!Array.isArray(actual)) return false;
2168
+ return expected.every(function(exp) {
2169
+ return actual.some(function(act) {
2170
+ return compareSubset(exp, act);
2171
+ });
2172
+ });
2173
+ }
2174
+ if (expected instanceof Date) if (actual instanceof Date) return expected.getTime() === actual.getTime();
2175
+ else return false;
2176
+ return Object.keys(expected).every(function(key) {
2177
+ let expectedValue = expected[key];
2178
+ let actualValue = actual[key];
2179
+ if (typeof expectedValue === "object" && expectedValue !== null && actualValue !== null) return compareSubset(expectedValue, actualValue);
2180
+ if (typeof expectedValue === "function") return expectedValue(actualValue);
2181
+ return actualValue === expectedValue;
2182
+ });
2183
+ }
2184
+ __name(compareSubset, "compareSubset");
2185
+ Assertion.addMethod("containSubset", function(expected) {
2186
+ const actual = flag(this, "object");
2187
+ const showDiff = config.showDiff;
2188
+ this.assert(compareSubset(expected, actual), "expected #{act} to contain subset #{exp}", "expected #{act} to not contain subset #{exp}", expected, actual, showDiff);
2189
+ });
2190
+ function expect(val, message) {
2191
+ return new Assertion(val, message);
2192
+ }
2193
+ __name(expect, "expect");
2194
+ expect.fail = function(actual, expected, message, operator) {
2195
+ if (arguments.length < 2) {
2196
+ message = actual;
2197
+ actual = void 0;
2198
+ }
2199
+ message = message || "expect.fail()";
2200
+ throw new AssertionError(message, {
2201
+ actual,
2202
+ expected,
2203
+ operator
2204
+ }, expect.fail);
2205
+ };
2206
+ var should_exports = {};
2207
+ __export(should_exports, {
2208
+ Should: () => Should,
2209
+ should: () => should
2210
+ });
2211
+ function loadShould() {
2212
+ function shouldGetter() {
2213
+ if (this instanceof String || this instanceof Number || this instanceof Boolean || typeof Symbol === "function" && this instanceof Symbol || typeof BigInt === "function" && this instanceof BigInt) return new Assertion(this.valueOf(), null, shouldGetter);
2214
+ return new Assertion(this, null, shouldGetter);
2215
+ }
2216
+ __name(shouldGetter, "shouldGetter");
2217
+ function shouldSetter(value) {
2218
+ Object.defineProperty(this, "should", {
2219
+ value,
2220
+ enumerable: true,
2221
+ configurable: true,
2222
+ writable: true
2223
+ });
2224
+ }
2225
+ __name(shouldSetter, "shouldSetter");
2226
+ Object.defineProperty(Object.prototype, "should", {
2227
+ set: shouldSetter,
2228
+ get: shouldGetter,
2229
+ configurable: true
2230
+ });
2231
+ let should2 = {};
2232
+ should2.fail = function(actual, expected, message, operator) {
2233
+ if (arguments.length < 2) {
2234
+ message = actual;
2235
+ actual = void 0;
2236
+ }
2237
+ message = message || "should.fail()";
2238
+ throw new AssertionError(message, {
2239
+ actual,
2240
+ expected,
2241
+ operator
2242
+ }, should2.fail);
2243
+ };
2244
+ should2.equal = function(actual, expected, message) {
2245
+ new Assertion(actual, message).to.equal(expected);
2246
+ };
2247
+ should2.Throw = function(fn, errt, errs, msg) {
2248
+ new Assertion(fn, msg).to.Throw(errt, errs);
2249
+ };
2250
+ should2.exist = function(val, msg) {
2251
+ new Assertion(val, msg).to.exist;
2252
+ };
2253
+ should2.not = {};
2254
+ should2.not.equal = function(actual, expected, msg) {
2255
+ new Assertion(actual, msg).to.not.equal(expected);
2256
+ };
2257
+ should2.not.Throw = function(fn, errt, errs, msg) {
2258
+ new Assertion(fn, msg).to.not.Throw(errt, errs);
2259
+ };
2260
+ should2.not.exist = function(val, msg) {
2261
+ new Assertion(val, msg).to.not.exist;
2262
+ };
2263
+ should2["throw"] = should2["Throw"];
2264
+ should2.not["throw"] = should2.not["Throw"];
2265
+ return should2;
2266
+ }
2267
+ __name(loadShould, "loadShould");
2268
+ var should = loadShould;
2269
+ var Should = loadShould;
2270
+ function assert(express, errmsg) {
2271
+ new Assertion(null, null, assert, true).assert(express, errmsg, "[ negation message unavailable ]");
2272
+ }
2273
+ __name(assert, "assert");
2274
+ assert.fail = function(actual, expected, message, operator) {
2275
+ if (arguments.length < 2) {
2276
+ message = actual;
2277
+ actual = void 0;
2278
+ }
2279
+ message = message || "assert.fail()";
2280
+ throw new AssertionError(message, {
2281
+ actual,
2282
+ expected,
2283
+ operator
2284
+ }, assert.fail);
2285
+ };
2286
+ assert.isOk = function(val, msg) {
2287
+ new Assertion(val, msg, assert.isOk, true).is.ok;
2288
+ };
2289
+ assert.isNotOk = function(val, msg) {
2290
+ new Assertion(val, msg, assert.isNotOk, true).is.not.ok;
2291
+ };
2292
+ assert.equal = function(act, exp, msg) {
2293
+ let test2 = new Assertion(act, msg, assert.equal, true);
2294
+ test2.assert(exp == flag(test2, "object"), "expected #{this} to equal #{exp}", "expected #{this} to not equal #{act}", exp, act, true);
2295
+ };
2296
+ assert.notEqual = function(act, exp, msg) {
2297
+ let test2 = new Assertion(act, msg, assert.notEqual, true);
2298
+ test2.assert(exp != flag(test2, "object"), "expected #{this} to not equal #{exp}", "expected #{this} to equal #{act}", exp, act, true);
2299
+ };
2300
+ assert.strictEqual = function(act, exp, msg) {
2301
+ new Assertion(act, msg, assert.strictEqual, true).to.equal(exp);
2302
+ };
2303
+ assert.notStrictEqual = function(act, exp, msg) {
2304
+ new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp);
2305
+ };
2306
+ assert.deepEqual = assert.deepStrictEqual = function(act, exp, msg) {
2307
+ new Assertion(act, msg, assert.deepEqual, true).to.eql(exp);
2308
+ };
2309
+ assert.notDeepEqual = function(act, exp, msg) {
2310
+ new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp);
2311
+ };
2312
+ assert.isAbove = function(val, abv, msg) {
2313
+ new Assertion(val, msg, assert.isAbove, true).to.be.above(abv);
2314
+ };
2315
+ assert.isAtLeast = function(val, atlst, msg) {
2316
+ new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst);
2317
+ };
2318
+ assert.isBelow = function(val, blw, msg) {
2319
+ new Assertion(val, msg, assert.isBelow, true).to.be.below(blw);
2320
+ };
2321
+ assert.isAtMost = function(val, atmst, msg) {
2322
+ new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst);
2323
+ };
2324
+ assert.isTrue = function(val, msg) {
2325
+ new Assertion(val, msg, assert.isTrue, true).is["true"];
2326
+ };
2327
+ assert.isNotTrue = function(val, msg) {
2328
+ new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true);
2329
+ };
2330
+ assert.isFalse = function(val, msg) {
2331
+ new Assertion(val, msg, assert.isFalse, true).is["false"];
2332
+ };
2333
+ assert.isNotFalse = function(val, msg) {
2334
+ new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false);
2335
+ };
2336
+ assert.isNull = function(val, msg) {
2337
+ new Assertion(val, msg, assert.isNull, true).to.equal(null);
2338
+ };
2339
+ assert.isNotNull = function(val, msg) {
2340
+ new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null);
2341
+ };
2342
+ assert.isNaN = function(val, msg) {
2343
+ new Assertion(val, msg, assert.isNaN, true).to.be.NaN;
2344
+ };
2345
+ assert.isNotNaN = function(value, message) {
2346
+ new Assertion(value, message, assert.isNotNaN, true).not.to.be.NaN;
2347
+ };
2348
+ assert.exists = function(val, msg) {
2349
+ new Assertion(val, msg, assert.exists, true).to.exist;
2350
+ };
2351
+ assert.notExists = function(val, msg) {
2352
+ new Assertion(val, msg, assert.notExists, true).to.not.exist;
2353
+ };
2354
+ assert.isUndefined = function(val, msg) {
2355
+ new Assertion(val, msg, assert.isUndefined, true).to.equal(void 0);
2356
+ };
2357
+ assert.isDefined = function(val, msg) {
2358
+ new Assertion(val, msg, assert.isDefined, true).to.not.equal(void 0);
2359
+ };
2360
+ assert.isCallable = function(value, message) {
2361
+ new Assertion(value, message, assert.isCallable, true).is.callable;
2362
+ };
2363
+ assert.isNotCallable = function(value, message) {
2364
+ new Assertion(value, message, assert.isNotCallable, true).is.not.callable;
2365
+ };
2366
+ assert.isObject = function(val, msg) {
2367
+ new Assertion(val, msg, assert.isObject, true).to.be.a("object");
2368
+ };
2369
+ assert.isNotObject = function(val, msg) {
2370
+ new Assertion(val, msg, assert.isNotObject, true).to.not.be.a("object");
2371
+ };
2372
+ assert.isArray = function(val, msg) {
2373
+ new Assertion(val, msg, assert.isArray, true).to.be.an("array");
2374
+ };
2375
+ assert.isNotArray = function(val, msg) {
2376
+ new Assertion(val, msg, assert.isNotArray, true).to.not.be.an("array");
2377
+ };
2378
+ assert.isString = function(val, msg) {
2379
+ new Assertion(val, msg, assert.isString, true).to.be.a("string");
2380
+ };
2381
+ assert.isNotString = function(val, msg) {
2382
+ new Assertion(val, msg, assert.isNotString, true).to.not.be.a("string");
2383
+ };
2384
+ assert.isNumber = function(val, msg) {
2385
+ new Assertion(val, msg, assert.isNumber, true).to.be.a("number");
2386
+ };
2387
+ assert.isNotNumber = function(val, msg) {
2388
+ new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a("number");
2389
+ };
2390
+ assert.isNumeric = function(val, msg) {
2391
+ new Assertion(val, msg, assert.isNumeric, true).is.numeric;
2392
+ };
2393
+ assert.isNotNumeric = function(val, msg) {
2394
+ new Assertion(val, msg, assert.isNotNumeric, true).is.not.numeric;
2395
+ };
2396
+ assert.isFinite = function(val, msg) {
2397
+ new Assertion(val, msg, assert.isFinite, true).to.be.finite;
2398
+ };
2399
+ assert.isBoolean = function(val, msg) {
2400
+ new Assertion(val, msg, assert.isBoolean, true).to.be.a("boolean");
2401
+ };
2402
+ assert.isNotBoolean = function(val, msg) {
2403
+ new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a("boolean");
2404
+ };
2405
+ assert.typeOf = function(val, type3, msg) {
2406
+ new Assertion(val, msg, assert.typeOf, true).to.be.a(type3);
2407
+ };
2408
+ assert.notTypeOf = function(value, type3, message) {
2409
+ new Assertion(value, message, assert.notTypeOf, true).to.not.be.a(type3);
2410
+ };
2411
+ assert.instanceOf = function(val, type3, msg) {
2412
+ new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type3);
2413
+ };
2414
+ assert.notInstanceOf = function(val, type3, msg) {
2415
+ new Assertion(val, msg, assert.notInstanceOf, true).to.not.be.instanceOf(type3);
2416
+ };
2417
+ assert.include = function(exp, inc, msg) {
2418
+ new Assertion(exp, msg, assert.include, true).include(inc);
2419
+ };
2420
+ assert.notInclude = function(exp, inc, msg) {
2421
+ new Assertion(exp, msg, assert.notInclude, true).not.include(inc);
2422
+ };
2423
+ assert.deepInclude = function(exp, inc, msg) {
2424
+ new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc);
2425
+ };
2426
+ assert.notDeepInclude = function(exp, inc, msg) {
2427
+ new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc);
2428
+ };
2429
+ assert.nestedInclude = function(exp, inc, msg) {
2430
+ new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc);
2431
+ };
2432
+ assert.notNestedInclude = function(exp, inc, msg) {
2433
+ new Assertion(exp, msg, assert.notNestedInclude, true).not.nested.include(inc);
2434
+ };
2435
+ assert.deepNestedInclude = function(exp, inc, msg) {
2436
+ new Assertion(exp, msg, assert.deepNestedInclude, true).deep.nested.include(inc);
2437
+ };
2438
+ assert.notDeepNestedInclude = function(exp, inc, msg) {
2439
+ new Assertion(exp, msg, assert.notDeepNestedInclude, true).not.deep.nested.include(inc);
2440
+ };
2441
+ assert.ownInclude = function(exp, inc, msg) {
2442
+ new Assertion(exp, msg, assert.ownInclude, true).own.include(inc);
2443
+ };
2444
+ assert.notOwnInclude = function(exp, inc, msg) {
2445
+ new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc);
2446
+ };
2447
+ assert.deepOwnInclude = function(exp, inc, msg) {
2448
+ new Assertion(exp, msg, assert.deepOwnInclude, true).deep.own.include(inc);
2449
+ };
2450
+ assert.notDeepOwnInclude = function(exp, inc, msg) {
2451
+ new Assertion(exp, msg, assert.notDeepOwnInclude, true).not.deep.own.include(inc);
2452
+ };
2453
+ assert.match = function(exp, re, msg) {
2454
+ new Assertion(exp, msg, assert.match, true).to.match(re);
2455
+ };
2456
+ assert.notMatch = function(exp, re, msg) {
2457
+ new Assertion(exp, msg, assert.notMatch, true).to.not.match(re);
2458
+ };
2459
+ assert.property = function(obj, prop, msg) {
2460
+ new Assertion(obj, msg, assert.property, true).to.have.property(prop);
2461
+ };
2462
+ assert.notProperty = function(obj, prop, msg) {
2463
+ new Assertion(obj, msg, assert.notProperty, true).to.not.have.property(prop);
2464
+ };
2465
+ assert.propertyVal = function(obj, prop, val, msg) {
2466
+ new Assertion(obj, msg, assert.propertyVal, true).to.have.property(prop, val);
2467
+ };
2468
+ assert.notPropertyVal = function(obj, prop, val, msg) {
2469
+ new Assertion(obj, msg, assert.notPropertyVal, true).to.not.have.property(prop, val);
2470
+ };
2471
+ assert.deepPropertyVal = function(obj, prop, val, msg) {
2472
+ new Assertion(obj, msg, assert.deepPropertyVal, true).to.have.deep.property(prop, val);
2473
+ };
2474
+ assert.notDeepPropertyVal = function(obj, prop, val, msg) {
2475
+ new Assertion(obj, msg, assert.notDeepPropertyVal, true).to.not.have.deep.property(prop, val);
2476
+ };
2477
+ assert.ownProperty = function(obj, prop, msg) {
2478
+ new Assertion(obj, msg, assert.ownProperty, true).to.have.own.property(prop);
2479
+ };
2480
+ assert.notOwnProperty = function(obj, prop, msg) {
2481
+ new Assertion(obj, msg, assert.notOwnProperty, true).to.not.have.own.property(prop);
2482
+ };
2483
+ assert.ownPropertyVal = function(obj, prop, value, msg) {
2484
+ new Assertion(obj, msg, assert.ownPropertyVal, true).to.have.own.property(prop, value);
2485
+ };
2486
+ assert.notOwnPropertyVal = function(obj, prop, value, msg) {
2487
+ new Assertion(obj, msg, assert.notOwnPropertyVal, true).to.not.have.own.property(prop, value);
2488
+ };
2489
+ assert.deepOwnPropertyVal = function(obj, prop, value, msg) {
2490
+ new Assertion(obj, msg, assert.deepOwnPropertyVal, true).to.have.deep.own.property(prop, value);
2491
+ };
2492
+ assert.notDeepOwnPropertyVal = function(obj, prop, value, msg) {
2493
+ new Assertion(obj, msg, assert.notDeepOwnPropertyVal, true).to.not.have.deep.own.property(prop, value);
2494
+ };
2495
+ assert.nestedProperty = function(obj, prop, msg) {
2496
+ new Assertion(obj, msg, assert.nestedProperty, true).to.have.nested.property(prop);
2497
+ };
2498
+ assert.notNestedProperty = function(obj, prop, msg) {
2499
+ new Assertion(obj, msg, assert.notNestedProperty, true).to.not.have.nested.property(prop);
2500
+ };
2501
+ assert.nestedPropertyVal = function(obj, prop, val, msg) {
2502
+ new Assertion(obj, msg, assert.nestedPropertyVal, true).to.have.nested.property(prop, val);
2503
+ };
2504
+ assert.notNestedPropertyVal = function(obj, prop, val, msg) {
2505
+ new Assertion(obj, msg, assert.notNestedPropertyVal, true).to.not.have.nested.property(prop, val);
2506
+ };
2507
+ assert.deepNestedPropertyVal = function(obj, prop, val, msg) {
2508
+ new Assertion(obj, msg, assert.deepNestedPropertyVal, true).to.have.deep.nested.property(prop, val);
2509
+ };
2510
+ assert.notDeepNestedPropertyVal = function(obj, prop, val, msg) {
2511
+ new Assertion(obj, msg, assert.notDeepNestedPropertyVal, true).to.not.have.deep.nested.property(prop, val);
2512
+ };
2513
+ assert.lengthOf = function(exp, len, msg) {
2514
+ new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len);
2515
+ };
2516
+ assert.hasAnyKeys = function(obj, keys, msg) {
2517
+ new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys);
2518
+ };
2519
+ assert.hasAllKeys = function(obj, keys, msg) {
2520
+ new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys);
2521
+ };
2522
+ assert.containsAllKeys = function(obj, keys, msg) {
2523
+ new Assertion(obj, msg, assert.containsAllKeys, true).to.contain.all.keys(keys);
2524
+ };
2525
+ assert.doesNotHaveAnyKeys = function(obj, keys, msg) {
2526
+ new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true).to.not.have.any.keys(keys);
2527
+ };
2528
+ assert.doesNotHaveAllKeys = function(obj, keys, msg) {
2529
+ new Assertion(obj, msg, assert.doesNotHaveAllKeys, true).to.not.have.all.keys(keys);
2530
+ };
2531
+ assert.hasAnyDeepKeys = function(obj, keys, msg) {
2532
+ new Assertion(obj, msg, assert.hasAnyDeepKeys, true).to.have.any.deep.keys(keys);
2533
+ };
2534
+ assert.hasAllDeepKeys = function(obj, keys, msg) {
2535
+ new Assertion(obj, msg, assert.hasAllDeepKeys, true).to.have.all.deep.keys(keys);
2536
+ };
2537
+ assert.containsAllDeepKeys = function(obj, keys, msg) {
2538
+ new Assertion(obj, msg, assert.containsAllDeepKeys, true).to.contain.all.deep.keys(keys);
2539
+ };
2540
+ assert.doesNotHaveAnyDeepKeys = function(obj, keys, msg) {
2541
+ new Assertion(obj, msg, assert.doesNotHaveAnyDeepKeys, true).to.not.have.any.deep.keys(keys);
2542
+ };
2543
+ assert.doesNotHaveAllDeepKeys = function(obj, keys, msg) {
2544
+ new Assertion(obj, msg, assert.doesNotHaveAllDeepKeys, true).to.not.have.all.deep.keys(keys);
2545
+ };
2546
+ assert.throws = function(fn, errorLike, errMsgMatcher, msg) {
2547
+ if ("string" === typeof errorLike || errorLike instanceof RegExp) {
2548
+ errMsgMatcher = errorLike;
2549
+ errorLike = null;
2550
+ }
2551
+ return flag(new Assertion(fn, msg, assert.throws, true).to.throw(errorLike, errMsgMatcher), "object");
2552
+ };
2553
+ assert.doesNotThrow = function(fn, errorLike, errMsgMatcher, message) {
2554
+ if ("string" === typeof errorLike || errorLike instanceof RegExp) {
2555
+ errMsgMatcher = errorLike;
2556
+ errorLike = null;
2557
+ }
2558
+ new Assertion(fn, message, assert.doesNotThrow, true).to.not.throw(errorLike, errMsgMatcher);
2559
+ };
2560
+ assert.operator = function(val, operator, val2, msg) {
2561
+ let ok;
2562
+ switch (operator) {
2563
+ case "==":
2564
+ ok = val == val2;
2565
+ break;
2566
+ case "===":
2567
+ ok = val === val2;
2568
+ break;
2569
+ case ">":
2570
+ ok = val > val2;
2571
+ break;
2572
+ case ">=":
2573
+ ok = val >= val2;
2574
+ break;
2575
+ case "<":
2576
+ ok = val < val2;
2577
+ break;
2578
+ case "<=":
2579
+ ok = val <= val2;
2580
+ break;
2581
+ case "!=":
2582
+ ok = val != val2;
2583
+ break;
2584
+ case "!==":
2585
+ ok = val !== val2;
2586
+ break;
2587
+ default:
2588
+ msg = msg ? msg + ": " : msg;
2589
+ throw new AssertionError(msg + "Invalid operator \"" + operator + "\"", void 0, assert.operator);
2590
+ }
2591
+ let test2 = new Assertion(ok, msg, assert.operator, true);
2592
+ test2.assert(true === flag(test2, "object"), "expected " + inspect2(val) + " to be " + operator + " " + inspect2(val2), "expected " + inspect2(val) + " to not be " + operator + " " + inspect2(val2));
2593
+ };
2594
+ assert.closeTo = function(act, exp, delta, msg) {
2595
+ new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta);
2596
+ };
2597
+ assert.approximately = function(act, exp, delta, msg) {
2598
+ new Assertion(act, msg, assert.approximately, true).to.be.approximately(exp, delta);
2599
+ };
2600
+ assert.sameMembers = function(set1, set2, msg) {
2601
+ new Assertion(set1, msg, assert.sameMembers, true).to.have.same.members(set2);
2602
+ };
2603
+ assert.notSameMembers = function(set1, set2, msg) {
2604
+ new Assertion(set1, msg, assert.notSameMembers, true).to.not.have.same.members(set2);
2605
+ };
2606
+ assert.sameDeepMembers = function(set1, set2, msg) {
2607
+ new Assertion(set1, msg, assert.sameDeepMembers, true).to.have.same.deep.members(set2);
2608
+ };
2609
+ assert.notSameDeepMembers = function(set1, set2, msg) {
2610
+ new Assertion(set1, msg, assert.notSameDeepMembers, true).to.not.have.same.deep.members(set2);
2611
+ };
2612
+ assert.sameOrderedMembers = function(set1, set2, msg) {
2613
+ new Assertion(set1, msg, assert.sameOrderedMembers, true).to.have.same.ordered.members(set2);
2614
+ };
2615
+ assert.notSameOrderedMembers = function(set1, set2, msg) {
2616
+ new Assertion(set1, msg, assert.notSameOrderedMembers, true).to.not.have.same.ordered.members(set2);
2617
+ };
2618
+ assert.sameDeepOrderedMembers = function(set1, set2, msg) {
2619
+ new Assertion(set1, msg, assert.sameDeepOrderedMembers, true).to.have.same.deep.ordered.members(set2);
2620
+ };
2621
+ assert.notSameDeepOrderedMembers = function(set1, set2, msg) {
2622
+ new Assertion(set1, msg, assert.notSameDeepOrderedMembers, true).to.not.have.same.deep.ordered.members(set2);
2623
+ };
2624
+ assert.includeMembers = function(superset, subset, msg) {
2625
+ new Assertion(superset, msg, assert.includeMembers, true).to.include.members(subset);
2626
+ };
2627
+ assert.notIncludeMembers = function(superset, subset, msg) {
2628
+ new Assertion(superset, msg, assert.notIncludeMembers, true).to.not.include.members(subset);
2629
+ };
2630
+ assert.includeDeepMembers = function(superset, subset, msg) {
2631
+ new Assertion(superset, msg, assert.includeDeepMembers, true).to.include.deep.members(subset);
2632
+ };
2633
+ assert.notIncludeDeepMembers = function(superset, subset, msg) {
2634
+ new Assertion(superset, msg, assert.notIncludeDeepMembers, true).to.not.include.deep.members(subset);
2635
+ };
2636
+ assert.includeOrderedMembers = function(superset, subset, msg) {
2637
+ new Assertion(superset, msg, assert.includeOrderedMembers, true).to.include.ordered.members(subset);
2638
+ };
2639
+ assert.notIncludeOrderedMembers = function(superset, subset, msg) {
2640
+ new Assertion(superset, msg, assert.notIncludeOrderedMembers, true).to.not.include.ordered.members(subset);
2641
+ };
2642
+ assert.includeDeepOrderedMembers = function(superset, subset, msg) {
2643
+ new Assertion(superset, msg, assert.includeDeepOrderedMembers, true).to.include.deep.ordered.members(subset);
2644
+ };
2645
+ assert.notIncludeDeepOrderedMembers = function(superset, subset, msg) {
2646
+ new Assertion(superset, msg, assert.notIncludeDeepOrderedMembers, true).to.not.include.deep.ordered.members(subset);
2647
+ };
2648
+ assert.oneOf = function(inList, list, msg) {
2649
+ new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list);
2650
+ };
2651
+ assert.isIterable = function(obj, msg) {
2652
+ if (obj == void 0 || !obj[Symbol.iterator]) {
2653
+ msg = msg ? `${msg} expected ${inspect2(obj)} to be an iterable` : `expected ${inspect2(obj)} to be an iterable`;
2654
+ throw new AssertionError(msg, void 0, assert.isIterable);
2655
+ }
2656
+ };
2657
+ assert.changes = function(fn, obj, prop, msg) {
2658
+ if (arguments.length === 3 && typeof obj === "function") {
2659
+ msg = prop;
2660
+ prop = null;
2661
+ }
2662
+ new Assertion(fn, msg, assert.changes, true).to.change(obj, prop);
2663
+ };
2664
+ assert.changesBy = function(fn, obj, prop, delta, msg) {
2665
+ if (arguments.length === 4 && typeof obj === "function") {
2666
+ let tmpMsg = delta;
2667
+ delta = prop;
2668
+ msg = tmpMsg;
2669
+ } else if (arguments.length === 3) {
2670
+ delta = prop;
2671
+ prop = null;
2672
+ }
2673
+ new Assertion(fn, msg, assert.changesBy, true).to.change(obj, prop).by(delta);
2674
+ };
2675
+ assert.doesNotChange = function(fn, obj, prop, msg) {
2676
+ if (arguments.length === 3 && typeof obj === "function") {
2677
+ msg = prop;
2678
+ prop = null;
2679
+ }
2680
+ return new Assertion(fn, msg, assert.doesNotChange, true).to.not.change(obj, prop);
2681
+ };
2682
+ assert.changesButNotBy = function(fn, obj, prop, delta, msg) {
2683
+ if (arguments.length === 4 && typeof obj === "function") {
2684
+ let tmpMsg = delta;
2685
+ delta = prop;
2686
+ msg = tmpMsg;
2687
+ } else if (arguments.length === 3) {
2688
+ delta = prop;
2689
+ prop = null;
2690
+ }
2691
+ new Assertion(fn, msg, assert.changesButNotBy, true).to.change(obj, prop).but.not.by(delta);
2692
+ };
2693
+ assert.increases = function(fn, obj, prop, msg) {
2694
+ if (arguments.length === 3 && typeof obj === "function") {
2695
+ msg = prop;
2696
+ prop = null;
2697
+ }
2698
+ return new Assertion(fn, msg, assert.increases, true).to.increase(obj, prop);
2699
+ };
2700
+ assert.increasesBy = function(fn, obj, prop, delta, msg) {
2701
+ if (arguments.length === 4 && typeof obj === "function") {
2702
+ let tmpMsg = delta;
2703
+ delta = prop;
2704
+ msg = tmpMsg;
2705
+ } else if (arguments.length === 3) {
2706
+ delta = prop;
2707
+ prop = null;
2708
+ }
2709
+ new Assertion(fn, msg, assert.increasesBy, true).to.increase(obj, prop).by(delta);
2710
+ };
2711
+ assert.doesNotIncrease = function(fn, obj, prop, msg) {
2712
+ if (arguments.length === 3 && typeof obj === "function") {
2713
+ msg = prop;
2714
+ prop = null;
2715
+ }
2716
+ return new Assertion(fn, msg, assert.doesNotIncrease, true).to.not.increase(obj, prop);
2717
+ };
2718
+ assert.increasesButNotBy = function(fn, obj, prop, delta, msg) {
2719
+ if (arguments.length === 4 && typeof obj === "function") {
2720
+ let tmpMsg = delta;
2721
+ delta = prop;
2722
+ msg = tmpMsg;
2723
+ } else if (arguments.length === 3) {
2724
+ delta = prop;
2725
+ prop = null;
2726
+ }
2727
+ new Assertion(fn, msg, assert.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta);
2728
+ };
2729
+ assert.decreases = function(fn, obj, prop, msg) {
2730
+ if (arguments.length === 3 && typeof obj === "function") {
2731
+ msg = prop;
2732
+ prop = null;
2733
+ }
2734
+ return new Assertion(fn, msg, assert.decreases, true).to.decrease(obj, prop);
2735
+ };
2736
+ assert.decreasesBy = function(fn, obj, prop, delta, msg) {
2737
+ if (arguments.length === 4 && typeof obj === "function") {
2738
+ let tmpMsg = delta;
2739
+ delta = prop;
2740
+ msg = tmpMsg;
2741
+ } else if (arguments.length === 3) {
2742
+ delta = prop;
2743
+ prop = null;
2744
+ }
2745
+ new Assertion(fn, msg, assert.decreasesBy, true).to.decrease(obj, prop).by(delta);
2746
+ };
2747
+ assert.doesNotDecrease = function(fn, obj, prop, msg) {
2748
+ if (arguments.length === 3 && typeof obj === "function") {
2749
+ msg = prop;
2750
+ prop = null;
2751
+ }
2752
+ return new Assertion(fn, msg, assert.doesNotDecrease, true).to.not.decrease(obj, prop);
2753
+ };
2754
+ assert.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) {
2755
+ if (arguments.length === 4 && typeof obj === "function") {
2756
+ let tmpMsg = delta;
2757
+ delta = prop;
2758
+ msg = tmpMsg;
2759
+ } else if (arguments.length === 3) {
2760
+ delta = prop;
2761
+ prop = null;
2762
+ }
2763
+ return new Assertion(fn, msg, assert.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta);
2764
+ };
2765
+ assert.decreasesButNotBy = function(fn, obj, prop, delta, msg) {
2766
+ if (arguments.length === 4 && typeof obj === "function") {
2767
+ let tmpMsg = delta;
2768
+ delta = prop;
2769
+ msg = tmpMsg;
2770
+ } else if (arguments.length === 3) {
2771
+ delta = prop;
2772
+ prop = null;
2773
+ }
2774
+ new Assertion(fn, msg, assert.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta);
2775
+ };
2776
+ assert.ifError = function(val) {
2777
+ if (val) throw val;
2778
+ };
2779
+ assert.isExtensible = function(obj, msg) {
2780
+ new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible;
2781
+ };
2782
+ assert.isNotExtensible = function(obj, msg) {
2783
+ new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible;
2784
+ };
2785
+ assert.isSealed = function(obj, msg) {
2786
+ new Assertion(obj, msg, assert.isSealed, true).to.be.sealed;
2787
+ };
2788
+ assert.isNotSealed = function(obj, msg) {
2789
+ new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed;
2790
+ };
2791
+ assert.isFrozen = function(obj, msg) {
2792
+ new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen;
2793
+ };
2794
+ assert.isNotFrozen = function(obj, msg) {
2795
+ new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen;
2796
+ };
2797
+ assert.isEmpty = function(val, msg) {
2798
+ new Assertion(val, msg, assert.isEmpty, true).to.be.empty;
2799
+ };
2800
+ assert.isNotEmpty = function(val, msg) {
2801
+ new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty;
2802
+ };
2803
+ assert.containsSubset = function(val, exp, msg) {
2804
+ new Assertion(val, msg).to.containSubset(exp);
2805
+ };
2806
+ assert.doesNotContainSubset = function(val, exp, msg) {
2807
+ new Assertion(val, msg).to.not.containSubset(exp);
2808
+ };
2809
+ for (const [name, as] of [
2810
+ ["isOk", "ok"],
2811
+ ["isNotOk", "notOk"],
2812
+ ["throws", "throw"],
2813
+ ["throws", "Throw"],
2814
+ ["isExtensible", "extensible"],
2815
+ ["isNotExtensible", "notExtensible"],
2816
+ ["isSealed", "sealed"],
2817
+ ["isNotSealed", "notSealed"],
2818
+ ["isFrozen", "frozen"],
2819
+ ["isNotFrozen", "notFrozen"],
2820
+ ["isEmpty", "empty"],
2821
+ ["isNotEmpty", "notEmpty"],
2822
+ ["isCallable", "isFunction"],
2823
+ ["isNotCallable", "isNotFunction"],
2824
+ ["containsSubset", "containSubset"]
2825
+ ]) assert[as] = assert[name];
2826
+ var used = [];
2827
+ function use(fn) {
2828
+ const exports = {
2829
+ use,
2830
+ AssertionError,
2831
+ util: utils_exports,
2832
+ config,
2833
+ expect,
2834
+ assert,
2835
+ Assertion,
2836
+ ...should_exports
2837
+ };
2838
+ if (!~used.indexOf(fn)) {
2839
+ fn(exports, utils_exports);
2840
+ used.push(fn);
2841
+ }
2842
+ return exports;
2843
+ }
2844
+ __name(use, "use");
2845
+ /*!
2846
+ * Chai - flag utility
2847
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2848
+ * MIT Licensed
2849
+ */
2850
+ /*!
2851
+ * Chai - test utility
2852
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2853
+ * MIT Licensed
2854
+ */
2855
+ /*!
2856
+ * Chai - expectTypes utility
2857
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2858
+ * MIT Licensed
2859
+ */
2860
+ /*!
2861
+ * Chai - getActual utility
2862
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2863
+ * MIT Licensed
2864
+ */
2865
+ /*!
2866
+ * Chai - message composition utility
2867
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2868
+ * MIT Licensed
2869
+ */
2870
+ /*!
2871
+ * Chai - transferFlags utility
2872
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2873
+ * MIT Licensed
2874
+ */
2875
+ /*!
2876
+ * chai
2877
+ * http://chaijs.com
2878
+ * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
2879
+ * MIT Licensed
2880
+ */
2881
+ /*!
2882
+ * Chai - isProxyEnabled helper
2883
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2884
+ * MIT Licensed
2885
+ */
2886
+ /*!
2887
+ * Chai - addProperty utility
2888
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2889
+ * MIT Licensed
2890
+ */
2891
+ /*!
2892
+ * Chai - addLengthGuard utility
2893
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2894
+ * MIT Licensed
2895
+ */
2896
+ /*!
2897
+ * Chai - getProperties utility
2898
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2899
+ * MIT Licensed
2900
+ */
2901
+ /*!
2902
+ * Chai - proxify utility
2903
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2904
+ * MIT Licensed
2905
+ */
2906
+ /*!
2907
+ * Chai - addMethod utility
2908
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2909
+ * MIT Licensed
2910
+ */
2911
+ /*!
2912
+ * Chai - overwriteProperty utility
2913
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2914
+ * MIT Licensed
2915
+ */
2916
+ /*!
2917
+ * Chai - overwriteMethod utility
2918
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2919
+ * MIT Licensed
2920
+ */
2921
+ /*!
2922
+ * Chai - addChainingMethod utility
2923
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2924
+ * MIT Licensed
2925
+ */
2926
+ /*!
2927
+ * Chai - overwriteChainableMethod utility
2928
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
2929
+ * MIT Licensed
2930
+ */
2931
+ /*!
2932
+ * Chai - compareByInspect utility
2933
+ * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
2934
+ * MIT Licensed
2935
+ */
2936
+ /*!
2937
+ * Chai - getOwnEnumerablePropertySymbols utility
2938
+ * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
2939
+ * MIT Licensed
2940
+ */
2941
+ /*!
2942
+ * Chai - getOwnEnumerableProperties utility
2943
+ * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
2944
+ * MIT Licensed
2945
+ */
2946
+ /*!
2947
+ * Chai - isNaN utility
2948
+ * Copyright(c) 2012-2015 Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2949
+ * MIT Licensed
2950
+ */
2951
+ /*!
2952
+ * chai
2953
+ * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
2954
+ * MIT Licensed
2955
+ */
2956
+ /*!
2957
+ * chai
2958
+ * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
2959
+ * MIT Licensed
2960
+ */
2961
+ /*! Bundled license information:
2962
+
2963
+ deep-eql/index.js:
2964
+ (*!
2965
+ * deep-eql
2966
+ * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
2967
+ * MIT Licensed
2968
+ *)
2969
+ (*!
2970
+ * Check to see if the MemoizeMap has recorded a result of the two operands
2971
+ *
2972
+ * @param {Mixed} leftHandOperand
2973
+ * @param {Mixed} rightHandOperand
2974
+ * @param {MemoizeMap} memoizeMap
2975
+ * @returns {Boolean|null} result
2976
+ *)
2977
+ (*!
2978
+ * Set the result of the equality into the MemoizeMap
2979
+ *
2980
+ * @param {Mixed} leftHandOperand
2981
+ * @param {Mixed} rightHandOperand
2982
+ * @param {MemoizeMap} memoizeMap
2983
+ * @param {Boolean} result
2984
+ *)
2985
+ (*!
2986
+ * Primary Export
2987
+ *)
2988
+ (*!
2989
+ * The main logic of the `deepEqual` function.
2990
+ *
2991
+ * @param {Mixed} leftHandOperand
2992
+ * @param {Mixed} rightHandOperand
2993
+ * @param {Object} [options] (optional) Additional options
2994
+ * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality.
2995
+ * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of
2996
+ complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular
2997
+ references to blow the stack.
2998
+ * @return {Boolean} equal match
2999
+ *)
3000
+ (*!
3001
+ * Compare two Regular Expressions for equality.
3002
+ *
3003
+ * @param {RegExp} leftHandOperand
3004
+ * @param {RegExp} rightHandOperand
3005
+ * @return {Boolean} result
3006
+ *)
3007
+ (*!
3008
+ * Compare two Sets/Maps for equality. Faster than other equality functions.
3009
+ *
3010
+ * @param {Set} leftHandOperand
3011
+ * @param {Set} rightHandOperand
3012
+ * @param {Object} [options] (Optional)
3013
+ * @return {Boolean} result
3014
+ *)
3015
+ (*!
3016
+ * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers.
3017
+ *
3018
+ * @param {Iterable} leftHandOperand
3019
+ * @param {Iterable} rightHandOperand
3020
+ * @param {Object} [options] (Optional)
3021
+ * @return {Boolean} result
3022
+ *)
3023
+ (*!
3024
+ * Simple equality for generator objects such as those returned by generator functions.
3025
+ *
3026
+ * @param {Iterable} leftHandOperand
3027
+ * @param {Iterable} rightHandOperand
3028
+ * @param {Object} [options] (Optional)
3029
+ * @return {Boolean} result
3030
+ *)
3031
+ (*!
3032
+ * Determine if the given object has an @@iterator function.
3033
+ *
3034
+ * @param {Object} target
3035
+ * @return {Boolean} `true` if the object has an @@iterator function.
3036
+ *)
3037
+ (*!
3038
+ * Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array.
3039
+ * This will consume the iterator - which could have side effects depending on the @@iterator implementation.
3040
+ *
3041
+ * @param {Object} target
3042
+ * @returns {Array} an array of entries from the @@iterator function
3043
+ *)
3044
+ (*!
3045
+ * Gets all entries from a Generator. This will consume the generator - which could have side effects.
3046
+ *
3047
+ * @param {Generator} target
3048
+ * @returns {Array} an array of entries from the Generator.
3049
+ *)
3050
+ (*!
3051
+ * Gets all own and inherited enumerable keys from a target.
3052
+ *
3053
+ * @param {Object} target
3054
+ * @returns {Array} an array of own and inherited enumerable keys from the target.
3055
+ *)
3056
+ (*!
3057
+ * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
3058
+ * each key. If any value of the given key is not equal, the function will return false (early).
3059
+ *
3060
+ * @param {Mixed} leftHandOperand
3061
+ * @param {Mixed} rightHandOperand
3062
+ * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against
3063
+ * @param {Object} [options] (Optional)
3064
+ * @return {Boolean} result
3065
+ *)
3066
+ (*!
3067
+ * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual`
3068
+ * for each enumerable key in the object.
3069
+ *
3070
+ * @param {Mixed} leftHandOperand
3071
+ * @param {Mixed} rightHandOperand
3072
+ * @param {Object} [options] (Optional)
3073
+ * @return {Boolean} result
3074
+ *)
3075
+ (*!
3076
+ * Returns true if the argument is a primitive.
3077
+ *
3078
+ * This intentionally returns true for all objects that can be compared by reference,
3079
+ * including functions and symbols.
3080
+ *
3081
+ * @param {Mixed} value
3082
+ * @return {Boolean} result
3083
+ *)
3084
+ */
3085
+
3086
+ //#endregion
3087
+ export { Assertion, assert, expect, use, utils_exports };