@eggjs/mock 6.0.6 → 6.1.0-beta.10

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 (309) hide show
  1. package/README.md +35 -56
  2. package/README.zh_CN.md +30 -50
  3. package/dist/_virtual/rolldown_runtime.js +30 -0
  4. package/dist/app/extend/agent.d.ts +39 -0
  5. package/dist/app/extend/agent.js +48 -0
  6. package/dist/app/extend/application.d.ts +175 -0
  7. package/dist/app/extend/application.js +385 -0
  8. package/dist/app/middleware/cluster_app_mock.d.ts +6 -0
  9. package/dist/app/middleware/cluster_app_mock.js +97 -0
  10. package/dist/app.d.ts +10 -0
  11. package/dist/app.js +17 -0
  12. package/dist/bootstrap.d.ts +9 -0
  13. package/dist/bootstrap.js +14 -0
  14. package/dist/index.d.ts +81 -0
  15. package/dist/index.js +47 -0
  16. package/dist/inject_mocha.d.ts +1 -0
  17. package/dist/inject_mocha.js +35 -0
  18. package/dist/lib/agent_handler.d.ts +7 -0
  19. package/dist/lib/agent_handler.js +26 -0
  20. package/dist/lib/app.d.ts +7 -0
  21. package/dist/lib/app.js +251 -0
  22. package/dist/lib/app_handler.d.ts +9 -0
  23. package/dist/lib/app_handler.js +56 -0
  24. package/dist/lib/cluster.d.ts +126 -0
  25. package/dist/lib/cluster.js +283 -0
  26. package/dist/lib/context.d.ts +4 -0
  27. package/dist/lib/context.js +12 -0
  28. package/dist/lib/format_options.d.ts +10 -0
  29. package/dist/lib/format_options.js +65 -0
  30. package/dist/lib/inject_context.d.ts +9 -0
  31. package/dist/lib/inject_context.js +106 -0
  32. package/dist/lib/mock_agent.d.ts +9 -0
  33. package/dist/lib/mock_agent.js +45 -0
  34. package/dist/lib/mock_custom_loader.d.ts +4 -0
  35. package/dist/lib/mock_custom_loader.js +35 -0
  36. package/dist/lib/mock_http_server.d.ts +6 -0
  37. package/dist/lib/mock_http_server.js +17 -0
  38. package/dist/lib/mock_httpclient.d.ts +40 -0
  39. package/dist/lib/mock_httpclient.js +110 -0
  40. package/dist/lib/parallel/agent.d.ts +24 -0
  41. package/dist/lib/parallel/agent.js +111 -0
  42. package/dist/lib/parallel/app.d.ts +24 -0
  43. package/dist/lib/parallel/app.js +99 -0
  44. package/dist/lib/parallel/util.d.ts +6 -0
  45. package/dist/lib/parallel/util.js +59 -0
  46. package/dist/lib/prerequire.d.ts +1 -0
  47. package/dist/lib/prerequire.js +1 -0
  48. package/dist/lib/request_call_function.d.ts +1 -0
  49. package/dist/lib/request_call_function.js +37 -0
  50. package/dist/lib/restore.d.ts +4 -0
  51. package/dist/lib/restore.js +16 -0
  52. package/dist/lib/start-cluster.d.ts +1 -0
  53. package/dist/lib/start-cluster.js +19 -0
  54. package/dist/lib/supertest.d.ts +16 -0
  55. package/dist/lib/supertest.js +39 -0
  56. package/dist/lib/tmp/empty.d.ts +1 -0
  57. package/dist/lib/tmp/empty.js +1 -0
  58. package/{src/lib/types.ts → dist/lib/types.d.ts} +12 -29
  59. package/dist/lib/types.js +1 -0
  60. package/dist/lib/utils.d.ts +12 -0
  61. package/dist/lib/utils.js +40 -0
  62. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +142 -0
  63. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +157 -0
  64. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +97 -0
  65. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +40 -0
  66. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +814 -0
  67. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +50 -0
  68. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +68 -0
  69. package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +752 -0
  70. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +203 -0
  71. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +209 -0
  72. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +18 -0
  73. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +215 -0
  74. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +24 -0
  75. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +33 -0
  76. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +29 -0
  77. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +185 -0
  78. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +23 -0
  79. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +26 -0
  80. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +83 -0
  81. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +51 -0
  82. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +26 -0
  83. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +151 -0
  84. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +178 -0
  85. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +168 -0
  86. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +301 -0
  87. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +137 -0
  88. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +367 -0
  89. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +91 -0
  90. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +99 -0
  91. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +23 -0
  92. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +30 -0
  93. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +22 -0
  94. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +97 -0
  95. package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +14 -0
  96. package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +16 -0
  97. package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +4093 -0
  98. package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +14 -0
  99. package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +27 -0
  100. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +12 -0
  101. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +83 -0
  102. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +35 -0
  103. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +392 -0
  104. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +86 -0
  105. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +104 -0
  106. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +99 -0
  107. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +65 -0
  108. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +18 -0
  109. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +95 -0
  110. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +105 -0
  111. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +1037 -0
  112. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +24 -0
  113. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +152 -0
  114. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +74 -0
  115. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +22 -0
  116. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +329 -0
  117. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +314 -0
  118. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +22 -0
  119. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +417 -0
  120. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +79 -0
  121. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +75 -0
  122. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +283 -0
  123. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +40 -0
  124. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +90 -0
  125. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +145 -0
  126. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +107 -0
  127. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +77 -0
  128. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +106 -0
  129. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +57 -0
  130. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +233 -0
  131. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +92 -0
  132. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +91 -0
  133. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +261 -0
  134. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +166 -0
  135. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +346 -0
  136. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +922 -0
  137. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +72 -0
  138. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +517 -0
  139. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +105 -0
  140. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +505 -0
  141. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +225 -0
  142. package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +124 -0
  143. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +11 -0
  144. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +114 -0
  145. package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +76 -0
  146. package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +89 -0
  147. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Pool.js +366 -0
  148. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +248 -0
  149. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +419 -0
  150. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +27 -0
  151. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +18 -0
  152. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +16 -0
  153. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +63 -0
  154. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +21 -0
  155. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +9 -0
  156. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +277 -0
  157. package/dist/register.d.ts +10 -0
  158. package/dist/register.js +40 -0
  159. package/dist/typings/index.d.ts +1 -0
  160. package/package.json +71 -98
  161. package/dist/commonjs/app/extend/agent.d.ts +0 -34
  162. package/dist/commonjs/app/extend/agent.js +0 -49
  163. package/dist/commonjs/app/extend/application.d.ts +0 -171
  164. package/dist/commonjs/app/extend/application.js +0 -450
  165. package/dist/commonjs/app/middleware/cluster_app_mock.d.ts +0 -3
  166. package/dist/commonjs/app/middleware/cluster_app_mock.js +0 -101
  167. package/dist/commonjs/app.d.ts +0 -6
  168. package/dist/commonjs/app.js +0 -20
  169. package/dist/commonjs/bootstrap.d.ts +0 -5
  170. package/dist/commonjs/bootstrap.js +0 -59
  171. package/dist/commonjs/index.d.ts +0 -77
  172. package/dist/commonjs/index.js +0 -114
  173. package/dist/commonjs/lib/agent_handler.d.ts +0 -3
  174. package/dist/commonjs/lib/agent_handler.js +0 -28
  175. package/dist/commonjs/lib/app.d.ts +0 -3
  176. package/dist/commonjs/lib/app.js +0 -301
  177. package/dist/commonjs/lib/app_handler.d.ts +0 -5
  178. package/dist/commonjs/lib/app_handler.js +0 -71
  179. package/dist/commonjs/lib/cluster.d.ts +0 -114
  180. package/dist/commonjs/lib/cluster.js +0 -337
  181. package/dist/commonjs/lib/context.d.ts +0 -1
  182. package/dist/commonjs/lib/context.js +0 -16
  183. package/dist/commonjs/lib/format_options.d.ts +0 -5
  184. package/dist/commonjs/lib/format_options.js +0 -100
  185. package/dist/commonjs/lib/inject_context.d.ts +0 -6
  186. package/dist/commonjs/lib/inject_context.js +0 -132
  187. package/dist/commonjs/lib/mock_agent.d.ts +0 -5
  188. package/dist/commonjs/lib/mock_agent.js +0 -49
  189. package/dist/commonjs/lib/mock_custom_loader.d.ts +0 -1
  190. package/dist/commonjs/lib/mock_custom_loader.js +0 -37
  191. package/dist/commonjs/lib/mock_http_server.d.ts +0 -2
  192. package/dist/commonjs/lib/mock_http_server.js +0 -24
  193. package/dist/commonjs/lib/mock_httpclient.d.ts +0 -36
  194. package/dist/commonjs/lib/mock_httpclient.js +0 -147
  195. package/dist/commonjs/lib/parallel/agent.d.ts +0 -20
  196. package/dist/commonjs/lib/parallel/agent.js +0 -125
  197. package/dist/commonjs/lib/parallel/app.d.ts +0 -20
  198. package/dist/commonjs/lib/parallel/app.js +0 -115
  199. package/dist/commonjs/lib/parallel/util.d.ts +0 -3
  200. package/dist/commonjs/lib/parallel/util.js +0 -77
  201. package/dist/commonjs/lib/prerequire.d.ts +0 -1
  202. package/dist/commonjs/lib/prerequire.js +0 -26
  203. package/dist/commonjs/lib/request_call_function.d.ts +0 -1
  204. package/dist/commonjs/lib/request_call_function.js +0 -52
  205. package/dist/commonjs/lib/restore.d.ts +0 -1
  206. package/dist/commonjs/lib/restore.js +0 -16
  207. package/dist/commonjs/lib/start-cluster.d.ts +0 -2
  208. package/dist/commonjs/lib/start-cluster.js +0 -23
  209. package/dist/commonjs/lib/supertest.d.ts +0 -11
  210. package/dist/commonjs/lib/supertest.js +0 -48
  211. package/dist/commonjs/lib/tmp/empty.d.ts +0 -1
  212. package/dist/commonjs/lib/tmp/empty.js +0 -3
  213. package/dist/commonjs/lib/types.d.ts +0 -68
  214. package/dist/commonjs/lib/types.js +0 -3
  215. package/dist/commonjs/lib/utils.d.ts +0 -9
  216. package/dist/commonjs/lib/utils.js +0 -80
  217. package/dist/commonjs/package.json +0 -3
  218. package/dist/commonjs/register.d.ts +0 -8
  219. package/dist/commonjs/register.js +0 -80
  220. package/dist/esm/app/extend/agent.d.ts +0 -34
  221. package/dist/esm/app/extend/agent.js +0 -46
  222. package/dist/esm/app/extend/application.d.ts +0 -171
  223. package/dist/esm/app/extend/application.js +0 -444
  224. package/dist/esm/app/middleware/cluster_app_mock.d.ts +0 -3
  225. package/dist/esm/app/middleware/cluster_app_mock.js +0 -99
  226. package/dist/esm/app.d.ts +0 -6
  227. package/dist/esm/app.js +0 -17
  228. package/dist/esm/bootstrap.d.ts +0 -5
  229. package/dist/esm/bootstrap.js +0 -15
  230. package/dist/esm/index.d.ts +0 -77
  231. package/dist/esm/index.js +0 -91
  232. package/dist/esm/lib/agent_handler.d.ts +0 -3
  233. package/dist/esm/lib/agent_handler.js +0 -24
  234. package/dist/esm/lib/app.d.ts +0 -3
  235. package/dist/esm/lib/app.js +0 -295
  236. package/dist/esm/lib/app_handler.d.ts +0 -5
  237. package/dist/esm/lib/app_handler.js +0 -65
  238. package/dist/esm/lib/cluster.d.ts +0 -114
  239. package/dist/esm/lib/cluster.js +0 -328
  240. package/dist/esm/lib/context.d.ts +0 -1
  241. package/dist/esm/lib/context.js +0 -13
  242. package/dist/esm/lib/format_options.d.ts +0 -5
  243. package/dist/esm/lib/format_options.js +0 -94
  244. package/dist/esm/lib/inject_context.d.ts +0 -6
  245. package/dist/esm/lib/inject_context.js +0 -126
  246. package/dist/esm/lib/mock_agent.d.ts +0 -5
  247. package/dist/esm/lib/mock_agent.js +0 -45
  248. package/dist/esm/lib/mock_custom_loader.d.ts +0 -1
  249. package/dist/esm/lib/mock_custom_loader.js +0 -34
  250. package/dist/esm/lib/mock_http_server.d.ts +0 -2
  251. package/dist/esm/lib/mock_http_server.js +0 -18
  252. package/dist/esm/lib/mock_httpclient.d.ts +0 -36
  253. package/dist/esm/lib/mock_httpclient.js +0 -144
  254. package/dist/esm/lib/parallel/agent.d.ts +0 -20
  255. package/dist/esm/lib/parallel/agent.js +0 -117
  256. package/dist/esm/lib/parallel/app.d.ts +0 -20
  257. package/dist/esm/lib/parallel/app.js +0 -110
  258. package/dist/esm/lib/parallel/util.d.ts +0 -3
  259. package/dist/esm/lib/parallel/util.js +0 -73
  260. package/dist/esm/lib/prerequire.d.ts +0 -1
  261. package/dist/esm/lib/prerequire.js +0 -25
  262. package/dist/esm/lib/request_call_function.d.ts +0 -1
  263. package/dist/esm/lib/request_call_function.js +0 -47
  264. package/dist/esm/lib/restore.d.ts +0 -1
  265. package/dist/esm/lib/restore.js +0 -13
  266. package/dist/esm/lib/start-cluster.d.ts +0 -2
  267. package/dist/esm/lib/start-cluster.js +0 -18
  268. package/dist/esm/lib/supertest.d.ts +0 -11
  269. package/dist/esm/lib/supertest.js +0 -40
  270. package/dist/esm/lib/tmp/empty.d.ts +0 -1
  271. package/dist/esm/lib/tmp/empty.js +0 -2
  272. package/dist/esm/lib/types.d.ts +0 -68
  273. package/dist/esm/lib/types.js +0 -2
  274. package/dist/esm/lib/utils.d.ts +0 -9
  275. package/dist/esm/lib/utils.js +0 -69
  276. package/dist/esm/package.json +0 -3
  277. package/dist/esm/register.d.ts +0 -8
  278. package/dist/esm/register.js +0 -75
  279. package/dist/package.json +0 -4
  280. package/src/app/extend/agent.ts +0 -57
  281. package/src/app/extend/application.ts +0 -510
  282. package/src/app/middleware/cluster_app_mock.ts +0 -102
  283. package/src/app.ts +0 -18
  284. package/src/bootstrap.ts +0 -25
  285. package/src/index.ts +0 -112
  286. package/src/lib/agent_handler.ts +0 -28
  287. package/src/lib/app.ts +0 -314
  288. package/src/lib/app_handler.ts +0 -77
  289. package/src/lib/cluster.ts +0 -363
  290. package/src/lib/context.ts +0 -14
  291. package/src/lib/format_options.ts +0 -103
  292. package/src/lib/inject_context.ts +0 -134
  293. package/src/lib/mock_agent.ts +0 -57
  294. package/src/lib/mock_custom_loader.ts +0 -36
  295. package/src/lib/mock_http_server.ts +0 -19
  296. package/src/lib/mock_httpclient.ts +0 -183
  297. package/src/lib/parallel/agent.ts +0 -128
  298. package/src/lib/parallel/app.ts +0 -123
  299. package/src/lib/parallel/util.ts +0 -66
  300. package/src/lib/prerequire.ts +0 -25
  301. package/src/lib/request_call_function.ts +0 -49
  302. package/src/lib/restore.ts +0 -14
  303. package/src/lib/start-cluster.ts +0 -23
  304. package/src/lib/supertest.ts +0 -45
  305. package/src/lib/tmp/.gitkeep +0 -0
  306. package/src/lib/tmp/empty.ts +0 -0
  307. package/src/lib/utils.ts +0 -82
  308. package/src/register.ts +0 -80
  309. package/src/typings/index.d.ts +0 -4
@@ -0,0 +1,137 @@
1
+ import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js
4
+ var require_line_endings = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js": ((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isUnix = isUnix;
7
+ exports.isWin = isWin;
8
+ exports.unixToWin = unixToWin;
9
+ exports.winToUnix = winToUnix;
10
+ function _typeof(o) {
11
+ "@babel/helpers - typeof";
12
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
13
+ return typeof o$1;
14
+ } : function(o$1) {
15
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
16
+ }, _typeof(o);
17
+ }
18
+ function ownKeys(e, r) {
19
+ var t = Object.keys(e);
20
+ if (Object.getOwnPropertySymbols) {
21
+ var o = Object.getOwnPropertySymbols(e);
22
+ r && (o = o.filter(function(r$1) {
23
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
24
+ })), t.push.apply(t, o);
25
+ }
26
+ return t;
27
+ }
28
+ function _objectSpread(e) {
29
+ for (var r = 1; r < arguments.length; r++) {
30
+ var t = null != arguments[r] ? arguments[r] : {};
31
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
32
+ _defineProperty(e, r$1, t[r$1]);
33
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
34
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
35
+ });
36
+ }
37
+ return e;
38
+ }
39
+ function _defineProperty(obj, key, value) {
40
+ key = _toPropertyKey(key);
41
+ if (key in obj) Object.defineProperty(obj, key, {
42
+ value,
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true
46
+ });
47
+ else obj[key] = value;
48
+ return obj;
49
+ }
50
+ function _toPropertyKey(t) {
51
+ var i = _toPrimitive(t, "string");
52
+ return "symbol" == _typeof(i) ? i : i + "";
53
+ }
54
+ function _toPrimitive(t, r) {
55
+ if ("object" != _typeof(t) || !t) return t;
56
+ var e = t[Symbol.toPrimitive];
57
+ if (void 0 !== e) {
58
+ var i = e.call(t, r || "default");
59
+ if ("object" != _typeof(i)) return i;
60
+ throw new TypeError("@@toPrimitive must return a primitive value.");
61
+ }
62
+ return ("string" === r ? String : Number)(t);
63
+ }
64
+ /*istanbul ignore end*/
65
+ function unixToWin(patch) {
66
+ if (Array.isArray(patch)) return patch.map(unixToWin);
67
+ return _objectSpread(_objectSpread(
68
+ {},
69
+ /*istanbul ignore end*/
70
+ patch
71
+ ), {}, { hunks: patch.hunks.map(function(hunk) {
72
+ return _objectSpread(_objectSpread(
73
+ {},
74
+ /*istanbul ignore end*/
75
+ hunk
76
+ ), {}, { lines: hunk.lines.map(function(line, i) {
77
+ var _hunk$lines;
78
+ return line.startsWith("\\") || line.endsWith("\r") || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith("\\") ? line : line + "\r";
79
+ }) });
80
+ }) });
81
+ }
82
+ function winToUnix(patch) {
83
+ if (Array.isArray(patch)) return patch.map(winToUnix);
84
+ return _objectSpread(_objectSpread(
85
+ {},
86
+ /*istanbul ignore end*/
87
+ patch
88
+ ), {}, { hunks: patch.hunks.map(function(hunk) {
89
+ return _objectSpread(_objectSpread(
90
+ {},
91
+ /*istanbul ignore end*/
92
+ hunk
93
+ ), {}, { lines: hunk.lines.map(function(line) {
94
+ return line.endsWith("\r") ? line.substring(0, line.length - 1) : line;
95
+ }) });
96
+ }) });
97
+ }
98
+ /**
99
+ * Returns true if the patch consistently uses Unix line endings (or only involves one line and has
100
+ * no line endings).
101
+ */
102
+ function isUnix(patch) {
103
+ if (!Array.isArray(patch)) patch = [patch];
104
+ return !patch.some(function(index) {
105
+ return index.hunks.some(function(hunk) {
106
+ return hunk.lines.some(function(line) {
107
+ return !line.startsWith("\\") && line.endsWith("\r");
108
+ });
109
+ });
110
+ });
111
+ }
112
+ /**
113
+ * Returns true if the patch uses Windows line endings and only Windows line endings.
114
+ */
115
+ function isWin(patch) {
116
+ if (!Array.isArray(patch)) patch = [patch];
117
+ return patch.some(function(index) {
118
+ return index.hunks.some(function(hunk) {
119
+ return hunk.lines.some(function(line) {
120
+ return line.endsWith("\r");
121
+ });
122
+ });
123
+ }) && patch.every(function(index) {
124
+ return index.hunks.every(function(hunk) {
125
+ return hunk.lines.every(function(line, i) {
126
+ var _hunk$lines2;
127
+ return line.startsWith("\\") || line.endsWith("\r") || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith("\\"));
128
+ });
129
+ });
130
+ });
131
+ }
132
+ }) });
133
+
134
+ //#endregion
135
+ export default require_line_endings();
136
+
137
+ export { require_line_endings };
@@ -0,0 +1,367 @@
1
+ import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_parse } from "./parse.js";
3
+ import { require_create } from "./create.js";
4
+ import { require_array } from "../util/array.js";
5
+
6
+ //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js
7
+ var require_merge = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js": ((exports) => {
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.calcLineCount = calcLineCount;
10
+ exports.merge = merge;
11
+ /*istanbul ignore end*/
12
+ var _create = require_create();
13
+ var _parse = require_parse();
14
+ var _array = require_array();
15
+ /*istanbul ignore start*/ function _toConsumableArray(arr) {
16
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
17
+ }
18
+ function _nonIterableSpread() {
19
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
20
+ }
21
+ function _unsupportedIterableToArray(o, minLen) {
22
+ if (!o) return;
23
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
24
+ var n = Object.prototype.toString.call(o).slice(8, -1);
25
+ if (n === "Object" && o.constructor) n = o.constructor.name;
26
+ if (n === "Map" || n === "Set") return Array.from(o);
27
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
28
+ }
29
+ function _iterableToArray(iter) {
30
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
31
+ }
32
+ function _arrayWithoutHoles(arr) {
33
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
34
+ }
35
+ function _arrayLikeToArray(arr, len) {
36
+ if (len == null || len > arr.length) len = arr.length;
37
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
38
+ return arr2;
39
+ }
40
+ /*istanbul ignore end*/
41
+ function calcLineCount(hunk) {
42
+ var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), oldLines = _calcOldNewLineCount.oldLines, newLines = _calcOldNewLineCount.newLines;
43
+ if (oldLines !== void 0) hunk.oldLines = oldLines;
44
+ else delete hunk.oldLines;
45
+ if (newLines !== void 0) hunk.newLines = newLines;
46
+ else delete hunk.newLines;
47
+ }
48
+ function merge(mine, theirs, base) {
49
+ mine = loadPatch(mine, base);
50
+ theirs = loadPatch(theirs, base);
51
+ var ret = {};
52
+ if (mine.index || theirs.index) ret.index = mine.index || theirs.index;
53
+ if (mine.newFileName || theirs.newFileName) if (!fileNameChanged(mine)) {
54
+ ret.oldFileName = theirs.oldFileName || mine.oldFileName;
55
+ ret.newFileName = theirs.newFileName || mine.newFileName;
56
+ ret.oldHeader = theirs.oldHeader || mine.oldHeader;
57
+ ret.newHeader = theirs.newHeader || mine.newHeader;
58
+ } else if (!fileNameChanged(theirs)) {
59
+ ret.oldFileName = mine.oldFileName;
60
+ ret.newFileName = mine.newFileName;
61
+ ret.oldHeader = mine.oldHeader;
62
+ ret.newHeader = mine.newHeader;
63
+ } else {
64
+ ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
65
+ ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
66
+ ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
67
+ ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
68
+ }
69
+ ret.hunks = [];
70
+ var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0;
71
+ while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
72
+ var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity }, theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity };
73
+ if (hunkBefore(mineCurrent, theirsCurrent)) {
74
+ ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
75
+ mineIndex++;
76
+ theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
77
+ } else if (hunkBefore(theirsCurrent, mineCurrent)) {
78
+ ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
79
+ theirsIndex++;
80
+ mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
81
+ } else {
82
+ var mergedHunk = {
83
+ oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
84
+ oldLines: 0,
85
+ newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
86
+ newLines: 0,
87
+ lines: []
88
+ };
89
+ mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
90
+ theirsIndex++;
91
+ mineIndex++;
92
+ ret.hunks.push(mergedHunk);
93
+ }
94
+ }
95
+ return ret;
96
+ }
97
+ function loadPatch(param, base) {
98
+ if (typeof param === "string") {
99
+ if (/^@@/m.test(param) || /^Index:/m.test(param)) return (0, _parse.parsePatch)(param)[0];
100
+ if (!base) throw new Error("Must provide a base reference or pass in a patch");
101
+ return (0, _create.structuredPatch)(void 0, void 0, base, param);
102
+ }
103
+ return param;
104
+ }
105
+ function fileNameChanged(patch) {
106
+ return patch.newFileName && patch.newFileName !== patch.oldFileName;
107
+ }
108
+ function selectField(index, mine, theirs) {
109
+ if (mine === theirs) return mine;
110
+ else {
111
+ index.conflict = true;
112
+ return {
113
+ mine,
114
+ theirs
115
+ };
116
+ }
117
+ }
118
+ function hunkBefore(test, check) {
119
+ return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
120
+ }
121
+ function cloneHunk(hunk, offset) {
122
+ return {
123
+ oldStart: hunk.oldStart,
124
+ oldLines: hunk.oldLines,
125
+ newStart: hunk.newStart + offset,
126
+ newLines: hunk.newLines,
127
+ lines: hunk.lines
128
+ };
129
+ }
130
+ function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
131
+ var mine = {
132
+ offset: mineOffset,
133
+ lines: mineLines,
134
+ index: 0
135
+ }, their = {
136
+ offset: theirOffset,
137
+ lines: theirLines,
138
+ index: 0
139
+ };
140
+ insertLeading(hunk, mine, their);
141
+ insertLeading(hunk, their, mine);
142
+ while (mine.index < mine.lines.length && their.index < their.lines.length) {
143
+ var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index];
144
+ if ((mineCurrent[0] === "-" || mineCurrent[0] === "+") && (theirCurrent[0] === "-" || theirCurrent[0] === "+")) mutualChange(hunk, mine, their);
145
+ else if (mineCurrent[0] === "+" && theirCurrent[0] === " ") {
146
+ /*istanbul ignore start*/
147
+ var _hunk$lines;
148
+ /*istanbul ignore end*/
149
+ /*istanbul ignore start*/
150
+ /*istanbul ignore end*/
151
+ /*istanbul ignore start*/
152
+ (_hunk$lines = hunk.lines).push.apply(
153
+ /*istanbul ignore start*/
154
+ _hunk$lines,
155
+ /*istanbul ignore start*/
156
+ _toConsumableArray(
157
+ /*istanbul ignore end*/
158
+ collectChange(mine)
159
+ )
160
+ );
161
+ } else if (theirCurrent[0] === "+" && mineCurrent[0] === " ") {
162
+ /*istanbul ignore start*/
163
+ var _hunk$lines2;
164
+ /*istanbul ignore end*/
165
+ /*istanbul ignore start*/
166
+ /*istanbul ignore end*/
167
+ /*istanbul ignore start*/
168
+ (_hunk$lines2 = hunk.lines).push.apply(
169
+ /*istanbul ignore start*/
170
+ _hunk$lines2,
171
+ /*istanbul ignore start*/
172
+ _toConsumableArray(
173
+ /*istanbul ignore end*/
174
+ collectChange(their)
175
+ )
176
+ );
177
+ } else if (mineCurrent[0] === "-" && theirCurrent[0] === " ") removal(hunk, mine, their);
178
+ else if (theirCurrent[0] === "-" && mineCurrent[0] === " ") removal(hunk, their, mine, true);
179
+ else if (mineCurrent === theirCurrent) {
180
+ hunk.lines.push(mineCurrent);
181
+ mine.index++;
182
+ their.index++;
183
+ } else conflict(hunk, collectChange(mine), collectChange(their));
184
+ }
185
+ insertTrailing(hunk, mine);
186
+ insertTrailing(hunk, their);
187
+ calcLineCount(hunk);
188
+ }
189
+ function mutualChange(hunk, mine, their) {
190
+ var myChanges = collectChange(mine), theirChanges = collectChange(their);
191
+ if (allRemoves(myChanges) && allRemoves(theirChanges)) {
192
+ if ((0, _array.arrayStartsWith)(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
193
+ /*istanbul ignore start*/
194
+ var _hunk$lines3;
195
+ /*istanbul ignore end*/
196
+ /*istanbul ignore start*/
197
+ /*istanbul ignore end*/
198
+ /*istanbul ignore start*/
199
+ (_hunk$lines3 = hunk.lines).push.apply(
200
+ /*istanbul ignore start*/
201
+ _hunk$lines3,
202
+ /*istanbul ignore start*/
203
+ _toConsumableArray(
204
+ /*istanbul ignore end*/
205
+ myChanges
206
+ )
207
+ );
208
+ return;
209
+ } else if ((0, _array.arrayStartsWith)(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
210
+ /*istanbul ignore start*/
211
+ var _hunk$lines4;
212
+ /*istanbul ignore end*/
213
+ /*istanbul ignore start*/
214
+ /*istanbul ignore end*/
215
+ /*istanbul ignore start*/
216
+ (_hunk$lines4 = hunk.lines).push.apply(
217
+ /*istanbul ignore start*/
218
+ _hunk$lines4,
219
+ /*istanbul ignore start*/
220
+ _toConsumableArray(
221
+ /*istanbul ignore end*/
222
+ theirChanges
223
+ )
224
+ );
225
+ return;
226
+ }
227
+ } else if ((0, _array.arrayEqual)(myChanges, theirChanges)) {
228
+ /*istanbul ignore start*/
229
+ var _hunk$lines5;
230
+ /*istanbul ignore end*/
231
+ /*istanbul ignore start*/
232
+ /*istanbul ignore end*/
233
+ /*istanbul ignore start*/
234
+ (_hunk$lines5 = hunk.lines).push.apply(
235
+ /*istanbul ignore start*/
236
+ _hunk$lines5,
237
+ /*istanbul ignore start*/
238
+ _toConsumableArray(
239
+ /*istanbul ignore end*/
240
+ myChanges
241
+ )
242
+ );
243
+ return;
244
+ }
245
+ conflict(hunk, myChanges, theirChanges);
246
+ }
247
+ function removal(hunk, mine, their, swap) {
248
+ var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges);
249
+ if (theirChanges.merged) {
250
+ /*istanbul ignore start*/
251
+ var _hunk$lines6;
252
+ /*istanbul ignore end*/
253
+ /*istanbul ignore start*/
254
+ /*istanbul ignore end*/
255
+ /*istanbul ignore start*/
256
+ (_hunk$lines6 = hunk.lines).push.apply(
257
+ /*istanbul ignore start*/
258
+ _hunk$lines6,
259
+ /*istanbul ignore start*/
260
+ _toConsumableArray(
261
+ /*istanbul ignore end*/
262
+ theirChanges.merged
263
+ )
264
+ );
265
+ } else conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
266
+ }
267
+ function conflict(hunk, mine, their) {
268
+ hunk.conflict = true;
269
+ hunk.lines.push({
270
+ conflict: true,
271
+ mine,
272
+ theirs: their
273
+ });
274
+ }
275
+ function insertLeading(hunk, insert, their) {
276
+ while (insert.offset < their.offset && insert.index < insert.lines.length) {
277
+ var line = insert.lines[insert.index++];
278
+ hunk.lines.push(line);
279
+ insert.offset++;
280
+ }
281
+ }
282
+ function insertTrailing(hunk, insert) {
283
+ while (insert.index < insert.lines.length) {
284
+ var line = insert.lines[insert.index++];
285
+ hunk.lines.push(line);
286
+ }
287
+ }
288
+ function collectChange(state) {
289
+ var ret = [], operation = state.lines[state.index][0];
290
+ while (state.index < state.lines.length) {
291
+ var line = state.lines[state.index];
292
+ if (operation === "-" && line[0] === "+") operation = "+";
293
+ if (operation === line[0]) {
294
+ ret.push(line);
295
+ state.index++;
296
+ } else break;
297
+ }
298
+ return ret;
299
+ }
300
+ function collectContext(state, matchChanges) {
301
+ var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false;
302
+ while (matchIndex < matchChanges.length && state.index < state.lines.length) {
303
+ var change = state.lines[state.index], match = matchChanges[matchIndex];
304
+ if (match[0] === "+") break;
305
+ contextChanges = contextChanges || change[0] !== " ";
306
+ merged.push(match);
307
+ matchIndex++;
308
+ if (change[0] === "+") {
309
+ conflicted = true;
310
+ while (change[0] === "+") {
311
+ changes.push(change);
312
+ change = state.lines[++state.index];
313
+ }
314
+ }
315
+ if (match.substr(1) === change.substr(1)) {
316
+ changes.push(change);
317
+ state.index++;
318
+ } else conflicted = true;
319
+ }
320
+ if ((matchChanges[matchIndex] || "")[0] === "+" && contextChanges) conflicted = true;
321
+ if (conflicted) return changes;
322
+ while (matchIndex < matchChanges.length) merged.push(matchChanges[matchIndex++]);
323
+ return {
324
+ merged,
325
+ changes
326
+ };
327
+ }
328
+ function allRemoves(changes) {
329
+ return changes.reduce(function(prev, change) {
330
+ return prev && change[0] === "-";
331
+ }, true);
332
+ }
333
+ function skipRemoveSuperset(state, removeChanges, delta) {
334
+ for (var i = 0; i < delta; i++) {
335
+ var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
336
+ if (state.lines[state.index + i] !== " " + changeContent) return false;
337
+ }
338
+ state.index += delta;
339
+ return true;
340
+ }
341
+ function calcOldNewLineCount(lines) {
342
+ var oldLines = 0;
343
+ var newLines = 0;
344
+ lines.forEach(function(line) {
345
+ if (typeof line !== "string") {
346
+ var myCount = calcOldNewLineCount(line.mine);
347
+ var theirCount = calcOldNewLineCount(line.theirs);
348
+ if (oldLines !== void 0) if (myCount.oldLines === theirCount.oldLines) oldLines += myCount.oldLines;
349
+ else oldLines = void 0;
350
+ if (newLines !== void 0) if (myCount.newLines === theirCount.newLines) newLines += myCount.newLines;
351
+ else newLines = void 0;
352
+ } else {
353
+ if (newLines !== void 0 && (line[0] === "+" || line[0] === " ")) newLines++;
354
+ if (oldLines !== void 0 && (line[0] === "-" || line[0] === " ")) oldLines++;
355
+ }
356
+ });
357
+ return {
358
+ oldLines,
359
+ newLines
360
+ };
361
+ }
362
+ }) });
363
+
364
+ //#endregion
365
+ export default require_merge();
366
+
367
+ export { require_merge };
@@ -0,0 +1,91 @@
1
+ import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js
4
+ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js": ((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parsePatch = parsePatch;
7
+ /*istanbul ignore end*/
8
+ function parsePatch(uniDiff) {
9
+ var diffstr = uniDiff.split(/\n/), list = [], i = 0;
10
+ function parseIndex() {
11
+ var index = {};
12
+ list.push(index);
13
+ while (i < diffstr.length) {
14
+ var line = diffstr[i];
15
+ if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) break;
16
+ var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
17
+ if (header) index.index = header[1];
18
+ i++;
19
+ }
20
+ parseFileHeader(index);
21
+ parseFileHeader(index);
22
+ index.hunks = [];
23
+ while (i < diffstr.length) {
24
+ var _line = diffstr[i];
25
+ if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) break;
26
+ else if (/^@@/.test(_line)) index.hunks.push(parseHunk());
27
+ else if (_line) throw new Error("Unknown line " + (i + 1) + " " + JSON.stringify(_line));
28
+ else i++;
29
+ }
30
+ }
31
+ function parseFileHeader(index) {
32
+ var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
33
+ if (fileHeader) {
34
+ var keyPrefix = fileHeader[1] === "---" ? "old" : "new";
35
+ var data = fileHeader[2].split(" ", 2);
36
+ var fileName = data[0].replace(/\\\\/g, "\\");
37
+ if (/^".*"$/.test(fileName)) fileName = fileName.substr(1, fileName.length - 2);
38
+ index[keyPrefix + "FileName"] = fileName;
39
+ index[keyPrefix + "Header"] = (data[1] || "").trim();
40
+ i++;
41
+ }
42
+ }
43
+ function parseHunk() {
44
+ var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
45
+ var hunk = {
46
+ oldStart: +chunkHeader[1],
47
+ oldLines: typeof chunkHeader[2] === "undefined" ? 1 : +chunkHeader[2],
48
+ newStart: +chunkHeader[3],
49
+ newLines: typeof chunkHeader[4] === "undefined" ? 1 : +chunkHeader[4],
50
+ lines: []
51
+ };
52
+ if (hunk.oldLines === 0) hunk.oldStart += 1;
53
+ if (hunk.newLines === 0) hunk.newStart += 1;
54
+ var addCount = 0, removeCount = 0;
55
+ for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith("\\")); i++) {
56
+ /*istanbul ignore start*/
57
+ var _diffstr$i;
58
+ /*istanbul ignore end*/
59
+ var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? " " : diffstr[i][0];
60
+ if (operation === "+" || operation === "-" || operation === " " || operation === "\\") {
61
+ hunk.lines.push(diffstr[i]);
62
+ if (operation === "+") addCount++;
63
+ else if (operation === "-") removeCount++;
64
+ else if (operation === " ") {
65
+ addCount++;
66
+ removeCount++;
67
+ }
68
+ } else throw new Error(
69
+ /*istanbul ignore start*/
70
+ "Hunk at line ".concat(
71
+ /*istanbul ignore end*/
72
+ chunkHeaderIndex + 1,
73
+ " contained invalid line "
74
+ ).concat(diffstr[i])
75
+ );
76
+ }
77
+ if (!addCount && hunk.newLines === 1) hunk.newLines = 0;
78
+ if (!removeCount && hunk.oldLines === 1) hunk.oldLines = 0;
79
+ if (addCount !== hunk.newLines) throw new Error("Added line count did not match for hunk at line " + (chunkHeaderIndex + 1));
80
+ if (removeCount !== hunk.oldLines) throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1));
81
+ return hunk;
82
+ }
83
+ while (i < diffstr.length) parseIndex();
84
+ return list;
85
+ }
86
+ }) });
87
+
88
+ //#endregion
89
+ export default require_parse();
90
+
91
+ export { require_parse };
@@ -0,0 +1,99 @@
1
+ import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
+
3
+ //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js
4
+ var require_reverse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js": ((exports) => {
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.reversePatch = reversePatch;
7
+ function _typeof(o) {
8
+ "@babel/helpers - typeof";
9
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
10
+ return typeof o$1;
11
+ } : function(o$1) {
12
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
13
+ }, _typeof(o);
14
+ }
15
+ function ownKeys(e, r) {
16
+ var t = Object.keys(e);
17
+ if (Object.getOwnPropertySymbols) {
18
+ var o = Object.getOwnPropertySymbols(e);
19
+ r && (o = o.filter(function(r$1) {
20
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
21
+ })), t.push.apply(t, o);
22
+ }
23
+ return t;
24
+ }
25
+ function _objectSpread(e) {
26
+ for (var r = 1; r < arguments.length; r++) {
27
+ var t = null != arguments[r] ? arguments[r] : {};
28
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
29
+ _defineProperty(e, r$1, t[r$1]);
30
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
31
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
32
+ });
33
+ }
34
+ return e;
35
+ }
36
+ function _defineProperty(obj, key, value) {
37
+ key = _toPropertyKey(key);
38
+ if (key in obj) Object.defineProperty(obj, key, {
39
+ value,
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true
43
+ });
44
+ else obj[key] = value;
45
+ return obj;
46
+ }
47
+ function _toPropertyKey(t) {
48
+ var i = _toPrimitive(t, "string");
49
+ return "symbol" == _typeof(i) ? i : i + "";
50
+ }
51
+ function _toPrimitive(t, r) {
52
+ if ("object" != _typeof(t) || !t) return t;
53
+ var e = t[Symbol.toPrimitive];
54
+ if (void 0 !== e) {
55
+ var i = e.call(t, r || "default");
56
+ if ("object" != _typeof(i)) return i;
57
+ throw new TypeError("@@toPrimitive must return a primitive value.");
58
+ }
59
+ return ("string" === r ? String : Number)(t);
60
+ }
61
+ /*istanbul ignore end*/
62
+ function reversePatch(structuredPatch) {
63
+ if (Array.isArray(structuredPatch)) return structuredPatch.map(reversePatch).reverse();
64
+ return _objectSpread(_objectSpread(
65
+ {},
66
+ /*istanbul ignore end*/
67
+ structuredPatch
68
+ ), {}, {
69
+ oldFileName: structuredPatch.newFileName,
70
+ oldHeader: structuredPatch.newHeader,
71
+ newFileName: structuredPatch.oldFileName,
72
+ newHeader: structuredPatch.oldHeader,
73
+ hunks: structuredPatch.hunks.map(function(hunk) {
74
+ return {
75
+ oldLines: hunk.newLines,
76
+ oldStart: hunk.newStart,
77
+ newLines: hunk.oldLines,
78
+ newStart: hunk.oldStart,
79
+ lines: hunk.lines.map(function(l) {
80
+ if (l.startsWith("-")) return "+".concat(
81
+ /*istanbul ignore end*/
82
+ l.slice(1)
83
+ );
84
+ if (l.startsWith("+")) return "-".concat(
85
+ /*istanbul ignore end*/
86
+ l.slice(1)
87
+ );
88
+ return l;
89
+ })
90
+ };
91
+ })
92
+ });
93
+ }
94
+ }) });
95
+
96
+ //#endregion
97
+ export default require_reverse();
98
+
99
+ export { require_reverse };