@voidzero-dev/vite-plus-test 0.0.0-0bfcc90f.20260209-0731

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 (318) hide show
  1. package/LICENSE.md +691 -0
  2. package/browser/context.d.ts +4 -0
  3. package/browser/context.js +20 -0
  4. package/config.d.ts +3 -0
  5. package/coverage.d.ts +1 -0
  6. package/dist/@vitest/browser/client/.vite/manifest.json +24 -0
  7. package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +57 -0
  8. package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
  9. package/dist/@vitest/browser/client/__vitest__/bg.png +0 -0
  10. package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
  11. package/dist/@vitest/browser/client/__vitest__/favicon.svg +5 -0
  12. package/dist/@vitest/browser/client/__vitest__/index.html +32 -0
  13. package/dist/@vitest/browser/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
  14. package/dist/@vitest/browser/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
  15. package/dist/@vitest/browser/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
  16. package/dist/@vitest/browser/client/error-catcher.js +82 -0
  17. package/dist/@vitest/browser/client/esm-client-injector.js +67 -0
  18. package/dist/@vitest/browser/client/favicon.svg +5 -0
  19. package/dist/@vitest/browser/client/orchestrator.html +35 -0
  20. package/dist/@vitest/browser/client/tester/tester.html +13 -0
  21. package/dist/@vitest/browser/client.js +456 -0
  22. package/dist/@vitest/browser/context.d.ts +792 -0
  23. package/dist/@vitest/browser/context.js +541 -0
  24. package/dist/@vitest/browser/expect-element.js +32 -0
  25. package/dist/@vitest/browser/index-D6m36C6U.js +11 -0
  26. package/dist/@vitest/browser/index.d.ts +73 -0
  27. package/dist/@vitest/browser/index.js +3513 -0
  28. package/dist/@vitest/browser/jest-dom.d.ts +724 -0
  29. package/dist/@vitest/browser/locators.d.ts +354 -0
  30. package/dist/@vitest/browser/locators.js +1 -0
  31. package/dist/@vitest/browser/matchers.d.ts +29 -0
  32. package/dist/@vitest/browser/shared/screenshotMatcher/types.d.ts +22 -0
  33. package/dist/@vitest/browser/state.js +280 -0
  34. package/dist/@vitest/browser/types.d.ts +69 -0
  35. package/dist/@vitest/browser-playwright/context.d.ts +1 -0
  36. package/dist/@vitest/browser-playwright/index.d.ts +106 -0
  37. package/dist/@vitest/browser-playwright/index.js +1111 -0
  38. package/dist/@vitest/browser-playwright/locators.js +114 -0
  39. package/dist/@vitest/browser-preview/context.d.ts +1 -0
  40. package/dist/@vitest/browser-preview/index.d.ts +19 -0
  41. package/dist/@vitest/browser-preview/index.js +148 -0
  42. package/dist/@vitest/browser-preview/locators.js +79 -0
  43. package/dist/@vitest/browser-webdriverio/context.d.ts +1 -0
  44. package/dist/@vitest/browser-webdriverio/index.d.ts +63 -0
  45. package/dist/@vitest/browser-webdriverio/index.js +600 -0
  46. package/dist/@vitest/browser-webdriverio/locators.js +163 -0
  47. package/dist/@vitest/expect/index.d.ts +807 -0
  48. package/dist/@vitest/expect/index.js +1875 -0
  49. package/dist/@vitest/mocker/auto-register.d.ts +2 -0
  50. package/dist/@vitest/mocker/auto-register.js +9 -0
  51. package/dist/@vitest/mocker/automock.d.ts +12 -0
  52. package/dist/@vitest/mocker/automock.js +1 -0
  53. package/dist/@vitest/mocker/browser.d.ts +53 -0
  54. package/dist/@vitest/mocker/browser.js +91 -0
  55. package/dist/@vitest/mocker/chunk-automock.js +354 -0
  56. package/dist/@vitest/mocker/chunk-interceptor-native.js +15 -0
  57. package/dist/@vitest/mocker/chunk-mocker.js +521 -0
  58. package/dist/@vitest/mocker/chunk-pathe.M-eThtNZ.js +174 -0
  59. package/dist/@vitest/mocker/chunk-registry.js +185 -0
  60. package/dist/@vitest/mocker/chunk-utils.js +16 -0
  61. package/dist/@vitest/mocker/index.d-C-sLYZi-.d.ts +25 -0
  62. package/dist/@vitest/mocker/index.d.ts +2 -0
  63. package/dist/@vitest/mocker/index.js +185 -0
  64. package/dist/@vitest/mocker/mocker.d-TnKRhz7N.d.ts +81 -0
  65. package/dist/@vitest/mocker/node.d.ts +800 -0
  66. package/dist/@vitest/mocker/node.js +966 -0
  67. package/dist/@vitest/mocker/redirect.d.ts +3 -0
  68. package/dist/@vitest/mocker/redirect.js +79 -0
  69. package/dist/@vitest/mocker/register.d.ts +9 -0
  70. package/dist/@vitest/mocker/register.js +41 -0
  71. package/dist/@vitest/mocker/types.d-B8CCKmHt.d.ts +107 -0
  72. package/dist/@vitest/pretty-format/index.d.ts +124 -0
  73. package/dist/@vitest/pretty-format/index.js +1022 -0
  74. package/dist/@vitest/runner/chunk-tasks.js +340 -0
  75. package/dist/@vitest/runner/index.d.ts +180 -0
  76. package/dist/@vitest/runner/index.js +2114 -0
  77. package/dist/@vitest/runner/tasks.d-C7UxawJ9.d.ts +834 -0
  78. package/dist/@vitest/runner/types.d.ts +183 -0
  79. package/dist/@vitest/runner/types.js +1 -0
  80. package/dist/@vitest/runner/utils.d.ts +45 -0
  81. package/dist/@vitest/runner/utils.js +5 -0
  82. package/dist/@vitest/snapshot/environment.d-DHdQ1Csl.d.ts +22 -0
  83. package/dist/@vitest/snapshot/environment.d.ts +16 -0
  84. package/dist/@vitest/snapshot/environment.js +40 -0
  85. package/dist/@vitest/snapshot/index.d.ts +130 -0
  86. package/dist/@vitest/snapshot/index.js +1437 -0
  87. package/dist/@vitest/snapshot/manager.d.ts +18 -0
  88. package/dist/@vitest/snapshot/manager.js +73 -0
  89. package/dist/@vitest/snapshot/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
  90. package/dist/@vitest/spy/index.d.ts +384 -0
  91. package/dist/@vitest/spy/index.js +433 -0
  92. package/dist/@vitest/utils/chunk-_commonjsHelpers.js +5 -0
  93. package/dist/@vitest/utils/chunk-pathe.M-eThtNZ.js +156 -0
  94. package/dist/@vitest/utils/constants.d.ts +21 -0
  95. package/dist/@vitest/utils/constants.js +49 -0
  96. package/dist/@vitest/utils/diff.d.ts +93 -0
  97. package/dist/@vitest/utils/diff.js +2199 -0
  98. package/dist/@vitest/utils/display.d.ts +29 -0
  99. package/dist/@vitest/utils/display.js +742 -0
  100. package/dist/@vitest/utils/error.d.ts +7 -0
  101. package/dist/@vitest/utils/error.js +42 -0
  102. package/dist/@vitest/utils/helpers.d.ts +73 -0
  103. package/dist/@vitest/utils/helpers.js +295 -0
  104. package/dist/@vitest/utils/highlight.d.ts +9 -0
  105. package/dist/@vitest/utils/highlight.js +538 -0
  106. package/dist/@vitest/utils/index.d.ts +5 -0
  107. package/dist/@vitest/utils/index.js +1 -0
  108. package/dist/@vitest/utils/offset.d.ts +5 -0
  109. package/dist/@vitest/utils/offset.js +32 -0
  110. package/dist/@vitest/utils/resolver.d.ts +7 -0
  111. package/dist/@vitest/utils/resolver.js +71 -0
  112. package/dist/@vitest/utils/serialize.d.ts +3 -0
  113. package/dist/@vitest/utils/serialize.js +118 -0
  114. package/dist/@vitest/utils/source-map.d.ts +55 -0
  115. package/dist/@vitest/utils/source-map.js +478 -0
  116. package/dist/@vitest/utils/timers.d.ts +33 -0
  117. package/dist/@vitest/utils/timers.js +49 -0
  118. package/dist/@vitest/utils/types.d-BCElaP-c.d.ts +53 -0
  119. package/dist/@vitest/utils/types.d.ts +34 -0
  120. package/dist/@vitest/utils/types.js +1 -0
  121. package/dist/browser-compat.js +3 -0
  122. package/dist/browser.d.ts +46 -0
  123. package/dist/browser.js +20 -0
  124. package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
  125. package/dist/chunks/base.CJ0Y4ePK.js +165 -0
  126. package/dist/chunks/benchmark.B3N2zMcH.js +40 -0
  127. package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +24 -0
  128. package/dist/chunks/browser.d.ChKACdzH.d.ts +59 -0
  129. package/dist/chunks/cac.DVeoLl0M.js +1409 -0
  130. package/dist/chunks/cli-api.B7PN_QUv.js +13672 -0
  131. package/dist/chunks/config.d.Cy95HiCx.d.ts +210 -0
  132. package/dist/chunks/console.Cf-YriPC.js +146 -0
  133. package/dist/chunks/constants.D_Q9UYh-.js +36 -0
  134. package/dist/chunks/coverage.AVPTjMgw.js +3292 -0
  135. package/dist/chunks/coverage.D_JHT54q.js +25 -0
  136. package/dist/chunks/coverage.d.BZtK59WP.d.ts +37 -0
  137. package/dist/chunks/creator.DAmOKTvJ.js +673 -0
  138. package/dist/chunks/date.Bq6ZW5rf.js +73 -0
  139. package/dist/chunks/defaults.BOqNVLsY.js +74 -0
  140. package/dist/chunks/env.D4Lgay0q.js +8 -0
  141. package/dist/chunks/environment.d.CrsxCzP1.d.ts +29 -0
  142. package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
  143. package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
  144. package/dist/chunks/git.Bm2pzPAa.js +71 -0
  145. package/dist/chunks/global.d.B15mdLcR.d.ts +99 -0
  146. package/dist/chunks/globals.DOayXfHP.js +30 -0
  147. package/dist/chunks/index.6Qv1eEA6.js +109 -0
  148. package/dist/chunks/index.C5r1PdPD.js +231 -0
  149. package/dist/chunks/index.Chj8NDwU.js +206 -0
  150. package/dist/chunks/index.CyBMJtT7.js +727 -0
  151. package/dist/chunks/index.D3XRDfWc.js +213 -0
  152. package/dist/chunks/index.D4KonVSU.js +6343 -0
  153. package/dist/chunks/index.M8mOzt4Y.js +3839 -0
  154. package/dist/chunks/index.Z5E_ObnR.js +37 -0
  155. package/dist/chunks/init-forks._y3TW739.js +41 -0
  156. package/dist/chunks/init-threads.DBO2kn-p.js +18 -0
  157. package/dist/chunks/init.B6MLFIaN.js +334 -0
  158. package/dist/chunks/inspector.CvyFGlXm.js +53 -0
  159. package/dist/chunks/modules.BJuCwlRJ.js +36 -0
  160. package/dist/chunks/node.Ce0vMQM7.js +14 -0
  161. package/dist/chunks/plugin.d.CtqpEehP.d.ts +38 -0
  162. package/dist/chunks/reporters.d.CWXNI2jG.d.ts +3271 -0
  163. package/dist/chunks/rpc.BoxB0q7B.js +76 -0
  164. package/dist/chunks/rpc.d.RH3apGEf.d.ts +64 -0
  165. package/dist/chunks/setup-common.Cm-kSBVi.js +60 -0
  166. package/dist/chunks/startModuleRunner.DEj0jb3e.js +861 -0
  167. package/dist/chunks/suite.d.BJWk38HB.d.ts +10 -0
  168. package/dist/chunks/test.B8ej_ZHS.js +254 -0
  169. package/dist/chunks/traces.CCmnQaNT.js +217 -0
  170. package/dist/chunks/traces.d.402V_yFI.d.ts +18 -0
  171. package/dist/chunks/utils.DvEY5TfP.js +52 -0
  172. package/dist/chunks/vi.2VT5v0um.js +3919 -0
  173. package/dist/chunks/vm.D3epNOPZ.js +744 -0
  174. package/dist/chunks/worker.d.Dyxm8DEL.d.ts +255 -0
  175. package/dist/cli.js +28 -0
  176. package/dist/client/.vite/manifest.json +24 -0
  177. package/dist/client/__vitest__/assets/index-BUCFJtth.js +57 -0
  178. package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
  179. package/dist/client/__vitest__/bg.png +0 -0
  180. package/dist/client/__vitest__/favicon.ico +0 -0
  181. package/dist/client/__vitest__/favicon.svg +5 -0
  182. package/dist/client/__vitest__/index.html +32 -0
  183. package/dist/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
  184. package/dist/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
  185. package/dist/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
  186. package/dist/client/error-catcher.js +82 -0
  187. package/dist/client/esm-client-injector.js +67 -0
  188. package/dist/client/favicon.svg +5 -0
  189. package/dist/client/orchestrator.html +35 -0
  190. package/dist/client/tester/tester.html +13 -0
  191. package/dist/client.js +456 -0
  192. package/dist/config.cjs +94 -0
  193. package/dist/config.d.ts +104 -0
  194. package/dist/config.js +15 -0
  195. package/dist/context.js +541 -0
  196. package/dist/coverage.d.ts +118 -0
  197. package/dist/coverage.js +23 -0
  198. package/dist/dummy.js +2 -0
  199. package/dist/environments.d.ts +22 -0
  200. package/dist/environments.js +3 -0
  201. package/dist/expect-element.js +27 -0
  202. package/dist/index-D6m36C6U.js +6 -0
  203. package/dist/index-node.js +7 -0
  204. package/dist/index.d.ts +510 -0
  205. package/dist/index.js +19 -0
  206. package/dist/locators.d.ts +354 -0
  207. package/dist/locators.js +1 -0
  208. package/dist/mocker.d.ts +1 -0
  209. package/dist/mocker.js +1 -0
  210. package/dist/module-evaluator.d.ts +124 -0
  211. package/dist/module-evaluator.js +343 -0
  212. package/dist/module-runner-stub.js +44 -0
  213. package/dist/module-runner.js +17 -0
  214. package/dist/node.d.ts +251 -0
  215. package/dist/node.js +98 -0
  216. package/dist/path.js +7 -0
  217. package/dist/plugins/browser-client.mjs +2 -0
  218. package/dist/plugins/browser-context.mjs +2 -0
  219. package/dist/plugins/browser-locators.mjs +2 -0
  220. package/dist/plugins/browser-playwright.mjs +2 -0
  221. package/dist/plugins/browser-preview.mjs +2 -0
  222. package/dist/plugins/browser-webdriverio.mjs +2 -0
  223. package/dist/plugins/browser.mjs +2 -0
  224. package/dist/plugins/expect.mjs +2 -0
  225. package/dist/plugins/mocker-automock.mjs +2 -0
  226. package/dist/plugins/mocker-browser.mjs +2 -0
  227. package/dist/plugins/mocker-node.mjs +2 -0
  228. package/dist/plugins/mocker-redirect.mjs +2 -0
  229. package/dist/plugins/mocker-register.mjs +2 -0
  230. package/dist/plugins/mocker.mjs +2 -0
  231. package/dist/plugins/pretty-format.mjs +2 -0
  232. package/dist/plugins/runner-types.mjs +2 -0
  233. package/dist/plugins/runner-utils.mjs +2 -0
  234. package/dist/plugins/runner.mjs +2 -0
  235. package/dist/plugins/snapshot-environment.mjs +2 -0
  236. package/dist/plugins/snapshot-manager.mjs +2 -0
  237. package/dist/plugins/snapshot.mjs +2 -0
  238. package/dist/plugins/spy.mjs +2 -0
  239. package/dist/plugins/utils-constants.mjs +2 -0
  240. package/dist/plugins/utils-diff.mjs +2 -0
  241. package/dist/plugins/utils-display.mjs +2 -0
  242. package/dist/plugins/utils-error.mjs +2 -0
  243. package/dist/plugins/utils-helpers.mjs +2 -0
  244. package/dist/plugins/utils-highlight.mjs +2 -0
  245. package/dist/plugins/utils-offset.mjs +2 -0
  246. package/dist/plugins/utils-resolver.mjs +2 -0
  247. package/dist/plugins/utils-serialize.mjs +2 -0
  248. package/dist/plugins/utils-source-map.mjs +2 -0
  249. package/dist/plugins/utils-timers.mjs +2 -0
  250. package/dist/plugins/utils.mjs +2 -0
  251. package/dist/reporters.d.ts +27 -0
  252. package/dist/reporters.js +24 -0
  253. package/dist/runners.d.ts +50 -0
  254. package/dist/runners.js +19 -0
  255. package/dist/shared/screenshotMatcher/types.d.ts +22 -0
  256. package/dist/snapshot.d.ts +9 -0
  257. package/dist/snapshot.js +4 -0
  258. package/dist/spy.js +1 -0
  259. package/dist/state.js +280 -0
  260. package/dist/suite.d.ts +5 -0
  261. package/dist/suite.js +6 -0
  262. package/dist/types.d.ts +69 -0
  263. package/dist/vendor/chai.d.mts +1 -0
  264. package/dist/vendor/chai.mjs +3577 -0
  265. package/dist/vendor/es-module-lexer.d.mts +193 -0
  266. package/dist/vendor/es-module-lexer.mjs +79 -0
  267. package/dist/vendor/estree-walker.d.mts +583 -0
  268. package/dist/vendor/estree-walker.mjs +339 -0
  269. package/dist/vendor/expect-type.d.mts +1574 -0
  270. package/dist/vendor/expect-type.mjs +214 -0
  271. package/dist/vendor/magic-string.d.mts +261 -0
  272. package/dist/vendor/magic-string.mjs +1700 -0
  273. package/dist/vendor/obug.d.mts +56 -0
  274. package/dist/vendor/obug.mjs +276 -0
  275. package/dist/vendor/pathe.d.mts +46 -0
  276. package/dist/vendor/pathe.mjs +496 -0
  277. package/dist/vendor/picomatch.d.mts +1 -0
  278. package/dist/vendor/picomatch.mjs +1855 -0
  279. package/dist/vendor/shared-3g9mwCWP.mjs +31 -0
  280. package/dist/vendor/std-env.d.mts +88 -0
  281. package/dist/vendor/std-env.mjs +159 -0
  282. package/dist/vendor/tinybench.d.mts +317 -0
  283. package/dist/vendor/tinybench.mjs +504 -0
  284. package/dist/vendor/tinyexec.d.mts +72 -0
  285. package/dist/vendor/tinyexec.mjs +637 -0
  286. package/dist/vendor/tinyglobby.d.mts +157 -0
  287. package/dist/vendor/tinyglobby.mjs +832 -0
  288. package/dist/vendor/tinyrainbow.d.mts +60 -0
  289. package/dist/vendor/tinyrainbow.mjs +93 -0
  290. package/dist/vendor/vitest_browser.mjs +2 -0
  291. package/dist/vendor/vitest_internal_browser.mjs +2 -0
  292. package/dist/vendor/vitest_runner.mjs +2 -0
  293. package/dist/vendor/vitest_runners.mjs +2 -0
  294. package/dist/worker.d.ts +32 -0
  295. package/dist/worker.js +48 -0
  296. package/dist/workers/forks.js +54 -0
  297. package/dist/workers/runVmTests.js +95 -0
  298. package/dist/workers/threads.js +55 -0
  299. package/dist/workers/vmForks.js +36 -0
  300. package/dist/workers/vmThreads.js +37 -0
  301. package/environments.d.ts +1 -0
  302. package/globals.d.ts +20 -0
  303. package/import-meta.d.ts +5 -0
  304. package/importMeta.d.ts +4 -0
  305. package/index.cjs +5 -0
  306. package/index.d.cts +1 -0
  307. package/jsdom.d.ts +6 -0
  308. package/mocker.d.ts +1 -0
  309. package/node.d.ts +1 -0
  310. package/optional-types.d.ts +7 -0
  311. package/package.json +335 -0
  312. package/reporters.d.ts +1 -0
  313. package/runners.d.ts +1 -0
  314. package/snapshot.d.ts +1 -0
  315. package/suite.d.ts +1 -0
  316. package/suppress-warnings.cjs +21 -0
  317. package/vitest.mjs +2 -0
  318. package/worker.d.ts +1 -0
@@ -0,0 +1,742 @@
1
+ import { plugins, format as format$1 } from '../pretty-format/index.js';
2
+
3
+ const ansiColors = {
4
+ bold: ['1', '22'],
5
+ dim: ['2', '22'],
6
+ italic: ['3', '23'],
7
+ underline: ['4', '24'],
8
+ // 5 & 6 are blinking
9
+ inverse: ['7', '27'],
10
+ hidden: ['8', '28'],
11
+ strike: ['9', '29'],
12
+ // 10-20 are fonts
13
+ // 21-29 are resets for 1-9
14
+ black: ['30', '39'],
15
+ red: ['31', '39'],
16
+ green: ['32', '39'],
17
+ yellow: ['33', '39'],
18
+ blue: ['34', '39'],
19
+ magenta: ['35', '39'],
20
+ cyan: ['36', '39'],
21
+ white: ['37', '39'],
22
+ brightblack: ['30;1', '39'],
23
+ brightred: ['31;1', '39'],
24
+ brightgreen: ['32;1', '39'],
25
+ brightyellow: ['33;1', '39'],
26
+ brightblue: ['34;1', '39'],
27
+ brightmagenta: ['35;1', '39'],
28
+ brightcyan: ['36;1', '39'],
29
+ brightwhite: ['37;1', '39'],
30
+ grey: ['90', '39'],
31
+ };
32
+ const styles = {
33
+ special: 'cyan',
34
+ number: 'yellow',
35
+ bigint: 'yellow',
36
+ boolean: 'yellow',
37
+ undefined: 'grey',
38
+ null: 'bold',
39
+ string: 'green',
40
+ symbol: 'green',
41
+ date: 'magenta',
42
+ regexp: 'red',
43
+ };
44
+ const truncator = '…';
45
+ function colorise(value, styleType) {
46
+ const color = ansiColors[styles[styleType]] || ansiColors[styleType] || '';
47
+ if (!color) {
48
+ return String(value);
49
+ }
50
+ return `\u001b[${color[0]}m${String(value)}\u001b[${color[1]}m`;
51
+ }
52
+ function normaliseOptions({ showHidden = false, depth = 2, colors = false, customInspect = true, showProxy = false, maxArrayLength = Infinity, breakLength = Infinity, seen = [],
53
+ // eslint-disable-next-line no-shadow
54
+ truncate = Infinity, stylize = String, } = {}, inspect) {
55
+ const options = {
56
+ showHidden: Boolean(showHidden),
57
+ depth: Number(depth),
58
+ colors: Boolean(colors),
59
+ customInspect: Boolean(customInspect),
60
+ showProxy: Boolean(showProxy),
61
+ maxArrayLength: Number(maxArrayLength),
62
+ breakLength: Number(breakLength),
63
+ truncate: Number(truncate),
64
+ seen,
65
+ inspect,
66
+ stylize,
67
+ };
68
+ if (options.colors) {
69
+ options.stylize = colorise;
70
+ }
71
+ return options;
72
+ }
73
+ function isHighSurrogate(char) {
74
+ return char >= '\ud800' && char <= '\udbff';
75
+ }
76
+ function truncate(string, length, tail = truncator) {
77
+ string = String(string);
78
+ const tailLength = tail.length;
79
+ const stringLength = string.length;
80
+ if (tailLength > length && stringLength > tailLength) {
81
+ return tail;
82
+ }
83
+ if (stringLength > length && stringLength > tailLength) {
84
+ let end = length - tailLength;
85
+ if (end > 0 && isHighSurrogate(string[end - 1])) {
86
+ end = end - 1;
87
+ }
88
+ return `${string.slice(0, end)}${tail}`;
89
+ }
90
+ return string;
91
+ }
92
+ // eslint-disable-next-line complexity
93
+ function inspectList(list, options, inspectItem, separator = ', ') {
94
+ inspectItem = inspectItem || options.inspect;
95
+ const size = list.length;
96
+ if (size === 0)
97
+ return '';
98
+ const originalLength = options.truncate;
99
+ let output = '';
100
+ let peek = '';
101
+ let truncated = '';
102
+ for (let i = 0; i < size; i += 1) {
103
+ const last = i + 1 === list.length;
104
+ const secondToLast = i + 2 === list.length;
105
+ truncated = `${truncator}(${list.length - i})`;
106
+ const value = list[i];
107
+ // If there is more than one remaining we need to account for a separator of `, `
108
+ options.truncate = originalLength - output.length - (last ? 0 : separator.length);
109
+ const string = peek || inspectItem(value, options) + (last ? '' : separator);
110
+ const nextLength = output.length + string.length;
111
+ const truncatedLength = nextLength + truncated.length;
112
+ // If this is the last element, and adding it would
113
+ // take us over length, but adding the truncator wouldn't - then break now
114
+ if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) {
115
+ break;
116
+ }
117
+ // If this isn't the last or second to last element to scan,
118
+ // but the string is already over length then break here
119
+ if (!last && !secondToLast && truncatedLength > originalLength) {
120
+ break;
121
+ }
122
+ // Peek at the next string to determine if we should
123
+ // break early before adding this item to the output
124
+ peek = last ? '' : inspectItem(list[i + 1], options) + (secondToLast ? '' : separator);
125
+ // If we have one element left, but this element and
126
+ // the next takes over length, the break early
127
+ if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {
128
+ break;
129
+ }
130
+ output += string;
131
+ // If the next element takes us to length -
132
+ // but there are more after that, then we should truncate now
133
+ if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
134
+ truncated = `${truncator}(${list.length - i - 1})`;
135
+ break;
136
+ }
137
+ truncated = '';
138
+ }
139
+ return `${output}${truncated}`;
140
+ }
141
+ function quoteComplexKey(key) {
142
+ if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
143
+ return key;
144
+ }
145
+ return JSON.stringify(key)
146
+ .replace(/'/g, "\\'")
147
+ .replace(/\\"/g, '"')
148
+ .replace(/(^"|"$)/g, "'");
149
+ }
150
+ function inspectProperty([key, value], options) {
151
+ options.truncate -= 2;
152
+ if (typeof key === 'string') {
153
+ key = quoteComplexKey(key);
154
+ }
155
+ else if (typeof key !== 'number') {
156
+ key = `[${options.inspect(key, options)}]`;
157
+ }
158
+ options.truncate -= key.length;
159
+ value = options.inspect(value, options);
160
+ return `${key}: ${value}`;
161
+ }
162
+
163
+ function inspectArray(array, options) {
164
+ // Object.keys will always output the Array indices first, so we can slice by
165
+ // `array.length` to get non-index properties
166
+ const nonIndexProperties = Object.keys(array).slice(array.length);
167
+ if (!array.length && !nonIndexProperties.length)
168
+ return '[]';
169
+ options.truncate -= 4;
170
+ const listContents = inspectList(array, options);
171
+ options.truncate -= listContents.length;
172
+ let propertyContents = '';
173
+ if (nonIndexProperties.length) {
174
+ propertyContents = inspectList(nonIndexProperties.map(key => [key, array[key]]), options, inspectProperty);
175
+ }
176
+ return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ''} ]`;
177
+ }
178
+
179
+ const getArrayName = (array) => {
180
+ // We need to special case Node.js' Buffers, which report to be Uint8Array
181
+ // @ts-ignore
182
+ if (typeof Buffer === 'function' && array instanceof Buffer) {
183
+ return 'Buffer';
184
+ }
185
+ if (array[Symbol.toStringTag]) {
186
+ return array[Symbol.toStringTag];
187
+ }
188
+ return array.constructor.name;
189
+ };
190
+ function inspectTypedArray(array, options) {
191
+ const name = getArrayName(array);
192
+ options.truncate -= name.length + 4;
193
+ // Object.keys will always output the Array indices first, so we can slice by
194
+ // `array.length` to get non-index properties
195
+ const nonIndexProperties = Object.keys(array).slice(array.length);
196
+ if (!array.length && !nonIndexProperties.length)
197
+ return `${name}[]`;
198
+ // As we know TypedArrays only contain Unsigned Integers, we can skip inspecting each one and simply
199
+ // stylise the toString() value of them
200
+ let output = '';
201
+ for (let i = 0; i < array.length; i++) {
202
+ const string = `${options.stylize(truncate(array[i], options.truncate), 'number')}${i === array.length - 1 ? '' : ', '}`;
203
+ options.truncate -= string.length;
204
+ if (array[i] !== array.length && options.truncate <= 3) {
205
+ output += `${truncator}(${array.length - array[i] + 1})`;
206
+ break;
207
+ }
208
+ output += string;
209
+ }
210
+ let propertyContents = '';
211
+ if (nonIndexProperties.length) {
212
+ propertyContents = inspectList(nonIndexProperties.map(key => [key, array[key]]), options, inspectProperty);
213
+ }
214
+ return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ''} ]`;
215
+ }
216
+
217
+ function inspectDate(dateObject, options) {
218
+ const stringRepresentation = dateObject.toJSON();
219
+ if (stringRepresentation === null) {
220
+ return 'Invalid Date';
221
+ }
222
+ const split = stringRepresentation.split('T');
223
+ const date = split[0];
224
+ // If we need to - truncate the time portion, but never the date
225
+ return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, 'date');
226
+ }
227
+
228
+ function inspectFunction(func, options) {
229
+ const functionType = func[Symbol.toStringTag] || 'Function';
230
+ const name = func.name;
231
+ if (!name) {
232
+ return options.stylize(`[${functionType}]`, 'special');
233
+ }
234
+ return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, 'special');
235
+ }
236
+
237
+ function inspectMapEntry([key, value], options) {
238
+ options.truncate -= 4;
239
+ key = options.inspect(key, options);
240
+ options.truncate -= key.length;
241
+ value = options.inspect(value, options);
242
+ return `${key} => ${value}`;
243
+ }
244
+ // IE11 doesn't support `map.entries()`
245
+ function mapToEntries(map) {
246
+ const entries = [];
247
+ map.forEach((value, key) => {
248
+ entries.push([key, value]);
249
+ });
250
+ return entries;
251
+ }
252
+ function inspectMap(map, options) {
253
+ if (map.size === 0)
254
+ return 'Map{}';
255
+ options.truncate -= 7;
256
+ return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
257
+ }
258
+
259
+ const isNaN = Number.isNaN || (i => i !== i); // eslint-disable-line no-self-compare
260
+ function inspectNumber(number, options) {
261
+ if (isNaN(number)) {
262
+ return options.stylize('NaN', 'number');
263
+ }
264
+ if (number === Infinity) {
265
+ return options.stylize('Infinity', 'number');
266
+ }
267
+ if (number === -Infinity) {
268
+ return options.stylize('-Infinity', 'number');
269
+ }
270
+ if (number === 0) {
271
+ return options.stylize(1 / number === Infinity ? '+0' : '-0', 'number');
272
+ }
273
+ return options.stylize(truncate(String(number), options.truncate), 'number');
274
+ }
275
+
276
+ function inspectBigInt(number, options) {
277
+ let nums = truncate(number.toString(), options.truncate - 1);
278
+ if (nums !== truncator)
279
+ nums += 'n';
280
+ return options.stylize(nums, 'bigint');
281
+ }
282
+
283
+ function inspectRegExp(value, options) {
284
+ const flags = value.toString().split('/')[2];
285
+ const sourceLength = options.truncate - (2 + flags.length);
286
+ const source = value.source;
287
+ return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, 'regexp');
288
+ }
289
+
290
+ // IE11 doesn't support `Array.from(set)`
291
+ function arrayFromSet(set) {
292
+ const values = [];
293
+ set.forEach(value => {
294
+ values.push(value);
295
+ });
296
+ return values;
297
+ }
298
+ function inspectSet(set, options) {
299
+ if (set.size === 0)
300
+ return 'Set{}';
301
+ options.truncate -= 7;
302
+ return `Set{ ${inspectList(arrayFromSet(set), options)} }`;
303
+ }
304
+
305
+ const stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5" +
306
+ '\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', 'g');
307
+ const escapeCharacters = {
308
+ '\b': '\\b',
309
+ '\t': '\\t',
310
+ '\n': '\\n',
311
+ '\f': '\\f',
312
+ '\r': '\\r',
313
+ "'": "\\'",
314
+ '\\': '\\\\',
315
+ };
316
+ const hex = 16;
317
+ function escape(char) {
318
+ return (escapeCharacters[char] ||
319
+ `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-4)}`);
320
+ }
321
+ function inspectString(string, options) {
322
+ if (stringEscapeChars.test(string)) {
323
+ string = string.replace(stringEscapeChars, escape);
324
+ }
325
+ return options.stylize(`'${truncate(string, options.truncate - 2)}'`, 'string');
326
+ }
327
+
328
+ function inspectSymbol(value) {
329
+ if ('description' in Symbol.prototype) {
330
+ return value.description ? `Symbol(${value.description})` : 'Symbol()';
331
+ }
332
+ return value.toString();
333
+ }
334
+
335
+ const getPromiseValue = () => 'Promise{…}';
336
+
337
+ function inspectObject$1(object, options) {
338
+ const properties = Object.getOwnPropertyNames(object);
339
+ const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
340
+ if (properties.length === 0 && symbols.length === 0) {
341
+ return '{}';
342
+ }
343
+ options.truncate -= 4;
344
+ options.seen = options.seen || [];
345
+ if (options.seen.includes(object)) {
346
+ return '[Circular]';
347
+ }
348
+ options.seen.push(object);
349
+ const propertyContents = inspectList(properties.map(key => [key, object[key]]), options, inspectProperty);
350
+ const symbolContents = inspectList(symbols.map(key => [key, object[key]]), options, inspectProperty);
351
+ options.seen.pop();
352
+ let sep = '';
353
+ if (propertyContents && symbolContents) {
354
+ sep = ', ';
355
+ }
356
+ return `{ ${propertyContents}${sep}${symbolContents} }`;
357
+ }
358
+
359
+ const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag ? Symbol.toStringTag : false;
360
+ function inspectClass(value, options) {
361
+ let name = '';
362
+ if (toStringTag && toStringTag in value) {
363
+ name = value[toStringTag];
364
+ }
365
+ name = name || value.constructor.name;
366
+ // Babel transforms anonymous classes to the name `_class`
367
+ if (!name || name === '_class') {
368
+ name = '<Anonymous Class>';
369
+ }
370
+ options.truncate -= name.length;
371
+ return `${name}${inspectObject$1(value, options)}`;
372
+ }
373
+
374
+ function inspectArguments(args, options) {
375
+ if (args.length === 0)
376
+ return 'Arguments[]';
377
+ options.truncate -= 13;
378
+ return `Arguments[ ${inspectList(args, options)} ]`;
379
+ }
380
+
381
+ const errorKeys = [
382
+ 'stack',
383
+ 'line',
384
+ 'column',
385
+ 'name',
386
+ 'message',
387
+ 'fileName',
388
+ 'lineNumber',
389
+ 'columnNumber',
390
+ 'number',
391
+ 'description',
392
+ 'cause',
393
+ ];
394
+ function inspectObject(error, options) {
395
+ const properties = Object.getOwnPropertyNames(error).filter(key => errorKeys.indexOf(key) === -1);
396
+ const name = error.name;
397
+ options.truncate -= name.length;
398
+ let message = '';
399
+ if (typeof error.message === 'string') {
400
+ message = truncate(error.message, options.truncate);
401
+ }
402
+ else {
403
+ properties.unshift('message');
404
+ }
405
+ message = message ? `: ${message}` : '';
406
+ options.truncate -= message.length + 5;
407
+ options.seen = options.seen || [];
408
+ if (options.seen.includes(error)) {
409
+ return '[Circular]';
410
+ }
411
+ options.seen.push(error);
412
+ const propertyContents = inspectList(properties.map(key => [key, error[key]]), options, inspectProperty);
413
+ return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ''}`;
414
+ }
415
+
416
+ function inspectAttribute([key, value], options) {
417
+ options.truncate -= 3;
418
+ if (!value) {
419
+ return `${options.stylize(String(key), 'yellow')}`;
420
+ }
421
+ return `${options.stylize(String(key), 'yellow')}=${options.stylize(`"${value}"`, 'string')}`;
422
+ }
423
+ function inspectNodeCollection(collection, options) {
424
+ return inspectList(collection, options, inspectNode, '\n');
425
+ }
426
+ function inspectNode(node, options) {
427
+ switch (node.nodeType) {
428
+ case 1:
429
+ return inspectHTML(node, options);
430
+ case 3:
431
+ return options.inspect(node.data, options);
432
+ default:
433
+ return options.inspect(node, options);
434
+ }
435
+ }
436
+ // @ts-ignore (Deno doesn't have Element)
437
+ function inspectHTML(element, options) {
438
+ const properties = element.getAttributeNames();
439
+ const name = element.tagName.toLowerCase();
440
+ const head = options.stylize(`<${name}`, 'special');
441
+ const headClose = options.stylize(`>`, 'special');
442
+ const tail = options.stylize(`</${name}>`, 'special');
443
+ options.truncate -= name.length * 2 + 5;
444
+ let propertyContents = '';
445
+ if (properties.length > 0) {
446
+ propertyContents += ' ';
447
+ propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, ' ');
448
+ }
449
+ options.truncate -= propertyContents.length;
450
+ const truncate = options.truncate;
451
+ let children = inspectNodeCollection(element.children, options);
452
+ if (children && children.length > truncate) {
453
+ children = `${truncator}(${element.children.length})`;
454
+ }
455
+ return `${head}${propertyContents}${headClose}${children}${tail}`;
456
+ }
457
+
458
+ /* !
459
+ * loupe
460
+ * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
461
+ * MIT Licensed
462
+ */
463
+ const symbolsSupported = typeof Symbol === 'function' && typeof Symbol.for === 'function';
464
+ const chaiInspect = symbolsSupported ? Symbol.for('chai/inspect') : '@@chai/inspect';
465
+ const nodeInspect = Symbol.for('nodejs.util.inspect.custom');
466
+ const constructorMap = new WeakMap();
467
+ const stringTagMap = {};
468
+ const baseTypesMap = {
469
+ undefined: (value, options) => options.stylize('undefined', 'undefined'),
470
+ null: (value, options) => options.stylize('null', 'null'),
471
+ boolean: (value, options) => options.stylize(String(value), 'boolean'),
472
+ Boolean: (value, options) => options.stylize(String(value), 'boolean'),
473
+ number: inspectNumber,
474
+ Number: inspectNumber,
475
+ bigint: inspectBigInt,
476
+ BigInt: inspectBigInt,
477
+ string: inspectString,
478
+ String: inspectString,
479
+ function: inspectFunction,
480
+ Function: inspectFunction,
481
+ symbol: inspectSymbol,
482
+ // A Symbol polyfill will return `Symbol` not `symbol` from typedetect
483
+ Symbol: inspectSymbol,
484
+ Array: inspectArray,
485
+ Date: inspectDate,
486
+ Map: inspectMap,
487
+ Set: inspectSet,
488
+ RegExp: inspectRegExp,
489
+ Promise: getPromiseValue,
490
+ // WeakSet, WeakMap are totally opaque to us
491
+ WeakSet: (value, options) => options.stylize('WeakSet{…}', 'special'),
492
+ WeakMap: (value, options) => options.stylize('WeakMap{…}', 'special'),
493
+ Arguments: inspectArguments,
494
+ Int8Array: inspectTypedArray,
495
+ Uint8Array: inspectTypedArray,
496
+ Uint8ClampedArray: inspectTypedArray,
497
+ Int16Array: inspectTypedArray,
498
+ Uint16Array: inspectTypedArray,
499
+ Int32Array: inspectTypedArray,
500
+ Uint32Array: inspectTypedArray,
501
+ Float32Array: inspectTypedArray,
502
+ Float64Array: inspectTypedArray,
503
+ Generator: () => '',
504
+ DataView: () => '',
505
+ ArrayBuffer: () => '',
506
+ Error: inspectObject,
507
+ HTMLCollection: inspectNodeCollection,
508
+ NodeList: inspectNodeCollection,
509
+ };
510
+ // eslint-disable-next-line complexity
511
+ const inspectCustom = (value, options, type, inspectFn) => {
512
+ if (chaiInspect in value && typeof value[chaiInspect] === 'function') {
513
+ return value[chaiInspect](options);
514
+ }
515
+ if (nodeInspect in value && typeof value[nodeInspect] === 'function') {
516
+ return value[nodeInspect](options.depth, options, inspectFn);
517
+ }
518
+ if ('inspect' in value && typeof value.inspect === 'function') {
519
+ return value.inspect(options.depth, options);
520
+ }
521
+ if ('constructor' in value && constructorMap.has(value.constructor)) {
522
+ return constructorMap.get(value.constructor)(value, options);
523
+ }
524
+ if (stringTagMap[type]) {
525
+ return stringTagMap[type](value, options);
526
+ }
527
+ return '';
528
+ };
529
+ const toString = Object.prototype.toString;
530
+ // eslint-disable-next-line complexity
531
+ function inspect$1(value, opts = {}) {
532
+ const options = normaliseOptions(opts, inspect$1);
533
+ const { customInspect } = options;
534
+ let type = value === null ? 'null' : typeof value;
535
+ if (type === 'object') {
536
+ type = toString.call(value).slice(8, -1);
537
+ }
538
+ // If it is a base value that we already support, then use Loupe's inspector
539
+ if (type in baseTypesMap) {
540
+ return baseTypesMap[type](value, options);
541
+ }
542
+ // If `options.customInspect` is set to true then try to use the custom inspector
543
+ if (customInspect && value) {
544
+ const output = inspectCustom(value, options, type, inspect$1);
545
+ if (output) {
546
+ if (typeof output === 'string')
547
+ return output;
548
+ return inspect$1(output, options);
549
+ }
550
+ }
551
+ const proto = value ? Object.getPrototypeOf(value) : false;
552
+ // If it's a plain Object then use Loupe's inspector
553
+ if (proto === Object.prototype || proto === null) {
554
+ return inspectObject$1(value, options);
555
+ }
556
+ // Specifically account for HTMLElements
557
+ // @ts-ignore
558
+ if (value && typeof HTMLElement === 'function' && value instanceof HTMLElement) {
559
+ return inspectHTML(value, options);
560
+ }
561
+ if ('constructor' in value) {
562
+ // If it is a class, inspect it like an object but add the constructor name
563
+ if (value.constructor !== Object) {
564
+ return inspectClass(value, options);
565
+ }
566
+ // If it is an object with an anonymous prototype, display it as an object.
567
+ return inspectObject$1(value, options);
568
+ }
569
+ // last chance to check if it's an object
570
+ if (value === Object(value)) {
571
+ return inspectObject$1(value, options);
572
+ }
573
+ // We have run out of options! Just stringify the value
574
+ return options.stylize(String(value), type);
575
+ }
576
+
577
+ const { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins;
578
+ const PLUGINS = [
579
+ ReactTestComponent,
580
+ ReactElement,
581
+ DOMElement,
582
+ DOMCollection,
583
+ Immutable,
584
+ AsymmetricMatcher
585
+ ];
586
+ function stringify(object, maxDepth = 10, { maxLength, ...options } = {}) {
587
+ const MAX_LENGTH = maxLength ?? 1e4;
588
+ let result;
589
+ try {
590
+ result = format$1(object, {
591
+ maxDepth,
592
+ escapeString: false,
593
+ plugins: PLUGINS,
594
+ ...options
595
+ });
596
+ } catch {
597
+ result = format$1(object, {
598
+ callToJSON: false,
599
+ maxDepth,
600
+ escapeString: false,
601
+ plugins: PLUGINS,
602
+ ...options
603
+ });
604
+ }
605
+ // Prevents infinite loop https://github.com/vitest-dev/vitest/issues/7249
606
+ return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(Math.min(maxDepth, Number.MAX_SAFE_INTEGER) / 2), {
607
+ maxLength,
608
+ ...options
609
+ }) : result;
610
+ }
611
+ const formatRegExp = /%[sdjifoOc%]/g;
612
+ function baseFormat(args, options = {}) {
613
+ const formatArg = (item, inspecOptions) => {
614
+ if (options.prettifyObject) {
615
+ return stringify(item, undefined, {
616
+ printBasicPrototype: false,
617
+ escapeString: false
618
+ });
619
+ }
620
+ return inspect(item, inspecOptions);
621
+ };
622
+ if (typeof args[0] !== "string") {
623
+ const objects = [];
624
+ for (let i = 0; i < args.length; i++) {
625
+ objects.push(formatArg(args[i], {
626
+ depth: 0,
627
+ colors: false
628
+ }));
629
+ }
630
+ return objects.join(" ");
631
+ }
632
+ const len = args.length;
633
+ let i = 1;
634
+ const template = args[0];
635
+ let str = String(template).replace(formatRegExp, (x) => {
636
+ if (x === "%%") {
637
+ return "%";
638
+ }
639
+ if (i >= len) {
640
+ return x;
641
+ }
642
+ switch (x) {
643
+ case "%s": {
644
+ const value = args[i++];
645
+ if (typeof value === "bigint") {
646
+ return `${value.toString()}n`;
647
+ }
648
+ if (typeof value === "number" && value === 0 && 1 / value < 0) {
649
+ return "-0";
650
+ }
651
+ if (typeof value === "object" && value !== null) {
652
+ if (typeof value.toString === "function" && value.toString !== Object.prototype.toString) {
653
+ return value.toString();
654
+ }
655
+ return formatArg(value, {
656
+ depth: 0,
657
+ colors: false
658
+ });
659
+ }
660
+ return String(value);
661
+ }
662
+ case "%d": {
663
+ const value = args[i++];
664
+ if (typeof value === "bigint") {
665
+ return `${value.toString()}n`;
666
+ }
667
+ return Number(value).toString();
668
+ }
669
+ case "%i": {
670
+ const value = args[i++];
671
+ if (typeof value === "bigint") {
672
+ return `${value.toString()}n`;
673
+ }
674
+ return Number.parseInt(String(value)).toString();
675
+ }
676
+ case "%f": return Number.parseFloat(String(args[i++])).toString();
677
+ case "%o": return formatArg(args[i++], {
678
+ showHidden: true,
679
+ showProxy: true
680
+ });
681
+ case "%O": return formatArg(args[i++]);
682
+ case "%c": {
683
+ i++;
684
+ return "";
685
+ }
686
+ case "%j": try {
687
+ return JSON.stringify(args[i++]);
688
+ } catch (err) {
689
+ const m = err.message;
690
+ if (m.includes("circular structure") || m.includes("cyclic structures") || m.includes("cyclic object")) {
691
+ return "[Circular]";
692
+ }
693
+ throw err;
694
+ }
695
+ default: return x;
696
+ }
697
+ });
698
+ for (let x = args[i]; i < len; x = args[++i]) {
699
+ if (x === null || typeof x !== "object") {
700
+ str += ` ${x}`;
701
+ } else {
702
+ str += ` ${formatArg(x)}`;
703
+ }
704
+ }
705
+ return str;
706
+ }
707
+ function format(...args) {
708
+ return baseFormat(args);
709
+ }
710
+ function browserFormat(...args) {
711
+ return baseFormat(args, { prettifyObject: true });
712
+ }
713
+ function inspect(obj, options = {}) {
714
+ if (options.truncate === 0) {
715
+ options.truncate = Number.POSITIVE_INFINITY;
716
+ }
717
+ return inspect$1(obj, options);
718
+ }
719
+ function objDisplay(obj, options = {}) {
720
+ if (typeof options.truncate === "undefined") {
721
+ options.truncate = 40;
722
+ }
723
+ const str = inspect(obj, options);
724
+ const type = Object.prototype.toString.call(obj);
725
+ if (options.truncate && str.length >= options.truncate) {
726
+ if (type === "[object Function]") {
727
+ const fn = obj;
728
+ return !fn.name ? "[Function]" : `[Function: ${fn.name}]`;
729
+ } else if (type === "[object Array]") {
730
+ return `[ Array(${obj.length}) ]`;
731
+ } else if (type === "[object Object]") {
732
+ const keys = Object.keys(obj);
733
+ const kstr = keys.length > 2 ? `${keys.splice(0, 2).join(", ")}, ...` : keys.join(", ");
734
+ return `{ Object (${kstr}) }`;
735
+ } else {
736
+ return str;
737
+ }
738
+ }
739
+ return str;
740
+ }
741
+
742
+ export { browserFormat, format, formatRegExp, inspect, objDisplay, stringify };