@manifest-network/manifest-mcp-core 0.1.0

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