testeranto 0.140.2 → 0.143.0

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