@noma.to/qwik-mock 0.0.0-semantically-released

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