mockaton 13.9.9 → 13.10.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 (279) hide show
  1. package/package.json +3 -2
  2. package/src/client/app-header.js +62 -42
  3. package/src/client/app.css +22 -4
  4. package/src/client/dir/dittoSplitPaths.js +1 -1
  5. package/src/client/dir/dittoSplitPaths.test.js +9 -7
  6. package/src/server/MockBroker.js +1 -1
  7. package/src/server/cli.test.js +1 -1
  8. package/src/server/mockBrokersCollection.js +4 -2
  9. package/vite-plugin/README.md +0 -29
  10. package/vite-plugin/node_modules/.package-lock.json +0 -356
  11. package/vite-plugin/node_modules/@oxc-project/types/LICENSE +0 -22
  12. package/vite-plugin/node_modules/@oxc-project/types/README.md +0 -3
  13. package/vite-plugin/node_modules/@oxc-project/types/package.json +0 -26
  14. package/vite-plugin/node_modules/@oxc-project/types/types.d.ts +0 -1912
  15. package/vite-plugin/node_modules/@rolldown/binding-darwin-arm64/README.md +0 -3
  16. package/vite-plugin/node_modules/@rolldown/binding-darwin-arm64/package.json +0 -37
  17. package/vite-plugin/node_modules/@rolldown/binding-darwin-arm64/rolldown-binding.darwin-arm64.node +0 -0
  18. package/vite-plugin/node_modules/@rolldown/pluginutils/LICENSE +0 -25
  19. package/vite-plugin/node_modules/@rolldown/pluginutils/README.md +0 -83
  20. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts +0 -90
  21. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js +0 -256
  22. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts +0 -28
  23. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js +0 -75
  24. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts +0 -3
  25. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/index.js +0 -3
  26. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts +0 -71
  27. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js +0 -70
  28. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/index.d.ts +0 -1
  29. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/index.js +0 -1
  30. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/utils.d.ts +0 -2
  31. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/utils.js +0 -17
  32. package/vite-plugin/node_modules/@rolldown/pluginutils/package.json +0 -37
  33. package/vite-plugin/node_modules/detect-libc/LICENSE +0 -201
  34. package/vite-plugin/node_modules/detect-libc/README.md +0 -163
  35. package/vite-plugin/node_modules/detect-libc/index.d.ts +0 -14
  36. package/vite-plugin/node_modules/detect-libc/lib/detect-libc.js +0 -313
  37. package/vite-plugin/node_modules/detect-libc/lib/elf.js +0 -39
  38. package/vite-plugin/node_modules/detect-libc/lib/filesystem.js +0 -51
  39. package/vite-plugin/node_modules/detect-libc/lib/process.js +0 -24
  40. package/vite-plugin/node_modules/detect-libc/package.json +0 -44
  41. package/vite-plugin/node_modules/fdir/LICENSE +0 -7
  42. package/vite-plugin/node_modules/fdir/README.md +0 -91
  43. package/vite-plugin/node_modules/fdir/dist/index.cjs +0 -588
  44. package/vite-plugin/node_modules/fdir/dist/index.d.cts +0 -155
  45. package/vite-plugin/node_modules/fdir/dist/index.d.mts +0 -155
  46. package/vite-plugin/node_modules/fdir/dist/index.mjs +0 -570
  47. package/vite-plugin/node_modules/fdir/package.json +0 -103
  48. package/vite-plugin/node_modules/fsevents/LICENSE +0 -22
  49. package/vite-plugin/node_modules/fsevents/README.md +0 -89
  50. package/vite-plugin/node_modules/fsevents/fsevents.d.ts +0 -46
  51. package/vite-plugin/node_modules/fsevents/fsevents.js +0 -83
  52. package/vite-plugin/node_modules/fsevents/fsevents.node +0 -0
  53. package/vite-plugin/node_modules/fsevents/package.json +0 -62
  54. package/vite-plugin/node_modules/lightningcss/LICENSE +0 -373
  55. package/vite-plugin/node_modules/lightningcss/README.md +0 -105
  56. package/vite-plugin/node_modules/lightningcss/node/ast.d.ts +0 -9892
  57. package/vite-plugin/node_modules/lightningcss/node/ast.js.flow +0 -10539
  58. package/vite-plugin/node_modules/lightningcss/node/browserslistToTargets.js +0 -48
  59. package/vite-plugin/node_modules/lightningcss/node/composeVisitors.js +0 -450
  60. package/vite-plugin/node_modules/lightningcss/node/flags.js +0 -28
  61. package/vite-plugin/node_modules/lightningcss/node/index.d.ts +0 -494
  62. package/vite-plugin/node_modules/lightningcss/node/index.js +0 -59
  63. package/vite-plugin/node_modules/lightningcss/node/index.js.flow +0 -843
  64. package/vite-plugin/node_modules/lightningcss/node/index.mjs +0 -4
  65. package/vite-plugin/node_modules/lightningcss/node/targets.d.ts +0 -40
  66. package/vite-plugin/node_modules/lightningcss/node/targets.js.flow +0 -39
  67. package/vite-plugin/node_modules/lightningcss/package.json +0 -110
  68. package/vite-plugin/node_modules/lightningcss-darwin-arm64/LICENSE +0 -373
  69. package/vite-plugin/node_modules/lightningcss-darwin-arm64/README.md +0 -1
  70. package/vite-plugin/node_modules/lightningcss-darwin-arm64/lightningcss.darwin-arm64.node +0 -0
  71. package/vite-plugin/node_modules/lightningcss-darwin-arm64/package.json +0 -34
  72. package/vite-plugin/node_modules/nanoid/LICENSE +0 -20
  73. package/vite-plugin/node_modules/nanoid/README.md +0 -39
  74. package/vite-plugin/node_modules/nanoid/async/index.browser.cjs +0 -69
  75. package/vite-plugin/node_modules/nanoid/async/index.browser.js +0 -34
  76. package/vite-plugin/node_modules/nanoid/async/index.cjs +0 -71
  77. package/vite-plugin/node_modules/nanoid/async/index.d.ts +0 -56
  78. package/vite-plugin/node_modules/nanoid/async/index.js +0 -35
  79. package/vite-plugin/node_modules/nanoid/async/index.native.js +0 -26
  80. package/vite-plugin/node_modules/nanoid/async/package.json +0 -12
  81. package/vite-plugin/node_modules/nanoid/bin/nanoid.cjs +0 -55
  82. package/vite-plugin/node_modules/nanoid/index.browser.cjs +0 -72
  83. package/vite-plugin/node_modules/nanoid/index.browser.js +0 -34
  84. package/vite-plugin/node_modules/nanoid/index.cjs +0 -85
  85. package/vite-plugin/node_modules/nanoid/index.d.cts +0 -91
  86. package/vite-plugin/node_modules/nanoid/index.d.ts +0 -91
  87. package/vite-plugin/node_modules/nanoid/index.js +0 -45
  88. package/vite-plugin/node_modules/nanoid/nanoid.js +0 -1
  89. package/vite-plugin/node_modules/nanoid/non-secure/index.cjs +0 -34
  90. package/vite-plugin/node_modules/nanoid/non-secure/index.d.ts +0 -33
  91. package/vite-plugin/node_modules/nanoid/non-secure/index.js +0 -21
  92. package/vite-plugin/node_modules/nanoid/non-secure/package.json +0 -6
  93. package/vite-plugin/node_modules/nanoid/package.json +0 -89
  94. package/vite-plugin/node_modules/nanoid/url-alphabet/index.cjs +0 -7
  95. package/vite-plugin/node_modules/nanoid/url-alphabet/index.js +0 -3
  96. package/vite-plugin/node_modules/nanoid/url-alphabet/package.json +0 -6
  97. package/vite-plugin/node_modules/picocolors/LICENSE +0 -15
  98. package/vite-plugin/node_modules/picocolors/README.md +0 -21
  99. package/vite-plugin/node_modules/picocolors/package.json +0 -25
  100. package/vite-plugin/node_modules/picocolors/picocolors.browser.js +0 -4
  101. package/vite-plugin/node_modules/picocolors/picocolors.d.ts +0 -5
  102. package/vite-plugin/node_modules/picocolors/picocolors.js +0 -75
  103. package/vite-plugin/node_modules/picocolors/types.d.ts +0 -51
  104. package/vite-plugin/node_modules/picomatch/LICENSE +0 -21
  105. package/vite-plugin/node_modules/picomatch/README.md +0 -749
  106. package/vite-plugin/node_modules/picomatch/index.js +0 -17
  107. package/vite-plugin/node_modules/picomatch/lib/constants.js +0 -184
  108. package/vite-plugin/node_modules/picomatch/lib/parse.js +0 -1386
  109. package/vite-plugin/node_modules/picomatch/lib/picomatch.js +0 -349
  110. package/vite-plugin/node_modules/picomatch/lib/scan.js +0 -391
  111. package/vite-plugin/node_modules/picomatch/lib/utils.js +0 -72
  112. package/vite-plugin/node_modules/picomatch/package.json +0 -82
  113. package/vite-plugin/node_modules/picomatch/posix.js +0 -3
  114. package/vite-plugin/node_modules/postcss/LICENSE +0 -20
  115. package/vite-plugin/node_modules/postcss/README.md +0 -28
  116. package/vite-plugin/node_modules/postcss/lib/at-rule.d.ts +0 -139
  117. package/vite-plugin/node_modules/postcss/lib/at-rule.js +0 -25
  118. package/vite-plugin/node_modules/postcss/lib/comment.d.ts +0 -67
  119. package/vite-plugin/node_modules/postcss/lib/comment.js +0 -13
  120. package/vite-plugin/node_modules/postcss/lib/container.d.ts +0 -478
  121. package/vite-plugin/node_modules/postcss/lib/container.js +0 -447
  122. package/vite-plugin/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  123. package/vite-plugin/node_modules/postcss/lib/css-syntax-error.js +0 -133
  124. package/vite-plugin/node_modules/postcss/lib/declaration.d.ts +0 -150
  125. package/vite-plugin/node_modules/postcss/lib/declaration.js +0 -24
  126. package/vite-plugin/node_modules/postcss/lib/document.d.ts +0 -68
  127. package/vite-plugin/node_modules/postcss/lib/document.js +0 -33
  128. package/vite-plugin/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  129. package/vite-plugin/node_modules/postcss/lib/fromJSON.js +0 -54
  130. package/vite-plugin/node_modules/postcss/lib/input.d.ts +0 -226
  131. package/vite-plugin/node_modules/postcss/lib/input.js +0 -273
  132. package/vite-plugin/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  133. package/vite-plugin/node_modules/postcss/lib/lazy-result.js +0 -550
  134. package/vite-plugin/node_modules/postcss/lib/list.d.ts +0 -60
  135. package/vite-plugin/node_modules/postcss/lib/list.js +0 -58
  136. package/vite-plugin/node_modules/postcss/lib/map-generator.js +0 -376
  137. package/vite-plugin/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  138. package/vite-plugin/node_modules/postcss/lib/no-work-result.js +0 -137
  139. package/vite-plugin/node_modules/postcss/lib/node.d.ts +0 -555
  140. package/vite-plugin/node_modules/postcss/lib/node.js +0 -449
  141. package/vite-plugin/node_modules/postcss/lib/parse.d.ts +0 -9
  142. package/vite-plugin/node_modules/postcss/lib/parse.js +0 -42
  143. package/vite-plugin/node_modules/postcss/lib/parser.js +0 -611
  144. package/vite-plugin/node_modules/postcss/lib/postcss.d.mts +0 -66
  145. package/vite-plugin/node_modules/postcss/lib/postcss.d.ts +0 -456
  146. package/vite-plugin/node_modules/postcss/lib/postcss.js +0 -101
  147. package/vite-plugin/node_modules/postcss/lib/postcss.mjs +0 -30
  148. package/vite-plugin/node_modules/postcss/lib/previous-map.d.ts +0 -80
  149. package/vite-plugin/node_modules/postcss/lib/previous-map.js +0 -145
  150. package/vite-plugin/node_modules/postcss/lib/processor.d.ts +0 -114
  151. package/vite-plugin/node_modules/postcss/lib/processor.js +0 -67
  152. package/vite-plugin/node_modules/postcss/lib/result.d.ts +0 -204
  153. package/vite-plugin/node_modules/postcss/lib/result.js +0 -42
  154. package/vite-plugin/node_modules/postcss/lib/root.d.ts +0 -86
  155. package/vite-plugin/node_modules/postcss/lib/root.js +0 -61
  156. package/vite-plugin/node_modules/postcss/lib/rule.d.ts +0 -126
  157. package/vite-plugin/node_modules/postcss/lib/rule.js +0 -27
  158. package/vite-plugin/node_modules/postcss/lib/stringifier.d.ts +0 -45
  159. package/vite-plugin/node_modules/postcss/lib/stringifier.js +0 -370
  160. package/vite-plugin/node_modules/postcss/lib/stringify.d.ts +0 -9
  161. package/vite-plugin/node_modules/postcss/lib/stringify.js +0 -11
  162. package/vite-plugin/node_modules/postcss/lib/symbols.js +0 -5
  163. package/vite-plugin/node_modules/postcss/lib/terminal-highlight.js +0 -70
  164. package/vite-plugin/node_modules/postcss/lib/tokenize.js +0 -266
  165. package/vite-plugin/node_modules/postcss/lib/warn-once.js +0 -13
  166. package/vite-plugin/node_modules/postcss/lib/warning.d.ts +0 -146
  167. package/vite-plugin/node_modules/postcss/lib/warning.js +0 -37
  168. package/vite-plugin/node_modules/postcss/package.json +0 -88
  169. package/vite-plugin/node_modules/rolldown/LICENSE +0 -25
  170. package/vite-plugin/node_modules/rolldown/README.md +0 -11
  171. package/vite-plugin/node_modules/rolldown/bin/cli.mjs +0 -2
  172. package/vite-plugin/node_modules/rolldown/dist/cli.d.mts +0 -1
  173. package/vite-plugin/node_modules/rolldown/dist/cli.mjs +0 -1191
  174. package/vite-plugin/node_modules/rolldown/dist/config.d.mts +0 -14
  175. package/vite-plugin/node_modules/rolldown/dist/config.mjs +0 -4
  176. package/vite-plugin/node_modules/rolldown/dist/experimental-index.d.mts +0 -253
  177. package/vite-plugin/node_modules/rolldown/dist/experimental-index.mjs +0 -320
  178. package/vite-plugin/node_modules/rolldown/dist/experimental-runtime-types.d.ts +0 -98
  179. package/vite-plugin/node_modules/rolldown/dist/filter-index.d.mts +0 -196
  180. package/vite-plugin/node_modules/rolldown/dist/filter-index.mjs +0 -386
  181. package/vite-plugin/node_modules/rolldown/dist/get-log-filter.d.mts +0 -3
  182. package/vite-plugin/node_modules/rolldown/dist/get-log-filter.mjs +0 -68
  183. package/vite-plugin/node_modules/rolldown/dist/index.d.mts +0 -4
  184. package/vite-plugin/node_modules/rolldown/dist/index.mjs +0 -50
  185. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +0 -1
  186. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin-worker.mjs +0 -28
  187. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin.d.mts +0 -13
  188. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin.mjs +0 -6
  189. package/vite-plugin/node_modules/rolldown/dist/parse-ast-index.d.mts +0 -32
  190. package/vite-plugin/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
  191. package/vite-plugin/node_modules/rolldown/dist/plugins-index.d.mts +0 -33
  192. package/vite-plugin/node_modules/rolldown/dist/plugins-index.mjs +0 -40
  193. package/vite-plugin/node_modules/rolldown/dist/shared/binding-BeU_1iEk.mjs +0 -582
  194. package/vite-plugin/node_modules/rolldown/dist/shared/binding-zH1vcmbM.d.mts +0 -1899
  195. package/vite-plugin/node_modules/rolldown/dist/shared/bindingify-input-options-DbbBhzky.mjs +0 -2211
  196. package/vite-plugin/node_modules/rolldown/dist/shared/constructors-C2EWPKW3.mjs +0 -68
  197. package/vite-plugin/node_modules/rolldown/dist/shared/constructors-D0W3rNfA.d.mts +0 -37
  198. package/vite-plugin/node_modules/rolldown/dist/shared/define-config-5HJ1b9vG.d.mts +0 -3829
  199. package/vite-plugin/node_modules/rolldown/dist/shared/define-config-DJOr6Iwt.mjs +0 -6
  200. package/vite-plugin/node_modules/rolldown/dist/shared/error-DL-e8-oE.mjs +0 -85
  201. package/vite-plugin/node_modules/rolldown/dist/shared/get-log-filter-semyr3Lj.d.mts +0 -35
  202. package/vite-plugin/node_modules/rolldown/dist/shared/load-config-BoVO31Un.mjs +0 -120
  203. package/vite-plugin/node_modules/rolldown/dist/shared/logging-C6h4g8dA.d.mts +0 -50
  204. package/vite-plugin/node_modules/rolldown/dist/shared/logs-D80CXhvg.mjs +0 -180
  205. package/vite-plugin/node_modules/rolldown/dist/shared/misc-DJYbNKZX.mjs +0 -21
  206. package/vite-plugin/node_modules/rolldown/dist/shared/normalize-string-or-regex-CbQQ69gT.mjs +0 -66
  207. package/vite-plugin/node_modules/rolldown/dist/shared/parse-B_ZnWxLZ.mjs +0 -74
  208. package/vite-plugin/node_modules/rolldown/dist/shared/prompt-U5ajztzG.mjs +0 -847
  209. package/vite-plugin/node_modules/rolldown/dist/shared/resolve-tsconfig-CfYpGzid.mjs +0 -113
  210. package/vite-plugin/node_modules/rolldown/dist/shared/rolldown-D3JZ9rMt.mjs +0 -40
  211. package/vite-plugin/node_modules/rolldown/dist/shared/rolldown-build-DSxL8qiP.mjs +0 -3325
  212. package/vite-plugin/node_modules/rolldown/dist/shared/transform-DgZ3paSD.d.mts +0 -149
  213. package/vite-plugin/node_modules/rolldown/dist/shared/watch-Bd8v9ewv.mjs +0 -374
  214. package/vite-plugin/node_modules/rolldown/dist/utils-index.d.mts +0 -376
  215. package/vite-plugin/node_modules/rolldown/dist/utils-index.mjs +0 -2414
  216. package/vite-plugin/node_modules/rolldown/package.json +0 -153
  217. package/vite-plugin/node_modules/source-map-js/LICENSE +0 -28
  218. package/vite-plugin/node_modules/source-map-js/README.md +0 -765
  219. package/vite-plugin/node_modules/source-map-js/lib/array-set.js +0 -121
  220. package/vite-plugin/node_modules/source-map-js/lib/base64-vlq.js +0 -140
  221. package/vite-plugin/node_modules/source-map-js/lib/base64.js +0 -67
  222. package/vite-plugin/node_modules/source-map-js/lib/binary-search.js +0 -111
  223. package/vite-plugin/node_modules/source-map-js/lib/mapping-list.js +0 -79
  224. package/vite-plugin/node_modules/source-map-js/lib/quick-sort.js +0 -132
  225. package/vite-plugin/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  226. package/vite-plugin/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
  227. package/vite-plugin/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  228. package/vite-plugin/node_modules/source-map-js/lib/source-map-generator.js +0 -444
  229. package/vite-plugin/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  230. package/vite-plugin/node_modules/source-map-js/lib/source-node.js +0 -413
  231. package/vite-plugin/node_modules/source-map-js/lib/util.js +0 -594
  232. package/vite-plugin/node_modules/source-map-js/package.json +0 -71
  233. package/vite-plugin/node_modules/source-map-js/source-map.d.ts +0 -104
  234. package/vite-plugin/node_modules/source-map-js/source-map.js +0 -8
  235. package/vite-plugin/node_modules/tinyglobby/LICENSE +0 -21
  236. package/vite-plugin/node_modules/tinyglobby/README.md +0 -25
  237. package/vite-plugin/node_modules/tinyglobby/dist/index.cjs +0 -334
  238. package/vite-plugin/node_modules/tinyglobby/dist/index.d.cts +0 -148
  239. package/vite-plugin/node_modules/tinyglobby/dist/index.d.mts +0 -148
  240. package/vite-plugin/node_modules/tinyglobby/dist/index.mjs +0 -306
  241. package/vite-plugin/node_modules/tinyglobby/package.json +0 -73
  242. package/vite-plugin/node_modules/vite/LICENSE.md +0 -2230
  243. package/vite-plugin/node_modules/vite/README.md +0 -20
  244. package/vite-plugin/node_modules/vite/bin/openChrome.js +0 -68
  245. package/vite-plugin/node_modules/vite/bin/vite.js +0 -79
  246. package/vite-plugin/node_modules/vite/client.d.ts +0 -282
  247. package/vite-plugin/node_modules/vite/dist/client/client.mjs +0 -1237
  248. package/vite-plugin/node_modules/vite/dist/client/env.mjs +0 -18
  249. package/vite-plugin/node_modules/vite/dist/node/chunks/build.js +0 -5381
  250. package/vite-plugin/node_modules/vite/dist/node/chunks/chunk.js +0 -37
  251. package/vite-plugin/node_modules/vite/dist/node/chunks/dist.js +0 -6784
  252. package/vite-plugin/node_modules/vite/dist/node/chunks/lib.js +0 -371
  253. package/vite-plugin/node_modules/vite/dist/node/chunks/logger.js +0 -322
  254. package/vite-plugin/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +0 -96
  255. package/vite-plugin/node_modules/vite/dist/node/chunks/node.js +0 -34874
  256. package/vite-plugin/node_modules/vite/dist/node/chunks/postcss-import.js +0 -467
  257. package/vite-plugin/node_modules/vite/dist/node/cli.js +0 -837
  258. package/vite-plugin/node_modules/vite/dist/node/index.d.ts +0 -3867
  259. package/vite-plugin/node_modules/vite/dist/node/index.js +0 -3
  260. package/vite-plugin/node_modules/vite/dist/node/internal.d.ts +0 -2
  261. package/vite-plugin/node_modules/vite/dist/node/internal.js +0 -2
  262. package/vite-plugin/node_modules/vite/dist/node/module-runner.d.ts +0 -315
  263. package/vite-plugin/node_modules/vite/dist/node/module-runner.js +0 -1262
  264. package/vite-plugin/node_modules/vite/misc/false.js +0 -1
  265. package/vite-plugin/node_modules/vite/misc/true.js +0 -1
  266. package/vite-plugin/node_modules/vite/package.json +0 -192
  267. package/vite-plugin/node_modules/vite/types/customEvent.d.ts +0 -79
  268. package/vite-plugin/node_modules/vite/types/hmrPayload.d.ts +0 -80
  269. package/vite-plugin/node_modules/vite/types/hot.d.ts +0 -39
  270. package/vite-plugin/node_modules/vite/types/import-meta.d.ts +0 -5
  271. package/vite-plugin/node_modules/vite/types/importGlob.d.ts +0 -89
  272. package/vite-plugin/node_modules/vite/types/importMeta.d.ts +0 -30
  273. package/vite-plugin/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +0 -44
  274. package/vite-plugin/node_modules/vite/types/internal/esbuildOptions.d.ts +0 -28
  275. package/vite-plugin/node_modules/vite/types/internal/lightningcssOptions.d.ts +0 -18
  276. package/vite-plugin/node_modules/vite/types/internal/rollupTypeCompat.d.ts +0 -24
  277. package/vite-plugin/node_modules/vite/types/internal/terserOptions.d.ts +0 -11
  278. package/vite-plugin/node_modules/vite/types/metadata.d.ts +0 -47
  279. package/vite-plugin/package.json +0 -17
@@ -1,1386 +0,0 @@
1
- 'use strict';
2
-
3
- const constants = require('./constants');
4
- const utils = require('./utils');
5
-
6
- /**
7
- * Constants
8
- */
9
-
10
- const {
11
- MAX_LENGTH,
12
- POSIX_REGEX_SOURCE,
13
- REGEX_NON_SPECIAL_CHARS,
14
- REGEX_SPECIAL_CHARS_BACKREF,
15
- REPLACEMENTS
16
- } = constants;
17
-
18
- /**
19
- * Helpers
20
- */
21
-
22
- const expandRange = (args, options) => {
23
- if (typeof options.expandRange === 'function') {
24
- return options.expandRange(...args, options);
25
- }
26
-
27
- args.sort();
28
- const value = `[${args.join('-')}]`;
29
-
30
- try {
31
- /* eslint-disable-next-line no-new */
32
- new RegExp(value);
33
- } catch (ex) {
34
- return args.map(v => utils.escapeRegex(v)).join('..');
35
- }
36
-
37
- return value;
38
- };
39
-
40
- /**
41
- * Create the message for a syntax error
42
- */
43
-
44
- const syntaxError = (type, char) => {
45
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
46
- };
47
-
48
- const splitTopLevel = input => {
49
- const parts = [];
50
- let bracket = 0;
51
- let paren = 0;
52
- let quote = 0;
53
- let value = '';
54
- let escaped = false;
55
-
56
- for (const ch of input) {
57
- if (escaped === true) {
58
- value += ch;
59
- escaped = false;
60
- continue;
61
- }
62
-
63
- if (ch === '\\') {
64
- value += ch;
65
- escaped = true;
66
- continue;
67
- }
68
-
69
- if (ch === '"') {
70
- quote = quote === 1 ? 0 : 1;
71
- value += ch;
72
- continue;
73
- }
74
-
75
- if (quote === 0) {
76
- if (ch === '[') {
77
- bracket++;
78
- } else if (ch === ']' && bracket > 0) {
79
- bracket--;
80
- } else if (bracket === 0) {
81
- if (ch === '(') {
82
- paren++;
83
- } else if (ch === ')' && paren > 0) {
84
- paren--;
85
- } else if (ch === '|' && paren === 0) {
86
- parts.push(value);
87
- value = '';
88
- continue;
89
- }
90
- }
91
- }
92
-
93
- value += ch;
94
- }
95
-
96
- parts.push(value);
97
- return parts;
98
- };
99
-
100
- const isPlainBranch = branch => {
101
- let escaped = false;
102
-
103
- for (const ch of branch) {
104
- if (escaped === true) {
105
- escaped = false;
106
- continue;
107
- }
108
-
109
- if (ch === '\\') {
110
- escaped = true;
111
- continue;
112
- }
113
-
114
- if (/[?*+@!()[\]{}]/.test(ch)) {
115
- return false;
116
- }
117
- }
118
-
119
- return true;
120
- };
121
-
122
- const normalizeSimpleBranch = branch => {
123
- let value = branch.trim();
124
- let changed = true;
125
-
126
- while (changed === true) {
127
- changed = false;
128
-
129
- if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
130
- value = value.slice(2, -1);
131
- changed = true;
132
- }
133
- }
134
-
135
- if (!isPlainBranch(value)) {
136
- return;
137
- }
138
-
139
- return value.replace(/\\(.)/g, '$1');
140
- };
141
-
142
- const hasRepeatedCharPrefixOverlap = branches => {
143
- const values = branches.map(normalizeSimpleBranch).filter(Boolean);
144
-
145
- for (let i = 0; i < values.length; i++) {
146
- for (let j = i + 1; j < values.length; j++) {
147
- const a = values[i];
148
- const b = values[j];
149
- const char = a[0];
150
-
151
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
152
- continue;
153
- }
154
-
155
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
156
- return true;
157
- }
158
- }
159
- }
160
-
161
- return false;
162
- };
163
-
164
- const parseRepeatedExtglob = (pattern, requireEnd = true) => {
165
- if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
166
- return;
167
- }
168
-
169
- let bracket = 0;
170
- let paren = 0;
171
- let quote = 0;
172
- let escaped = false;
173
-
174
- for (let i = 1; i < pattern.length; i++) {
175
- const ch = pattern[i];
176
-
177
- if (escaped === true) {
178
- escaped = false;
179
- continue;
180
- }
181
-
182
- if (ch === '\\') {
183
- escaped = true;
184
- continue;
185
- }
186
-
187
- if (ch === '"') {
188
- quote = quote === 1 ? 0 : 1;
189
- continue;
190
- }
191
-
192
- if (quote === 1) {
193
- continue;
194
- }
195
-
196
- if (ch === '[') {
197
- bracket++;
198
- continue;
199
- }
200
-
201
- if (ch === ']' && bracket > 0) {
202
- bracket--;
203
- continue;
204
- }
205
-
206
- if (bracket > 0) {
207
- continue;
208
- }
209
-
210
- if (ch === '(') {
211
- paren++;
212
- continue;
213
- }
214
-
215
- if (ch === ')') {
216
- paren--;
217
-
218
- if (paren === 0) {
219
- if (requireEnd === true && i !== pattern.length - 1) {
220
- return;
221
- }
222
-
223
- return {
224
- type: pattern[0],
225
- body: pattern.slice(2, i),
226
- end: i
227
- };
228
- }
229
- }
230
- }
231
- };
232
-
233
- const getStarExtglobSequenceOutput = pattern => {
234
- let index = 0;
235
- const chars = [];
236
-
237
- while (index < pattern.length) {
238
- const match = parseRepeatedExtglob(pattern.slice(index), false);
239
-
240
- if (!match || match.type !== '*') {
241
- return;
242
- }
243
-
244
- const branches = splitTopLevel(match.body).map(branch => branch.trim());
245
- if (branches.length !== 1) {
246
- return;
247
- }
248
-
249
- const branch = normalizeSimpleBranch(branches[0]);
250
- if (!branch || branch.length !== 1) {
251
- return;
252
- }
253
-
254
- chars.push(branch);
255
- index += match.end + 1;
256
- }
257
-
258
- if (chars.length < 1) {
259
- return;
260
- }
261
-
262
- const source = chars.length === 1
263
- ? utils.escapeRegex(chars[0])
264
- : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
265
-
266
- return `${source}*`;
267
- };
268
-
269
- const repeatedExtglobRecursion = pattern => {
270
- let depth = 0;
271
- let value = pattern.trim();
272
- let match = parseRepeatedExtglob(value);
273
-
274
- while (match) {
275
- depth++;
276
- value = match.body.trim();
277
- match = parseRepeatedExtglob(value);
278
- }
279
-
280
- return depth;
281
- };
282
-
283
- const analyzeRepeatedExtglob = (body, options) => {
284
- if (options.maxExtglobRecursion === false) {
285
- return { risky: false };
286
- }
287
-
288
- const max =
289
- typeof options.maxExtglobRecursion === 'number'
290
- ? options.maxExtglobRecursion
291
- : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
292
-
293
- const branches = splitTopLevel(body).map(branch => branch.trim());
294
-
295
- if (branches.length > 1) {
296
- if (
297
- branches.some(branch => branch === '') ||
298
- branches.some(branch => /^[*?]+$/.test(branch)) ||
299
- hasRepeatedCharPrefixOverlap(branches)
300
- ) {
301
- return { risky: true };
302
- }
303
- }
304
-
305
- for (const branch of branches) {
306
- const safeOutput = getStarExtglobSequenceOutput(branch);
307
- if (safeOutput) {
308
- return { risky: true, safeOutput };
309
- }
310
-
311
- if (repeatedExtglobRecursion(branch) > max) {
312
- return { risky: true };
313
- }
314
- }
315
-
316
- return { risky: false };
317
- };
318
-
319
- /**
320
- * Parse the given input string.
321
- * @param {String} input
322
- * @param {Object} options
323
- * @return {Object}
324
- */
325
-
326
- const parse = (input, options) => {
327
- if (typeof input !== 'string') {
328
- throw new TypeError('Expected a string');
329
- }
330
-
331
- input = REPLACEMENTS[input] || input;
332
-
333
- const opts = { ...options };
334
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
335
-
336
- let len = input.length;
337
- if (len > max) {
338
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
339
- }
340
-
341
- const bos = { type: 'bos', value: '', output: opts.prepend || '' };
342
- const tokens = [bos];
343
-
344
- const capture = opts.capture ? '' : '?:';
345
-
346
- // create constants based on platform, for windows or posix
347
- const PLATFORM_CHARS = constants.globChars(opts.windows);
348
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
349
-
350
- const {
351
- DOT_LITERAL,
352
- PLUS_LITERAL,
353
- SLASH_LITERAL,
354
- ONE_CHAR,
355
- DOTS_SLASH,
356
- NO_DOT,
357
- NO_DOT_SLASH,
358
- NO_DOTS_SLASH,
359
- QMARK,
360
- QMARK_NO_DOT,
361
- STAR,
362
- START_ANCHOR
363
- } = PLATFORM_CHARS;
364
-
365
- const globstar = opts => {
366
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
367
- };
368
-
369
- const nodot = opts.dot ? '' : NO_DOT;
370
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
371
- let star = opts.bash === true ? globstar(opts) : STAR;
372
-
373
- if (opts.capture) {
374
- star = `(${star})`;
375
- }
376
-
377
- // minimatch options support
378
- if (typeof opts.noext === 'boolean') {
379
- opts.noextglob = opts.noext;
380
- }
381
-
382
- const state = {
383
- input,
384
- index: -1,
385
- start: 0,
386
- dot: opts.dot === true,
387
- consumed: '',
388
- output: '',
389
- prefix: '',
390
- backtrack: false,
391
- negated: false,
392
- brackets: 0,
393
- braces: 0,
394
- parens: 0,
395
- quotes: 0,
396
- globstar: false,
397
- tokens
398
- };
399
-
400
- input = utils.removePrefix(input, state);
401
- len = input.length;
402
-
403
- const extglobs = [];
404
- const braces = [];
405
- const stack = [];
406
- let prev = bos;
407
- let value;
408
-
409
- /**
410
- * Tokenizing helpers
411
- */
412
-
413
- const eos = () => state.index === len - 1;
414
- const peek = state.peek = (n = 1) => input[state.index + n];
415
- const advance = state.advance = () => input[++state.index] || '';
416
- const remaining = () => input.slice(state.index + 1);
417
- const consume = (value = '', num = 0) => {
418
- state.consumed += value;
419
- state.index += num;
420
- };
421
-
422
- const append = token => {
423
- state.output += token.output != null ? token.output : token.value;
424
- consume(token.value);
425
- };
426
-
427
- const negate = () => {
428
- let count = 1;
429
-
430
- while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
431
- advance();
432
- state.start++;
433
- count++;
434
- }
435
-
436
- if (count % 2 === 0) {
437
- return false;
438
- }
439
-
440
- state.negated = true;
441
- state.start++;
442
- return true;
443
- };
444
-
445
- const increment = type => {
446
- state[type]++;
447
- stack.push(type);
448
- };
449
-
450
- const decrement = type => {
451
- state[type]--;
452
- stack.pop();
453
- };
454
-
455
- /**
456
- * Push tokens onto the tokens array. This helper speeds up
457
- * tokenizing by 1) helping us avoid backtracking as much as possible,
458
- * and 2) helping us avoid creating extra tokens when consecutive
459
- * characters are plain text. This improves performance and simplifies
460
- * lookbehinds.
461
- */
462
-
463
- const push = tok => {
464
- if (prev.type === 'globstar') {
465
- const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
466
- const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
467
-
468
- if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
469
- state.output = state.output.slice(0, -prev.output.length);
470
- prev.type = 'star';
471
- prev.value = '*';
472
- prev.output = star;
473
- state.output += prev.output;
474
- }
475
- }
476
-
477
- if (extglobs.length && tok.type !== 'paren') {
478
- extglobs[extglobs.length - 1].inner += tok.value;
479
- }
480
-
481
- if (tok.value || tok.output) append(tok);
482
- if (prev && prev.type === 'text' && tok.type === 'text') {
483
- prev.output = (prev.output || prev.value) + tok.value;
484
- prev.value += tok.value;
485
- return;
486
- }
487
-
488
- tok.prev = prev;
489
- tokens.push(tok);
490
- prev = tok;
491
- };
492
-
493
- const extglobOpen = (type, value) => {
494
- const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
495
-
496
- token.prev = prev;
497
- token.parens = state.parens;
498
- token.output = state.output;
499
- token.startIndex = state.index;
500
- token.tokensIndex = tokens.length;
501
- const output = (opts.capture ? '(' : '') + token.open;
502
-
503
- increment('parens');
504
- push({ type, value, output: state.output ? '' : ONE_CHAR });
505
- push({ type: 'paren', extglob: true, value: advance(), output });
506
- extglobs.push(token);
507
- };
508
-
509
- const extglobClose = token => {
510
- const literal = input.slice(token.startIndex, state.index + 1);
511
- const body = input.slice(token.startIndex + 2, state.index);
512
- const analysis = analyzeRepeatedExtglob(body, opts);
513
-
514
- if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
515
- const safeOutput = analysis.safeOutput
516
- ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
517
- : undefined;
518
- const open = tokens[token.tokensIndex];
519
-
520
- open.type = 'text';
521
- open.value = literal;
522
- open.output = safeOutput || utils.escapeRegex(literal);
523
-
524
- for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
525
- tokens[i].value = '';
526
- tokens[i].output = '';
527
- delete tokens[i].suffix;
528
- }
529
-
530
- state.output = token.output + open.output;
531
- state.backtrack = true;
532
-
533
- push({ type: 'paren', extglob: true, value, output: '' });
534
- decrement('parens');
535
- return;
536
- }
537
-
538
- let output = token.close + (opts.capture ? ')' : '');
539
- let rest;
540
-
541
- if (token.type === 'negate') {
542
- let extglobStar = star;
543
-
544
- if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
545
- extglobStar = globstar(opts);
546
- }
547
-
548
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
549
- output = token.close = `)$))${extglobStar}`;
550
- }
551
-
552
- if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
553
- // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
554
- // In this case, we need to parse the string and use it in the output of the original pattern.
555
- // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
556
- //
557
- // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
558
- const expression = parse(rest, { ...options, fastpaths: false }).output;
559
-
560
- output = token.close = `)${expression})${extglobStar})`;
561
- }
562
-
563
- if (token.prev.type === 'bos') {
564
- state.negatedExtglob = true;
565
- }
566
- }
567
-
568
- push({ type: 'paren', extglob: true, value, output });
569
- decrement('parens');
570
- };
571
-
572
- /**
573
- * Fast paths
574
- */
575
-
576
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
577
- let backslashes = false;
578
-
579
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
580
- if (first === '\\') {
581
- backslashes = true;
582
- return m;
583
- }
584
-
585
- if (first === '?') {
586
- if (esc) {
587
- return esc + first + (rest ? QMARK.repeat(rest.length) : '');
588
- }
589
- if (index === 0) {
590
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
591
- }
592
- return QMARK.repeat(chars.length);
593
- }
594
-
595
- if (first === '.') {
596
- return DOT_LITERAL.repeat(chars.length);
597
- }
598
-
599
- if (first === '*') {
600
- if (esc) {
601
- return esc + first + (rest ? star : '');
602
- }
603
- return star;
604
- }
605
- return esc ? m : `\\${m}`;
606
- });
607
-
608
- if (backslashes === true) {
609
- if (opts.unescape === true) {
610
- output = output.replace(/\\/g, '');
611
- } else {
612
- output = output.replace(/\\+/g, m => {
613
- return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
614
- });
615
- }
616
- }
617
-
618
- if (output === input && opts.contains === true) {
619
- state.output = input;
620
- return state;
621
- }
622
-
623
- state.output = utils.wrapOutput(output, state, options);
624
- return state;
625
- }
626
-
627
- /**
628
- * Tokenize input until we reach end-of-string
629
- */
630
-
631
- while (!eos()) {
632
- value = advance();
633
-
634
- if (value === '\u0000') {
635
- continue;
636
- }
637
-
638
- /**
639
- * Escaped characters
640
- */
641
-
642
- if (value === '\\') {
643
- const next = peek();
644
-
645
- if (next === '/' && opts.bash !== true) {
646
- continue;
647
- }
648
-
649
- if (next === '.' || next === ';') {
650
- continue;
651
- }
652
-
653
- if (!next) {
654
- value += '\\';
655
- push({ type: 'text', value });
656
- continue;
657
- }
658
-
659
- // collapse slashes to reduce potential for exploits
660
- const match = /^\\+/.exec(remaining());
661
- let slashes = 0;
662
-
663
- if (match && match[0].length > 2) {
664
- slashes = match[0].length;
665
- state.index += slashes;
666
- if (slashes % 2 !== 0) {
667
- value += '\\';
668
- }
669
- }
670
-
671
- if (opts.unescape === true) {
672
- value = advance();
673
- } else {
674
- value += advance();
675
- }
676
-
677
- if (state.brackets === 0) {
678
- push({ type: 'text', value });
679
- continue;
680
- }
681
- }
682
-
683
- /**
684
- * If we're inside a regex character class, continue
685
- * until we reach the closing bracket.
686
- */
687
-
688
- if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
689
- if (opts.posix !== false && value === ':') {
690
- const inner = prev.value.slice(1);
691
- if (inner.includes('[')) {
692
- prev.posix = true;
693
-
694
- if (inner.includes(':')) {
695
- const idx = prev.value.lastIndexOf('[');
696
- const pre = prev.value.slice(0, idx);
697
- const rest = prev.value.slice(idx + 2);
698
- const posix = POSIX_REGEX_SOURCE[rest];
699
- if (posix) {
700
- prev.value = pre + posix;
701
- state.backtrack = true;
702
- advance();
703
-
704
- if (!bos.output && tokens.indexOf(prev) === 1) {
705
- bos.output = ONE_CHAR;
706
- }
707
- continue;
708
- }
709
- }
710
- }
711
- }
712
-
713
- if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
714
- value = `\\${value}`;
715
- }
716
-
717
- if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
718
- value = `\\${value}`;
719
- }
720
-
721
- if (opts.posix === true && value === '!' && prev.value === '[') {
722
- value = '^';
723
- }
724
-
725
- prev.value += value;
726
- append({ value });
727
- continue;
728
- }
729
-
730
- /**
731
- * If we're inside a quoted string, continue
732
- * until we reach the closing double quote.
733
- */
734
-
735
- if (state.quotes === 1 && value !== '"') {
736
- value = utils.escapeRegex(value);
737
- prev.value += value;
738
- append({ value });
739
- continue;
740
- }
741
-
742
- /**
743
- * Double quotes
744
- */
745
-
746
- if (value === '"') {
747
- state.quotes = state.quotes === 1 ? 0 : 1;
748
- if (opts.keepQuotes === true) {
749
- push({ type: 'text', value });
750
- }
751
- continue;
752
- }
753
-
754
- /**
755
- * Parentheses
756
- */
757
-
758
- if (value === '(') {
759
- increment('parens');
760
- push({ type: 'paren', value });
761
- continue;
762
- }
763
-
764
- if (value === ')') {
765
- if (state.parens === 0 && opts.strictBrackets === true) {
766
- throw new SyntaxError(syntaxError('opening', '('));
767
- }
768
-
769
- const extglob = extglobs[extglobs.length - 1];
770
- if (extglob && state.parens === extglob.parens + 1) {
771
- extglobClose(extglobs.pop());
772
- continue;
773
- }
774
-
775
- push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
776
- decrement('parens');
777
- continue;
778
- }
779
-
780
- /**
781
- * Square brackets
782
- */
783
-
784
- if (value === '[') {
785
- if (opts.nobracket === true || !remaining().includes(']')) {
786
- if (opts.nobracket !== true && opts.strictBrackets === true) {
787
- throw new SyntaxError(syntaxError('closing', ']'));
788
- }
789
-
790
- value = `\\${value}`;
791
- } else {
792
- increment('brackets');
793
- }
794
-
795
- push({ type: 'bracket', value });
796
- continue;
797
- }
798
-
799
- if (value === ']') {
800
- if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
801
- push({ type: 'text', value, output: `\\${value}` });
802
- continue;
803
- }
804
-
805
- if (state.brackets === 0) {
806
- if (opts.strictBrackets === true) {
807
- throw new SyntaxError(syntaxError('opening', '['));
808
- }
809
-
810
- push({ type: 'text', value, output: `\\${value}` });
811
- continue;
812
- }
813
-
814
- decrement('brackets');
815
-
816
- const prevValue = prev.value.slice(1);
817
- if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
818
- value = `/${value}`;
819
- }
820
-
821
- prev.value += value;
822
- append({ value });
823
-
824
- // when literal brackets are explicitly disabled
825
- // assume we should match with a regex character class
826
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
827
- continue;
828
- }
829
-
830
- const escaped = utils.escapeRegex(prev.value);
831
- state.output = state.output.slice(0, -prev.value.length);
832
-
833
- // when literal brackets are explicitly enabled
834
- // assume we should escape the brackets to match literal characters
835
- if (opts.literalBrackets === true) {
836
- state.output += escaped;
837
- prev.value = escaped;
838
- continue;
839
- }
840
-
841
- // when the user specifies nothing, try to match both
842
- prev.value = `(${capture}${escaped}|${prev.value})`;
843
- state.output += prev.value;
844
- continue;
845
- }
846
-
847
- /**
848
- * Braces
849
- */
850
-
851
- if (value === '{' && opts.nobrace !== true) {
852
- increment('braces');
853
-
854
- const open = {
855
- type: 'brace',
856
- value,
857
- output: '(',
858
- outputIndex: state.output.length,
859
- tokensIndex: state.tokens.length
860
- };
861
-
862
- braces.push(open);
863
- push(open);
864
- continue;
865
- }
866
-
867
- if (value === '}') {
868
- const brace = braces[braces.length - 1];
869
-
870
- if (opts.nobrace === true || !brace) {
871
- push({ type: 'text', value, output: value });
872
- continue;
873
- }
874
-
875
- let output = ')';
876
-
877
- if (brace.dots === true) {
878
- const arr = tokens.slice();
879
- const range = [];
880
-
881
- for (let i = arr.length - 1; i >= 0; i--) {
882
- tokens.pop();
883
- if (arr[i].type === 'brace') {
884
- break;
885
- }
886
- if (arr[i].type !== 'dots') {
887
- range.unshift(arr[i].value);
888
- }
889
- }
890
-
891
- output = expandRange(range, opts);
892
- state.backtrack = true;
893
- }
894
-
895
- if (brace.comma !== true && brace.dots !== true) {
896
- const out = state.output.slice(0, brace.outputIndex);
897
- const toks = state.tokens.slice(brace.tokensIndex);
898
- brace.value = brace.output = '\\{';
899
- value = output = '\\}';
900
- state.output = out;
901
- for (const t of toks) {
902
- state.output += (t.output || t.value);
903
- }
904
- }
905
-
906
- push({ type: 'brace', value, output });
907
- decrement('braces');
908
- braces.pop();
909
- continue;
910
- }
911
-
912
- /**
913
- * Pipes
914
- */
915
-
916
- if (value === '|') {
917
- if (extglobs.length > 0) {
918
- extglobs[extglobs.length - 1].conditions++;
919
- }
920
- push({ type: 'text', value });
921
- continue;
922
- }
923
-
924
- /**
925
- * Commas
926
- */
927
-
928
- if (value === ',') {
929
- let output = value;
930
-
931
- const brace = braces[braces.length - 1];
932
- if (brace && stack[stack.length - 1] === 'braces') {
933
- brace.comma = true;
934
- output = '|';
935
- }
936
-
937
- push({ type: 'comma', value, output });
938
- continue;
939
- }
940
-
941
- /**
942
- * Slashes
943
- */
944
-
945
- if (value === '/') {
946
- // if the beginning of the glob is "./", advance the start
947
- // to the current index, and don't add the "./" characters
948
- // to the state. This greatly simplifies lookbehinds when
949
- // checking for BOS characters like "!" and "." (not "./")
950
- if (prev.type === 'dot' && state.index === state.start + 1) {
951
- state.start = state.index + 1;
952
- state.consumed = '';
953
- state.output = '';
954
- tokens.pop();
955
- prev = bos; // reset "prev" to the first token
956
- continue;
957
- }
958
-
959
- push({ type: 'slash', value, output: SLASH_LITERAL });
960
- continue;
961
- }
962
-
963
- /**
964
- * Dots
965
- */
966
-
967
- if (value === '.') {
968
- if (state.braces > 0 && prev.type === 'dot') {
969
- if (prev.value === '.') prev.output = DOT_LITERAL;
970
- const brace = braces[braces.length - 1];
971
- prev.type = 'dots';
972
- prev.output += value;
973
- prev.value += value;
974
- brace.dots = true;
975
- continue;
976
- }
977
-
978
- if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
979
- push({ type: 'text', value, output: DOT_LITERAL });
980
- continue;
981
- }
982
-
983
- push({ type: 'dot', value, output: DOT_LITERAL });
984
- continue;
985
- }
986
-
987
- /**
988
- * Question marks
989
- */
990
-
991
- if (value === '?') {
992
- const isGroup = prev && prev.value === '(';
993
- if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
994
- extglobOpen('qmark', value);
995
- continue;
996
- }
997
-
998
- if (prev && prev.type === 'paren') {
999
- const next = peek();
1000
- let output = value;
1001
-
1002
- if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
1003
- output = `\\${value}`;
1004
- }
1005
-
1006
- push({ type: 'text', value, output });
1007
- continue;
1008
- }
1009
-
1010
- if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
1011
- push({ type: 'qmark', value, output: QMARK_NO_DOT });
1012
- continue;
1013
- }
1014
-
1015
- push({ type: 'qmark', value, output: QMARK });
1016
- continue;
1017
- }
1018
-
1019
- /**
1020
- * Exclamation
1021
- */
1022
-
1023
- if (value === '!') {
1024
- if (opts.noextglob !== true && peek() === '(') {
1025
- if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
1026
- extglobOpen('negate', value);
1027
- continue;
1028
- }
1029
- }
1030
-
1031
- if (opts.nonegate !== true && state.index === 0) {
1032
- negate();
1033
- continue;
1034
- }
1035
- }
1036
-
1037
- /**
1038
- * Plus
1039
- */
1040
-
1041
- if (value === '+') {
1042
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1043
- extglobOpen('plus', value);
1044
- continue;
1045
- }
1046
-
1047
- if ((prev && prev.value === '(') || opts.regex === false) {
1048
- push({ type: 'plus', value, output: PLUS_LITERAL });
1049
- continue;
1050
- }
1051
-
1052
- if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
1053
- push({ type: 'plus', value });
1054
- continue;
1055
- }
1056
-
1057
- push({ type: 'plus', value: PLUS_LITERAL });
1058
- continue;
1059
- }
1060
-
1061
- /**
1062
- * Plain text
1063
- */
1064
-
1065
- if (value === '@') {
1066
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1067
- push({ type: 'at', extglob: true, value, output: '' });
1068
- continue;
1069
- }
1070
-
1071
- push({ type: 'text', value });
1072
- continue;
1073
- }
1074
-
1075
- /**
1076
- * Plain text
1077
- */
1078
-
1079
- if (value !== '*') {
1080
- if (value === '$' || value === '^') {
1081
- value = `\\${value}`;
1082
- }
1083
-
1084
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1085
- if (match) {
1086
- value += match[0];
1087
- state.index += match[0].length;
1088
- }
1089
-
1090
- push({ type: 'text', value });
1091
- continue;
1092
- }
1093
-
1094
- /**
1095
- * Stars
1096
- */
1097
-
1098
- if (prev && (prev.type === 'globstar' || prev.star === true)) {
1099
- prev.type = 'star';
1100
- prev.star = true;
1101
- prev.value += value;
1102
- prev.output = star;
1103
- state.backtrack = true;
1104
- state.globstar = true;
1105
- consume(value);
1106
- continue;
1107
- }
1108
-
1109
- let rest = remaining();
1110
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1111
- extglobOpen('star', value);
1112
- continue;
1113
- }
1114
-
1115
- if (prev.type === 'star') {
1116
- if (opts.noglobstar === true) {
1117
- consume(value);
1118
- continue;
1119
- }
1120
-
1121
- const prior = prev.prev;
1122
- const before = prior.prev;
1123
- const isStart = prior.type === 'slash' || prior.type === 'bos';
1124
- const afterStar = before && (before.type === 'star' || before.type === 'globstar');
1125
-
1126
- if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
1127
- push({ type: 'star', value, output: '' });
1128
- continue;
1129
- }
1130
-
1131
- const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
1132
- const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
1133
- if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
1134
- push({ type: 'star', value, output: '' });
1135
- continue;
1136
- }
1137
-
1138
- // strip consecutive `/**/`
1139
- while (rest.slice(0, 3) === '/**') {
1140
- const after = input[state.index + 4];
1141
- if (after && after !== '/') {
1142
- break;
1143
- }
1144
- rest = rest.slice(3);
1145
- consume('/**', 3);
1146
- }
1147
-
1148
- if (prior.type === 'bos' && eos()) {
1149
- prev.type = 'globstar';
1150
- prev.value += value;
1151
- prev.output = globstar(opts);
1152
- state.output = prev.output;
1153
- state.globstar = true;
1154
- consume(value);
1155
- continue;
1156
- }
1157
-
1158
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
1159
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
1160
- prior.output = `(?:${prior.output}`;
1161
-
1162
- prev.type = 'globstar';
1163
- prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
1164
- prev.value += value;
1165
- state.globstar = true;
1166
- state.output += prior.output + prev.output;
1167
- consume(value);
1168
- continue;
1169
- }
1170
-
1171
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
1172
- const end = rest[1] !== void 0 ? '|$' : '';
1173
-
1174
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
1175
- prior.output = `(?:${prior.output}`;
1176
-
1177
- prev.type = 'globstar';
1178
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1179
- prev.value += value;
1180
-
1181
- state.output += prior.output + prev.output;
1182
- state.globstar = true;
1183
-
1184
- consume(value + advance());
1185
-
1186
- push({ type: 'slash', value: '/', output: '' });
1187
- continue;
1188
- }
1189
-
1190
- if (prior.type === 'bos' && rest[0] === '/') {
1191
- prev.type = 'globstar';
1192
- prev.value += value;
1193
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1194
- state.output = prev.output;
1195
- state.globstar = true;
1196
- consume(value + advance());
1197
- push({ type: 'slash', value: '/', output: '' });
1198
- continue;
1199
- }
1200
-
1201
- // remove single star from output
1202
- state.output = state.output.slice(0, -prev.output.length);
1203
-
1204
- // reset previous token to globstar
1205
- prev.type = 'globstar';
1206
- prev.output = globstar(opts);
1207
- prev.value += value;
1208
-
1209
- // reset output with globstar
1210
- state.output += prev.output;
1211
- state.globstar = true;
1212
- consume(value);
1213
- continue;
1214
- }
1215
-
1216
- const token = { type: 'star', value, output: star };
1217
-
1218
- if (opts.bash === true) {
1219
- token.output = '.*?';
1220
- if (prev.type === 'bos' || prev.type === 'slash') {
1221
- token.output = nodot + token.output;
1222
- }
1223
- push(token);
1224
- continue;
1225
- }
1226
-
1227
- if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
1228
- token.output = value;
1229
- push(token);
1230
- continue;
1231
- }
1232
-
1233
- if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
1234
- if (prev.type === 'dot') {
1235
- state.output += NO_DOT_SLASH;
1236
- prev.output += NO_DOT_SLASH;
1237
-
1238
- } else if (opts.dot === true) {
1239
- state.output += NO_DOTS_SLASH;
1240
- prev.output += NO_DOTS_SLASH;
1241
-
1242
- } else {
1243
- state.output += nodot;
1244
- prev.output += nodot;
1245
- }
1246
-
1247
- if (peek() !== '*') {
1248
- state.output += ONE_CHAR;
1249
- prev.output += ONE_CHAR;
1250
- }
1251
- }
1252
-
1253
- push(token);
1254
- }
1255
-
1256
- while (state.brackets > 0) {
1257
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
1258
- state.output = utils.escapeLast(state.output, '[');
1259
- decrement('brackets');
1260
- }
1261
-
1262
- while (state.parens > 0) {
1263
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
1264
- state.output = utils.escapeLast(state.output, '(');
1265
- decrement('parens');
1266
- }
1267
-
1268
- while (state.braces > 0) {
1269
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
1270
- state.output = utils.escapeLast(state.output, '{');
1271
- decrement('braces');
1272
- }
1273
-
1274
- if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
1275
- push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
1276
- }
1277
-
1278
- // rebuild the output if we had to backtrack at any point
1279
- if (state.backtrack === true) {
1280
- state.output = '';
1281
-
1282
- for (const token of state.tokens) {
1283
- state.output += token.output != null ? token.output : token.value;
1284
-
1285
- if (token.suffix) {
1286
- state.output += token.suffix;
1287
- }
1288
- }
1289
- }
1290
-
1291
- return state;
1292
- };
1293
-
1294
- /**
1295
- * Fast paths for creating regular expressions for common glob patterns.
1296
- * This can significantly speed up processing and has very little downside
1297
- * impact when none of the fast paths match.
1298
- */
1299
-
1300
- parse.fastpaths = (input, options) => {
1301
- const opts = { ...options };
1302
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1303
- const len = input.length;
1304
- if (len > max) {
1305
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1306
- }
1307
-
1308
- input = REPLACEMENTS[input] || input;
1309
-
1310
- // create constants based on platform, for windows or posix
1311
- const {
1312
- DOT_LITERAL,
1313
- SLASH_LITERAL,
1314
- ONE_CHAR,
1315
- DOTS_SLASH,
1316
- NO_DOT,
1317
- NO_DOTS,
1318
- NO_DOTS_SLASH,
1319
- STAR,
1320
- START_ANCHOR
1321
- } = constants.globChars(opts.windows);
1322
-
1323
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
1324
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1325
- const capture = opts.capture ? '' : '?:';
1326
- const state = { negated: false, prefix: '' };
1327
- let star = opts.bash === true ? '.*?' : STAR;
1328
-
1329
- if (opts.capture) {
1330
- star = `(${star})`;
1331
- }
1332
-
1333
- const globstar = opts => {
1334
- if (opts.noglobstar === true) return star;
1335
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1336
- };
1337
-
1338
- const create = str => {
1339
- switch (str) {
1340
- case '*':
1341
- return `${nodot}${ONE_CHAR}${star}`;
1342
-
1343
- case '.*':
1344
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1345
-
1346
- case '*.*':
1347
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1348
-
1349
- case '*/*':
1350
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1351
-
1352
- case '**':
1353
- return nodot + globstar(opts);
1354
-
1355
- case '**/*':
1356
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1357
-
1358
- case '**/*.*':
1359
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1360
-
1361
- case '**/.*':
1362
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1363
-
1364
- default: {
1365
- const match = /^(.*?)\.(\w+)$/.exec(str);
1366
- if (!match) return;
1367
-
1368
- const source = create(match[1]);
1369
- if (!source) return;
1370
-
1371
- return source + DOT_LITERAL + match[2];
1372
- }
1373
- }
1374
- };
1375
-
1376
- const output = utils.removePrefix(input, state);
1377
- let source = create(output);
1378
-
1379
- if (source && opts.strictSlashes !== true) {
1380
- source += `${SLASH_LITERAL}?`;
1381
- }
1382
-
1383
- return source;
1384
- };
1385
-
1386
- module.exports = parse;