@contrast/agent-bundle 5.42.0 → 5.45.1

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 (468) hide show
  1. package/README.md +1 -10
  2. package/node_modules/@contrast/agent/README.md +1 -10
  3. package/node_modules/@contrast/agent/package.json +12 -12
  4. package/node_modules/@contrast/agent-swc-plugin/package.json +3 -3
  5. package/node_modules/@contrast/agentify/lib/rewrite-hooks.js +3 -3
  6. package/node_modules/@contrast/agentify/lib/utils.js +13 -7
  7. package/node_modules/@contrast/agentify/package.json +17 -17
  8. package/node_modules/@contrast/architecture-components/package.json +6 -6
  9. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/ejs/template.js +1 -1
  10. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/pug/index.js +1 -1
  11. package/node_modules/@contrast/assess/lib/dataflow/sinks/install/http/server-response.js +1 -12
  12. package/node_modules/@contrast/assess/lib/dataflow/sinks/install/restify.js +1 -1
  13. package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +1 -1
  14. package/node_modules/@contrast/assess/lib/dataflow/tracker.js +1 -1
  15. package/node_modules/@contrast/assess/lib/get-source-context.js +1 -1
  16. package/node_modules/@contrast/assess/lib/response-scanning/install/http.js +0 -12
  17. package/node_modules/@contrast/assess/package.json +14 -14
  18. package/node_modules/@contrast/code-events/binding.gyp +1 -1
  19. package/node_modules/@contrast/code-events/package.json +11 -9
  20. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi108.node +0 -0
  21. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi115.node +0 -0
  22. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi127.node +0 -0
  23. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/{@contrast+code-events.abi93.node → @contrast+code-events.abi137.node} +0 -0
  24. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi108.armv8.node +0 -0
  25. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi115.armv8.node +0 -0
  26. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi127.armv8.node +0 -0
  27. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi137.armv8.node +0 -0
  28. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.glibc.node +0 -0
  29. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.musl.node +0 -0
  30. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.glibc.node +0 -0
  31. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.musl.node +0 -0
  32. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.glibc.node +0 -0
  33. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.musl.node +0 -0
  34. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.glibc.node +0 -0
  35. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.musl.node +0 -0
  36. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi108.node +0 -0
  37. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi115.node +0 -0
  38. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi127.node +0 -0
  39. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi137.node +0 -0
  40. package/node_modules/@contrast/common/lib/constants.d.ts +1 -1
  41. package/node_modules/@contrast/common/lib/constants.js +1 -1
  42. package/node_modules/@contrast/common/lib/index.js +15 -15
  43. package/node_modules/@contrast/common/lib/primordials.d.ts +22 -20
  44. package/node_modules/@contrast/common/lib/types.d.ts +18 -6
  45. package/node_modules/@contrast/common/package.json +2 -2
  46. package/node_modules/@contrast/config/lib/options.js +29 -4
  47. package/node_modules/@contrast/config/package.json +4 -4
  48. package/node_modules/@contrast/core/lib/app-info.js +53 -74
  49. package/node_modules/@contrast/core/lib/index.d.ts +17 -1
  50. package/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +33 -5
  51. package/node_modules/@contrast/core/package.json +10 -9
  52. package/node_modules/@contrast/deadzones/package.json +6 -6
  53. package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +17 -13
  54. package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +16 -4
  55. package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +2 -2
  56. package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +2 -3
  57. package/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +6 -6
  58. package/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -1
  59. package/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -7
  60. package/node_modules/@contrast/dep-hooks/lib/helpers.js +2 -18
  61. package/node_modules/@contrast/dep-hooks/lib/index.d.ts +17 -12
  62. package/node_modules/@contrast/dep-hooks/lib/index.js +5 -3
  63. package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -1
  64. package/node_modules/@contrast/dep-hooks/lib/package-finder.js +6 -6
  65. package/node_modules/@contrast/dep-hooks/package.json +4 -3
  66. package/node_modules/@contrast/distringuish/package.json +7 -6
  67. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi108.node +0 -0
  68. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi115.node +0 -0
  69. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi127.node +0 -0
  70. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/{@contrast+distringuish.abi93.node → @contrast+distringuish.abi137.node} +0 -0
  71. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi108.armv8.node +0 -0
  72. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi115.armv8.node +0 -0
  73. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi127.armv8.node +0 -0
  74. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi137.armv8.node +0 -0
  75. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.glibc.node +0 -0
  76. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.musl.node +0 -0
  77. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.glibc.node +0 -0
  78. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.musl.node +0 -0
  79. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.glibc.node +0 -0
  80. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.musl.node +0 -0
  81. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.glibc.node +0 -0
  82. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.musl.node +0 -0
  83. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi108.node +0 -0
  84. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi115.node +0 -0
  85. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi127.node +0 -0
  86. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi137.node +0 -0
  87. package/node_modules/@contrast/esm-hooks/lib/debug-methods.mjs +4 -4
  88. package/node_modules/@contrast/esm-hooks/lib/get-file-type.mjs +2 -9
  89. package/node_modules/@contrast/esm-hooks/lib/hooks.mjs +0 -2
  90. package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs/promises.mjs +2 -0
  91. package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs.mjs +3 -0
  92. package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/util.mjs +1 -0
  93. package/node_modules/@contrast/esm-hooks/package.json +7 -7
  94. package/node_modules/@contrast/fn-inspect/package.json +9 -5
  95. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi108.node +0 -0
  96. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi115.node +0 -0
  97. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi127.node +0 -0
  98. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/{@contrast+fn-inspect.abi93.node → @contrast+fn-inspect.abi137.node} +0 -0
  99. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi108.armv8.node +0 -0
  100. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi115.armv8.node +0 -0
  101. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi127.armv8.node +0 -0
  102. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi137.armv8.node +0 -0
  103. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.glibc.node +0 -0
  104. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.musl.node +0 -0
  105. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.glibc.node +0 -0
  106. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.musl.node +0 -0
  107. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.glibc.node +0 -0
  108. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.musl.node +0 -0
  109. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi137.glibc.node +0 -0
  110. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/{@contrast+fn-inspect.abi93.musl.node → @contrast+fn-inspect.abi137.musl.node} +0 -0
  111. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi108.node +0 -0
  112. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi115.node +0 -0
  113. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi127.node +0 -0
  114. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi137.node +0 -0
  115. package/node_modules/@contrast/instrumentation/lib/http2.js +0 -11
  116. package/node_modules/@contrast/instrumentation/package.json +6 -6
  117. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +312 -224
  118. package/node_modules/@contrast/library-analysis/package.json +6 -6
  119. package/node_modules/@contrast/logger/lib/index.js +18 -8
  120. package/node_modules/@contrast/logger/lib/serializers.js +5 -5
  121. package/node_modules/@contrast/logger/lib/utils.d.ts +0 -6
  122. package/node_modules/@contrast/logger/package.json +4 -4
  123. package/node_modules/@contrast/metrics/lib/index.d.ts +6 -6
  124. package/node_modules/@contrast/metrics/lib/index.js +0 -1
  125. package/node_modules/@contrast/metrics/package.json +7 -7
  126. package/node_modules/@contrast/patcher/package.json +3 -3
  127. package/node_modules/@contrast/perf/package.json +7 -4
  128. package/node_modules/@contrast/protect/lib/hardening/handlers.js +37 -21
  129. package/node_modules/@contrast/protect/lib/index.d.ts +3 -2
  130. package/node_modules/@contrast/protect/lib/index.js +9 -2
  131. package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +275 -233
  132. package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +3 -4
  133. package/node_modules/@contrast/protect/lib/input-tracing/{handlers/index.js → handlers.js} +15 -15
  134. package/node_modules/@contrast/protect/lib/input-tracing/index.js +0 -1
  135. package/node_modules/@contrast/protect/lib/make-source-context.js +5 -7
  136. package/node_modules/@contrast/protect/lib/policy.js +130 -95
  137. package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +19 -18
  138. package/node_modules/@contrast/protect/package.json +12 -12
  139. package/node_modules/@contrast/reporter/lib/index.js +1 -1
  140. package/node_modules/@contrast/reporter/lib/reporters/base.d.ts +0 -1
  141. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.d.ts +4 -2
  142. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +14 -14
  143. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +43 -6
  144. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +262 -429
  145. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/server-inventory.d.ts +3 -3
  146. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +17 -7
  147. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +12 -13
  148. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/utils.js +6 -7
  149. package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
  150. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -3
  151. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +72 -86
  152. package/node_modules/@contrast/reporter/lib/reporters/security-logger/messages.js +6 -7
  153. package/node_modules/@contrast/reporter/lib/validators.js +0 -1
  154. package/node_modules/@contrast/reporter/node_modules/sonic-boom/.husky/pre-commit +2 -2
  155. package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc +5 -0
  156. package/node_modules/@contrast/reporter/node_modules/sonic-boom/README.md +2 -4
  157. package/node_modules/@contrast/reporter/node_modules/sonic-boom/bench.js +5 -36
  158. package/node_modules/@contrast/reporter/node_modules/sonic-boom/index.js +56 -300
  159. package/node_modules/@contrast/reporter/node_modules/sonic-boom/package.json +12 -7
  160. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test.js +1684 -0
  161. package/node_modules/@contrast/reporter/node_modules/sonic-boom/types/index.d.ts +1 -2
  162. package/node_modules/@contrast/reporter/package.json +10 -10
  163. package/node_modules/@contrast/rewriter/lib/index.js +5 -43
  164. package/node_modules/@contrast/rewriter/package.json +8 -8
  165. package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +0 -5
  166. package/node_modules/@contrast/route-coverage/lib/install/restify.js +1 -1
  167. package/node_modules/@contrast/route-coverage/package.json +10 -10
  168. package/node_modules/@contrast/scopes/package.json +6 -6
  169. package/node_modules/@contrast/sec-obs/lib/traces/http.js +1 -1
  170. package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +1 -1
  171. package/node_modules/@contrast/sec-obs/package.json +10 -10
  172. package/node_modules/@contrast/sources/lib/index.js +1 -1
  173. package/node_modules/@contrast/sources/lib/index.test.js +0 -26
  174. package/node_modules/@contrast/sources/package.json +3 -3
  175. package/node_modules/@contrast/telemetry/package.json +6 -6
  176. package/node_modules/@opentelemetry/semantic-conventions/README.md +3 -2
  177. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +4350 -2882
  178. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +4350 -2882
  179. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
  180. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.d.ts +136 -0
  181. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +154 -0
  182. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js.map +1 -0
  183. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +713 -141
  184. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +713 -141
  185. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
  186. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.d.ts +2 -0
  187. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +2 -0
  188. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js.map +1 -1
  189. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.d.ts +1 -0
  190. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +1 -0
  191. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js.map +1 -1
  192. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +7 -1
  193. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +7 -1
  194. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
  195. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.d.ts +5 -0
  196. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +23 -0
  197. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js.map +1 -0
  198. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
  199. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
  200. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
  201. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +4350 -2882
  202. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +4350 -2882
  203. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
  204. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.d.ts +136 -0
  205. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +154 -0
  206. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js.map +1 -0
  207. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +713 -141
  208. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +713 -141
  209. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
  210. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.d.ts +2 -0
  211. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +2 -0
  212. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js.map +1 -1
  213. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.d.ts +1 -0
  214. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +1 -0
  215. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js.map +1 -1
  216. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +7 -1
  217. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +7 -1
  218. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
  219. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.d.ts +5 -0
  220. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +23 -0
  221. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js.map +1 -0
  222. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
  223. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
  224. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
  225. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +4350 -2882
  226. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +4354 -2883
  227. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
  228. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.d.ts +136 -0
  229. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +157 -0
  230. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js.map +1 -0
  231. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +713 -141
  232. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +720 -147
  233. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
  234. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.d.ts +2 -0
  235. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +2 -0
  236. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js.map +1 -1
  237. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.d.ts +1 -0
  238. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +1 -0
  239. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js.map +1 -1
  240. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +7 -1
  241. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +10 -4
  242. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
  243. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.d.ts +5 -0
  244. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +26 -0
  245. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js.map +1 -0
  246. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
  247. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
  248. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
  249. package/node_modules/@opentelemetry/semantic-conventions/package.json +6 -7
  250. package/node_modules/@swc/core/README.md +5 -0
  251. package/node_modules/@swc/core/binding.d.ts +2 -2
  252. package/node_modules/@swc/core/index.d.ts +5 -4
  253. package/node_modules/@swc/core/index.js +2 -2
  254. package/node_modules/@swc/core/package.json +12 -12
  255. package/node_modules/@swc/core-darwin-arm64/package.json +1 -1
  256. package/node_modules/@swc/core-darwin-arm64/swc.darwin-arm64.node +0 -0
  257. package/node_modules/@swc/core-darwin-x64/package.json +1 -1
  258. package/node_modules/@swc/core-darwin-x64/swc.darwin-x64.node +0 -0
  259. package/node_modules/@swc/core-linux-arm64-gnu/package.json +1 -1
  260. package/node_modules/@swc/core-linux-arm64-gnu/swc.linux-arm64-gnu.node +0 -0
  261. package/node_modules/@swc/core-linux-arm64-musl/package.json +1 -1
  262. package/node_modules/@swc/core-linux-arm64-musl/swc.linux-arm64-musl.node +0 -0
  263. package/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
  264. package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  265. package/node_modules/@swc/core-linux-x64-musl/package.json +1 -1
  266. package/node_modules/@swc/core-linux-x64-musl/swc.linux-x64-musl.node +0 -0
  267. package/node_modules/@swc/core-win32-arm64-msvc/package.json +1 -1
  268. package/node_modules/@swc/core-win32-arm64-msvc/swc.win32-arm64-msvc.node +0 -0
  269. package/node_modules/@swc/core-win32-x64-msvc/package.json +1 -1
  270. package/node_modules/@swc/core-win32-x64-msvc/swc.win32-x64-msvc.node +0 -0
  271. package/node_modules/@swc/types/index.d.ts +14 -5
  272. package/node_modules/@swc/types/package.json +2 -2
  273. package/node_modules/@types/node/README.md +1 -1
  274. package/node_modules/@types/node/buffer.d.ts +1 -1
  275. package/node_modules/@types/node/child_process.d.ts +26 -122
  276. package/node_modules/@types/node/crypto.d.ts +44 -10
  277. package/node_modules/@types/node/dns.d.ts +5 -0
  278. package/node_modules/@types/node/fs/promises.d.ts +41 -26
  279. package/node_modules/@types/node/fs.d.ts +52 -35
  280. package/node_modules/@types/node/globals.d.ts +148 -347
  281. package/node_modules/@types/node/http.d.ts +29 -5
  282. package/node_modules/@types/node/https.d.ts +5 -0
  283. package/node_modules/@types/node/index.d.ts +7 -2
  284. package/node_modules/@types/node/inspector.d.ts +187 -4089
  285. package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
  286. package/node_modules/@types/node/module.d.ts +1 -0
  287. package/node_modules/@types/node/net.d.ts +21 -0
  288. package/node_modules/@types/node/package.json +3 -3
  289. package/node_modules/@types/node/sqlite.d.ts +34 -0
  290. package/node_modules/@types/node/test.d.ts +104 -0
  291. package/node_modules/@types/node/tls.d.ts +32 -0
  292. package/node_modules/@types/node/ts5.6/index.d.ts +7 -2
  293. package/node_modules/@types/node/ts5.7/index.d.ts +7 -2
  294. package/node_modules/@types/node/url.d.ts +19 -5
  295. package/node_modules/@types/node/util.d.ts +6 -4
  296. package/node_modules/@types/node/vm.d.ts +73 -10
  297. package/node_modules/@types/node/wasi.d.ts +21 -0
  298. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  299. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  300. package/node_modules/@types/node/{dom-events.d.ts → web-globals/events.d.ts} +47 -52
  301. package/node_modules/@types/node/web-globals/fetch.d.ts +50 -0
  302. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  303. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  304. package/node_modules/@types/node/worker_threads.d.ts +51 -3
  305. package/node_modules/axios/CHANGELOG.md +58 -0
  306. package/node_modules/axios/README.md +87 -10
  307. package/node_modules/axios/dist/axios.js +355 -289
  308. package/node_modules/axios/dist/axios.js.map +1 -1
  309. package/node_modules/axios/dist/axios.min.js +2 -2
  310. package/node_modules/axios/dist/axios.min.js.map +1 -1
  311. package/node_modules/axios/dist/browser/axios.cjs +286 -213
  312. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  313. package/node_modules/axios/dist/esm/axios.js +286 -213
  314. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  315. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  316. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  317. package/node_modules/axios/dist/node/axios.cjs +377 -213
  318. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  319. package/node_modules/axios/index.d.cts +12 -5
  320. package/node_modules/axios/index.d.ts +13 -4
  321. package/node_modules/axios/lib/adapters/adapters.js +6 -4
  322. package/node_modules/axios/lib/adapters/fetch.js +221 -162
  323. package/node_modules/axios/lib/adapters/http.js +18 -0
  324. package/node_modules/axios/lib/adapters/xhr.js +11 -8
  325. package/node_modules/axios/lib/core/Axios.js +0 -2
  326. package/node_modules/axios/lib/core/AxiosError.js +10 -3
  327. package/node_modules/axios/lib/core/dispatchRequest.js +1 -1
  328. package/node_modules/axios/lib/defaults/index.js +1 -1
  329. package/node_modules/axios/lib/env/data.js +1 -1
  330. package/node_modules/axios/lib/helpers/buildURL.js +1 -3
  331. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +73 -0
  332. package/node_modules/axios/lib/helpers/resolveConfig.js +13 -9
  333. package/node_modules/axios/lib/utils.js +5 -3
  334. package/node_modules/axios/package.json +18 -12
  335. package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
  336. package/node_modules/balanced-match/LICENSE.md +21 -0
  337. package/node_modules/balanced-match/README.md +97 -0
  338. package/node_modules/balanced-match/index.js +62 -0
  339. package/node_modules/balanced-match/package.json +48 -0
  340. package/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
  341. package/node_modules/brace-expansion/LICENSE +21 -0
  342. package/node_modules/brace-expansion/README.md +135 -0
  343. package/node_modules/brace-expansion/index.js +203 -0
  344. package/node_modules/brace-expansion/package.json +49 -0
  345. package/node_modules/detect-libc/lib/detect-libc.js +59 -13
  346. package/node_modules/detect-libc/lib/elf.js +39 -0
  347. package/node_modules/detect-libc/lib/filesystem.js +18 -8
  348. package/node_modules/detect-libc/package.json +3 -2
  349. package/node_modules/minimatch/LICENSE +15 -0
  350. package/node_modules/minimatch/README.md +454 -0
  351. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  352. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  353. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  354. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  355. package/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
  356. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  357. package/node_modules/minimatch/dist/commonjs/ast.js +592 -0
  358. package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  359. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  360. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  361. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
  362. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  363. package/node_modules/minimatch/dist/commonjs/escape.d.ts +12 -0
  364. package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  365. package/node_modules/minimatch/dist/commonjs/escape.js +22 -0
  366. package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  367. package/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
  368. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  369. package/node_modules/minimatch/dist/commonjs/index.js +1017 -0
  370. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  371. package/node_modules/minimatch/dist/commonjs/package.json +3 -0
  372. package/node_modules/minimatch/dist/commonjs/unescape.d.ts +17 -0
  373. package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  374. package/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
  375. package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  376. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  377. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  378. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  379. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  380. package/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
  381. package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  382. package/node_modules/minimatch/dist/esm/ast.js +588 -0
  383. package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  384. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  385. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  386. package/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
  387. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  388. package/node_modules/minimatch/dist/esm/escape.d.ts +12 -0
  389. package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  390. package/node_modules/minimatch/dist/esm/escape.js +18 -0
  391. package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  392. package/node_modules/minimatch/dist/esm/index.d.ts +94 -0
  393. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  394. package/node_modules/minimatch/dist/esm/index.js +1001 -0
  395. package/node_modules/minimatch/dist/esm/index.js.map +1 -0
  396. package/node_modules/minimatch/dist/esm/package.json +3 -0
  397. package/node_modules/minimatch/dist/esm/unescape.d.ts +17 -0
  398. package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  399. package/node_modules/minimatch/dist/esm/unescape.js +20 -0
  400. package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  401. package/node_modules/minimatch/package.json +82 -0
  402. package/node_modules/node-abi/LICENSE +21 -0
  403. package/node_modules/node-abi/README.md +54 -0
  404. package/node_modules/node-abi/abi_registry.json +408 -0
  405. package/node_modules/node-abi/getNextTarget.js +13 -0
  406. package/node_modules/node-abi/index.js +161 -0
  407. package/node_modules/node-abi/package.json +46 -0
  408. package/node_modules/node-addon-api/README.md +25 -249
  409. package/node_modules/node-addon-api/common.gypi +1 -0
  410. package/node_modules/node-addon-api/index.js +2 -0
  411. package/node_modules/node-addon-api/napi-inl.h +592 -166
  412. package/node_modules/node-addon-api/napi.h +167 -59
  413. package/node_modules/node-addon-api/node_addon_api.gyp +10 -0
  414. package/node_modules/node-addon-api/noexcept.gypi +1 -1
  415. package/node_modules/node-addon-api/package.json +13 -13
  416. package/node_modules/node-addon-api/tools/conversion.js +1 -1
  417. package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
  418. package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
  419. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  420. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  421. package/node_modules/protobufjs/dist/protobuf.js +2 -2
  422. package/node_modules/protobufjs/dist/protobuf.min.js +2 -2
  423. package/node_modules/protobufjs/google/protobuf/descriptor.json +2 -2
  424. package/node_modules/protobufjs/google/protobuf/descriptor.proto +2 -1
  425. package/node_modules/protobufjs/package.json +1 -1
  426. package/node_modules/undici-types/diagnostics-channel.d.ts +9 -0
  427. package/node_modules/undici-types/dispatcher.d.ts +3 -2
  428. package/node_modules/undici-types/env-http-proxy-agent.d.ts +2 -1
  429. package/node_modules/undici-types/eventsource.d.ts +3 -3
  430. package/node_modules/undici-types/fetch.d.ts +1 -0
  431. package/node_modules/undici-types/handlers.d.ts +1 -1
  432. package/node_modules/undici-types/mock-client.d.ts +2 -0
  433. package/node_modules/undici-types/mock-interceptor.d.ts +2 -0
  434. package/node_modules/undici-types/mock-pool.d.ts +2 -0
  435. package/node_modules/undici-types/package.json +1 -1
  436. package/node_modules/undici-types/retry-handler.d.ts +9 -0
  437. package/node_modules/undici-types/webidl.d.ts +29 -15
  438. package/node_modules/undici-types/websocket.d.ts +3 -1
  439. package/package.json +3 -3
  440. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi93.armv8.node +0 -0
  441. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.glibc.node +0 -0
  442. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.musl.node +0 -0
  443. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi93.node +0 -0
  444. package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
  445. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi93.armv8.node +0 -0
  446. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.glibc.node +0 -0
  447. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.musl.node +0 -0
  448. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi93.node +0 -0
  449. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi93.armv8.node +0 -0
  450. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi93.glibc.node +0 -0
  451. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi93.node +0 -0
  452. package/node_modules/@contrast/perf/lib/index.test.js +0 -547
  453. package/node_modules/@contrast/perf/lib/tsconfig.json +0 -31
  454. package/node_modules/@contrast/protect/lib/input-tracing/install/spdy.js +0 -63
  455. package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc.yaml +0 -11
  456. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/destroy.test.js +0 -49
  457. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/end.test.js +0 -98
  458. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush-sync.test.js +0 -140
  459. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush.test.js +0 -419
  460. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/fsync.test.js +0 -63
  461. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/helper.js +0 -42
  462. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/minlength.test.js +0 -35
  463. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/mode.test.js +0 -116
  464. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/reopen.test.js +0 -239
  465. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/retry.test.js +0 -414
  466. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/sync.test.js +0 -261
  467. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/write.test.js +0 -465
  468. package/node_modules/node-addon-api/tools/eslint-format.js +0 -79
@@ -0,0 +1,1001 @@
1
+ import expand from 'brace-expansion';
2
+ import { assertValidPattern } from './assert-valid-pattern.js';
3
+ import { AST } from './ast.js';
4
+ import { escape } from './escape.js';
5
+ import { unescape } from './unescape.js';
6
+ export const minimatch = (p, pattern, options = {}) => {
7
+ assertValidPattern(pattern);
8
+ // shortcut: comments match nothing.
9
+ if (!options.nocomment && pattern.charAt(0) === '#') {
10
+ return false;
11
+ }
12
+ return new Minimatch(pattern, options).match(p);
13
+ };
14
+ // Optimized checking for the most common glob patterns.
15
+ const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
16
+ const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
17
+ const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
18
+ const starDotExtTestNocase = (ext) => {
19
+ ext = ext.toLowerCase();
20
+ return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
21
+ };
22
+ const starDotExtTestNocaseDot = (ext) => {
23
+ ext = ext.toLowerCase();
24
+ return (f) => f.toLowerCase().endsWith(ext);
25
+ };
26
+ const starDotStarRE = /^\*+\.\*+$/;
27
+ const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
28
+ const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
29
+ const dotStarRE = /^\.\*+$/;
30
+ const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
31
+ const starRE = /^\*+$/;
32
+ const starTest = (f) => f.length !== 0 && !f.startsWith('.');
33
+ const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
34
+ const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
35
+ const qmarksTestNocase = ([$0, ext = '']) => {
36
+ const noext = qmarksTestNoExt([$0]);
37
+ if (!ext)
38
+ return noext;
39
+ ext = ext.toLowerCase();
40
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext);
41
+ };
42
+ const qmarksTestNocaseDot = ([$0, ext = '']) => {
43
+ const noext = qmarksTestNoExtDot([$0]);
44
+ if (!ext)
45
+ return noext;
46
+ ext = ext.toLowerCase();
47
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext);
48
+ };
49
+ const qmarksTestDot = ([$0, ext = '']) => {
50
+ const noext = qmarksTestNoExtDot([$0]);
51
+ return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
52
+ };
53
+ const qmarksTest = ([$0, ext = '']) => {
54
+ const noext = qmarksTestNoExt([$0]);
55
+ return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
56
+ };
57
+ const qmarksTestNoExt = ([$0]) => {
58
+ const len = $0.length;
59
+ return (f) => f.length === len && !f.startsWith('.');
60
+ };
61
+ const qmarksTestNoExtDot = ([$0]) => {
62
+ const len = $0.length;
63
+ return (f) => f.length === len && f !== '.' && f !== '..';
64
+ };
65
+ /* c8 ignore start */
66
+ const defaultPlatform = (typeof process === 'object' && process
67
+ ? (typeof process.env === 'object' &&
68
+ process.env &&
69
+ process.env.__MINIMATCH_TESTING_PLATFORM__) ||
70
+ process.platform
71
+ : 'posix');
72
+ const path = {
73
+ win32: { sep: '\\' },
74
+ posix: { sep: '/' },
75
+ };
76
+ /* c8 ignore stop */
77
+ export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
78
+ minimatch.sep = sep;
79
+ export const GLOBSTAR = Symbol('globstar **');
80
+ minimatch.GLOBSTAR = GLOBSTAR;
81
+ // any single thing other than /
82
+ // don't need to escape / when using new RegExp()
83
+ const qmark = '[^/]';
84
+ // * => any number of characters
85
+ const star = qmark + '*?';
86
+ // ** when dots are allowed. Anything goes, except .. and .
87
+ // not (^ or / followed by one or two dots followed by $ or /),
88
+ // followed by anything, any number of times.
89
+ const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
90
+ // not a ^ or / followed by a dot,
91
+ // followed by anything, any number of times.
92
+ const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
93
+ export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
94
+ minimatch.filter = filter;
95
+ const ext = (a, b = {}) => Object.assign({}, a, b);
96
+ export const defaults = (def) => {
97
+ if (!def || typeof def !== 'object' || !Object.keys(def).length) {
98
+ return minimatch;
99
+ }
100
+ const orig = minimatch;
101
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
102
+ return Object.assign(m, {
103
+ Minimatch: class Minimatch extends orig.Minimatch {
104
+ constructor(pattern, options = {}) {
105
+ super(pattern, ext(def, options));
106
+ }
107
+ static defaults(options) {
108
+ return orig.defaults(ext(def, options)).Minimatch;
109
+ }
110
+ },
111
+ AST: class AST extends orig.AST {
112
+ /* c8 ignore start */
113
+ constructor(type, parent, options = {}) {
114
+ super(type, parent, ext(def, options));
115
+ }
116
+ /* c8 ignore stop */
117
+ static fromGlob(pattern, options = {}) {
118
+ return orig.AST.fromGlob(pattern, ext(def, options));
119
+ }
120
+ },
121
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
122
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
123
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
124
+ defaults: (options) => orig.defaults(ext(def, options)),
125
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
126
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
127
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
128
+ sep: orig.sep,
129
+ GLOBSTAR: GLOBSTAR,
130
+ });
131
+ };
132
+ minimatch.defaults = defaults;
133
+ // Brace expansion:
134
+ // a{b,c}d -> abd acd
135
+ // a{b,}c -> abc ac
136
+ // a{0..3}d -> a0d a1d a2d a3d
137
+ // a{b,c{d,e}f}g -> abg acdfg acefg
138
+ // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
139
+ //
140
+ // Invalid sets are not expanded.
141
+ // a{2..}b -> a{2..}b
142
+ // a{b}c -> a{b}c
143
+ export const braceExpand = (pattern, options = {}) => {
144
+ assertValidPattern(pattern);
145
+ // Thanks to Yeting Li <https://github.com/yetingli> for
146
+ // improving this regexp to avoid a ReDOS vulnerability.
147
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
148
+ // shortcut. no need to expand.
149
+ return [pattern];
150
+ }
151
+ return expand(pattern);
152
+ };
153
+ minimatch.braceExpand = braceExpand;
154
+ // parse a component of the expanded set.
155
+ // At this point, no pattern may contain "/" in it
156
+ // so we're going to return a 2d array, where each entry is the full
157
+ // pattern, split on '/', and then turned into a regular expression.
158
+ // A regexp is made at the end which joins each array with an
159
+ // escaped /, and another full one which joins each regexp with |.
160
+ //
161
+ // Following the lead of Bash 4.1, note that "**" only has special meaning
162
+ // when it is the *only* thing in a path portion. Otherwise, any series
163
+ // of * is equivalent to a single *. Globstar behavior is enabled by
164
+ // default, and can be disabled by setting options.noglobstar.
165
+ export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
166
+ minimatch.makeRe = makeRe;
167
+ export const match = (list, pattern, options = {}) => {
168
+ const mm = new Minimatch(pattern, options);
169
+ list = list.filter(f => mm.match(f));
170
+ if (mm.options.nonull && !list.length) {
171
+ list.push(pattern);
172
+ }
173
+ return list;
174
+ };
175
+ minimatch.match = match;
176
+ // replace stuff like \* with *
177
+ const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
178
+ const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
179
+ export class Minimatch {
180
+ options;
181
+ set;
182
+ pattern;
183
+ windowsPathsNoEscape;
184
+ nonegate;
185
+ negate;
186
+ comment;
187
+ empty;
188
+ preserveMultipleSlashes;
189
+ partial;
190
+ globSet;
191
+ globParts;
192
+ nocase;
193
+ isWindows;
194
+ platform;
195
+ windowsNoMagicRoot;
196
+ regexp;
197
+ constructor(pattern, options = {}) {
198
+ assertValidPattern(pattern);
199
+ options = options || {};
200
+ this.options = options;
201
+ this.pattern = pattern;
202
+ this.platform = options.platform || defaultPlatform;
203
+ this.isWindows = this.platform === 'win32';
204
+ this.windowsPathsNoEscape =
205
+ !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
206
+ if (this.windowsPathsNoEscape) {
207
+ this.pattern = this.pattern.replace(/\\/g, '/');
208
+ }
209
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
210
+ this.regexp = null;
211
+ this.negate = false;
212
+ this.nonegate = !!options.nonegate;
213
+ this.comment = false;
214
+ this.empty = false;
215
+ this.partial = !!options.partial;
216
+ this.nocase = !!this.options.nocase;
217
+ this.windowsNoMagicRoot =
218
+ options.windowsNoMagicRoot !== undefined
219
+ ? options.windowsNoMagicRoot
220
+ : !!(this.isWindows && this.nocase);
221
+ this.globSet = [];
222
+ this.globParts = [];
223
+ this.set = [];
224
+ // make the set of regexps etc.
225
+ this.make();
226
+ }
227
+ hasMagic() {
228
+ if (this.options.magicalBraces && this.set.length > 1) {
229
+ return true;
230
+ }
231
+ for (const pattern of this.set) {
232
+ for (const part of pattern) {
233
+ if (typeof part !== 'string')
234
+ return true;
235
+ }
236
+ }
237
+ return false;
238
+ }
239
+ debug(..._) { }
240
+ make() {
241
+ const pattern = this.pattern;
242
+ const options = this.options;
243
+ // empty patterns and comments match nothing.
244
+ if (!options.nocomment && pattern.charAt(0) === '#') {
245
+ this.comment = true;
246
+ return;
247
+ }
248
+ if (!pattern) {
249
+ this.empty = true;
250
+ return;
251
+ }
252
+ // step 1: figure out negation, etc.
253
+ this.parseNegate();
254
+ // step 2: expand braces
255
+ this.globSet = [...new Set(this.braceExpand())];
256
+ if (options.debug) {
257
+ this.debug = (...args) => console.error(...args);
258
+ }
259
+ this.debug(this.pattern, this.globSet);
260
+ // step 3: now we have a set, so turn each one into a series of
261
+ // path-portion matching patterns.
262
+ // These will be regexps, except in the case of "**", which is
263
+ // set to the GLOBSTAR object for globstar behavior,
264
+ // and will not contain any / characters
265
+ //
266
+ // First, we preprocess to make the glob pattern sets a bit simpler
267
+ // and deduped. There are some perf-killing patterns that can cause
268
+ // problems with a glob walk, but we can simplify them down a bit.
269
+ const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
270
+ this.globParts = this.preprocess(rawGlobParts);
271
+ this.debug(this.pattern, this.globParts);
272
+ // glob --> regexps
273
+ let set = this.globParts.map((s, _, __) => {
274
+ if (this.isWindows && this.windowsNoMagicRoot) {
275
+ // check if it's a drive or unc path.
276
+ const isUNC = s[0] === '' &&
277
+ s[1] === '' &&
278
+ (s[2] === '?' || !globMagic.test(s[2])) &&
279
+ !globMagic.test(s[3]);
280
+ const isDrive = /^[a-z]:/i.test(s[0]);
281
+ if (isUNC) {
282
+ return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
283
+ }
284
+ else if (isDrive) {
285
+ return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
286
+ }
287
+ }
288
+ return s.map(ss => this.parse(ss));
289
+ });
290
+ this.debug(this.pattern, set);
291
+ // filter out everything that didn't compile properly.
292
+ this.set = set.filter(s => s.indexOf(false) === -1);
293
+ // do not treat the ? in UNC paths as magic
294
+ if (this.isWindows) {
295
+ for (let i = 0; i < this.set.length; i++) {
296
+ const p = this.set[i];
297
+ if (p[0] === '' &&
298
+ p[1] === '' &&
299
+ this.globParts[i][2] === '?' &&
300
+ typeof p[3] === 'string' &&
301
+ /^[a-z]:$/i.test(p[3])) {
302
+ p[2] = '?';
303
+ }
304
+ }
305
+ }
306
+ this.debug(this.pattern, this.set);
307
+ }
308
+ // various transforms to equivalent pattern sets that are
309
+ // faster to process in a filesystem walk. The goal is to
310
+ // eliminate what we can, and push all ** patterns as far
311
+ // to the right as possible, even if it increases the number
312
+ // of patterns that we have to process.
313
+ preprocess(globParts) {
314
+ // if we're not in globstar mode, then turn all ** into *
315
+ if (this.options.noglobstar) {
316
+ for (let i = 0; i < globParts.length; i++) {
317
+ for (let j = 0; j < globParts[i].length; j++) {
318
+ if (globParts[i][j] === '**') {
319
+ globParts[i][j] = '*';
320
+ }
321
+ }
322
+ }
323
+ }
324
+ const { optimizationLevel = 1 } = this.options;
325
+ if (optimizationLevel >= 2) {
326
+ // aggressive optimization for the purpose of fs walking
327
+ globParts = this.firstPhasePreProcess(globParts);
328
+ globParts = this.secondPhasePreProcess(globParts);
329
+ }
330
+ else if (optimizationLevel >= 1) {
331
+ // just basic optimizations to remove some .. parts
332
+ globParts = this.levelOneOptimize(globParts);
333
+ }
334
+ else {
335
+ // just collapse multiple ** portions into one
336
+ globParts = this.adjascentGlobstarOptimize(globParts);
337
+ }
338
+ return globParts;
339
+ }
340
+ // just get rid of adjascent ** portions
341
+ adjascentGlobstarOptimize(globParts) {
342
+ return globParts.map(parts => {
343
+ let gs = -1;
344
+ while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
345
+ let i = gs;
346
+ while (parts[i + 1] === '**') {
347
+ i++;
348
+ }
349
+ if (i !== gs) {
350
+ parts.splice(gs, i - gs);
351
+ }
352
+ }
353
+ return parts;
354
+ });
355
+ }
356
+ // get rid of adjascent ** and resolve .. portions
357
+ levelOneOptimize(globParts) {
358
+ return globParts.map(parts => {
359
+ parts = parts.reduce((set, part) => {
360
+ const prev = set[set.length - 1];
361
+ if (part === '**' && prev === '**') {
362
+ return set;
363
+ }
364
+ if (part === '..') {
365
+ if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
366
+ set.pop();
367
+ return set;
368
+ }
369
+ }
370
+ set.push(part);
371
+ return set;
372
+ }, []);
373
+ return parts.length === 0 ? [''] : parts;
374
+ });
375
+ }
376
+ levelTwoFileOptimize(parts) {
377
+ if (!Array.isArray(parts)) {
378
+ parts = this.slashSplit(parts);
379
+ }
380
+ let didSomething = false;
381
+ do {
382
+ didSomething = false;
383
+ // <pre>/<e>/<rest> -> <pre>/<rest>
384
+ if (!this.preserveMultipleSlashes) {
385
+ for (let i = 1; i < parts.length - 1; i++) {
386
+ const p = parts[i];
387
+ // don't squeeze out UNC patterns
388
+ if (i === 1 && p === '' && parts[0] === '')
389
+ continue;
390
+ if (p === '.' || p === '') {
391
+ didSomething = true;
392
+ parts.splice(i, 1);
393
+ i--;
394
+ }
395
+ }
396
+ if (parts[0] === '.' &&
397
+ parts.length === 2 &&
398
+ (parts[1] === '.' || parts[1] === '')) {
399
+ didSomething = true;
400
+ parts.pop();
401
+ }
402
+ }
403
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
404
+ let dd = 0;
405
+ while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
406
+ const p = parts[dd - 1];
407
+ if (p && p !== '.' && p !== '..' && p !== '**') {
408
+ didSomething = true;
409
+ parts.splice(dd - 1, 2);
410
+ dd -= 2;
411
+ }
412
+ }
413
+ } while (didSomething);
414
+ return parts.length === 0 ? [''] : parts;
415
+ }
416
+ // First phase: single-pattern processing
417
+ // <pre> is 1 or more portions
418
+ // <rest> is 1 or more portions
419
+ // <p> is any portion other than ., .., '', or **
420
+ // <e> is . or ''
421
+ //
422
+ // **/.. is *brutal* for filesystem walking performance, because
423
+ // it effectively resets the recursive walk each time it occurs,
424
+ // and ** cannot be reduced out by a .. pattern part like a regexp
425
+ // or most strings (other than .., ., and '') can be.
426
+ //
427
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
428
+ // <pre>/<e>/<rest> -> <pre>/<rest>
429
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
430
+ // **/**/<rest> -> **/<rest>
431
+ //
432
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
433
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
434
+ firstPhasePreProcess(globParts) {
435
+ let didSomething = false;
436
+ do {
437
+ didSomething = false;
438
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
439
+ for (let parts of globParts) {
440
+ let gs = -1;
441
+ while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
442
+ let gss = gs;
443
+ while (parts[gss + 1] === '**') {
444
+ // <pre>/**/**/<rest> -> <pre>/**/<rest>
445
+ gss++;
446
+ }
447
+ // eg, if gs is 2 and gss is 4, that means we have 3 **
448
+ // parts, and can remove 2 of them.
449
+ if (gss > gs) {
450
+ parts.splice(gs + 1, gss - gs);
451
+ }
452
+ let next = parts[gs + 1];
453
+ const p = parts[gs + 2];
454
+ const p2 = parts[gs + 3];
455
+ if (next !== '..')
456
+ continue;
457
+ if (!p ||
458
+ p === '.' ||
459
+ p === '..' ||
460
+ !p2 ||
461
+ p2 === '.' ||
462
+ p2 === '..') {
463
+ continue;
464
+ }
465
+ didSomething = true;
466
+ // edit parts in place, and push the new one
467
+ parts.splice(gs, 1);
468
+ const other = parts.slice(0);
469
+ other[gs] = '**';
470
+ globParts.push(other);
471
+ gs--;
472
+ }
473
+ // <pre>/<e>/<rest> -> <pre>/<rest>
474
+ if (!this.preserveMultipleSlashes) {
475
+ for (let i = 1; i < parts.length - 1; i++) {
476
+ const p = parts[i];
477
+ // don't squeeze out UNC patterns
478
+ if (i === 1 && p === '' && parts[0] === '')
479
+ continue;
480
+ if (p === '.' || p === '') {
481
+ didSomething = true;
482
+ parts.splice(i, 1);
483
+ i--;
484
+ }
485
+ }
486
+ if (parts[0] === '.' &&
487
+ parts.length === 2 &&
488
+ (parts[1] === '.' || parts[1] === '')) {
489
+ didSomething = true;
490
+ parts.pop();
491
+ }
492
+ }
493
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
494
+ let dd = 0;
495
+ while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
496
+ const p = parts[dd - 1];
497
+ if (p && p !== '.' && p !== '..' && p !== '**') {
498
+ didSomething = true;
499
+ const needDot = dd === 1 && parts[dd + 1] === '**';
500
+ const splin = needDot ? ['.'] : [];
501
+ parts.splice(dd - 1, 2, ...splin);
502
+ if (parts.length === 0)
503
+ parts.push('');
504
+ dd -= 2;
505
+ }
506
+ }
507
+ }
508
+ } while (didSomething);
509
+ return globParts;
510
+ }
511
+ // second phase: multi-pattern dedupes
512
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
513
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
514
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
515
+ //
516
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
517
+ // ^-- not valid because ** doens't follow symlinks
518
+ secondPhasePreProcess(globParts) {
519
+ for (let i = 0; i < globParts.length - 1; i++) {
520
+ for (let j = i + 1; j < globParts.length; j++) {
521
+ const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
522
+ if (matched) {
523
+ globParts[i] = [];
524
+ globParts[j] = matched;
525
+ break;
526
+ }
527
+ }
528
+ }
529
+ return globParts.filter(gs => gs.length);
530
+ }
531
+ partsMatch(a, b, emptyGSMatch = false) {
532
+ let ai = 0;
533
+ let bi = 0;
534
+ let result = [];
535
+ let which = '';
536
+ while (ai < a.length && bi < b.length) {
537
+ if (a[ai] === b[bi]) {
538
+ result.push(which === 'b' ? b[bi] : a[ai]);
539
+ ai++;
540
+ bi++;
541
+ }
542
+ else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
543
+ result.push(a[ai]);
544
+ ai++;
545
+ }
546
+ else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
547
+ result.push(b[bi]);
548
+ bi++;
549
+ }
550
+ else if (a[ai] === '*' &&
551
+ b[bi] &&
552
+ (this.options.dot || !b[bi].startsWith('.')) &&
553
+ b[bi] !== '**') {
554
+ if (which === 'b')
555
+ return false;
556
+ which = 'a';
557
+ result.push(a[ai]);
558
+ ai++;
559
+ bi++;
560
+ }
561
+ else if (b[bi] === '*' &&
562
+ a[ai] &&
563
+ (this.options.dot || !a[ai].startsWith('.')) &&
564
+ a[ai] !== '**') {
565
+ if (which === 'a')
566
+ return false;
567
+ which = 'b';
568
+ result.push(b[bi]);
569
+ ai++;
570
+ bi++;
571
+ }
572
+ else {
573
+ return false;
574
+ }
575
+ }
576
+ // if we fall out of the loop, it means they two are identical
577
+ // as long as their lengths match
578
+ return a.length === b.length && result;
579
+ }
580
+ parseNegate() {
581
+ if (this.nonegate)
582
+ return;
583
+ const pattern = this.pattern;
584
+ let negate = false;
585
+ let negateOffset = 0;
586
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
587
+ negate = !negate;
588
+ negateOffset++;
589
+ }
590
+ if (negateOffset)
591
+ this.pattern = pattern.slice(negateOffset);
592
+ this.negate = negate;
593
+ }
594
+ // set partial to true to test if, for example,
595
+ // "/a/b" matches the start of "/*/b/*/d"
596
+ // Partial means, if you run out of file before you run
597
+ // out of pattern, then that's fine, as long as all
598
+ // the parts match.
599
+ matchOne(file, pattern, partial = false) {
600
+ const options = this.options;
601
+ // UNC paths like //?/X:/... can match X:/... and vice versa
602
+ // Drive letters in absolute drive or unc paths are always compared
603
+ // case-insensitively.
604
+ if (this.isWindows) {
605
+ const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
606
+ const fileUNC = !fileDrive &&
607
+ file[0] === '' &&
608
+ file[1] === '' &&
609
+ file[2] === '?' &&
610
+ /^[a-z]:$/i.test(file[3]);
611
+ const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
612
+ const patternUNC = !patternDrive &&
613
+ pattern[0] === '' &&
614
+ pattern[1] === '' &&
615
+ pattern[2] === '?' &&
616
+ typeof pattern[3] === 'string' &&
617
+ /^[a-z]:$/i.test(pattern[3]);
618
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
619
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
620
+ if (typeof fdi === 'number' && typeof pdi === 'number') {
621
+ const [fd, pd] = [file[fdi], pattern[pdi]];
622
+ if (fd.toLowerCase() === pd.toLowerCase()) {
623
+ pattern[pdi] = fd;
624
+ if (pdi > fdi) {
625
+ pattern = pattern.slice(pdi);
626
+ }
627
+ else if (fdi > pdi) {
628
+ file = file.slice(fdi);
629
+ }
630
+ }
631
+ }
632
+ }
633
+ // resolve and reduce . and .. portions in the file as well.
634
+ // dont' need to do the second phase, because it's only one string[]
635
+ const { optimizationLevel = 1 } = this.options;
636
+ if (optimizationLevel >= 2) {
637
+ file = this.levelTwoFileOptimize(file);
638
+ }
639
+ this.debug('matchOne', this, { file, pattern });
640
+ this.debug('matchOne', file.length, pattern.length);
641
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
642
+ this.debug('matchOne loop');
643
+ var p = pattern[pi];
644
+ var f = file[fi];
645
+ this.debug(pattern, p, f);
646
+ // should be impossible.
647
+ // some invalid regexp stuff in the set.
648
+ /* c8 ignore start */
649
+ if (p === false) {
650
+ return false;
651
+ }
652
+ /* c8 ignore stop */
653
+ if (p === GLOBSTAR) {
654
+ this.debug('GLOBSTAR', [pattern, p, f]);
655
+ // "**"
656
+ // a/**/b/**/c would match the following:
657
+ // a/b/x/y/z/c
658
+ // a/x/y/z/b/c
659
+ // a/b/x/b/x/c
660
+ // a/b/c
661
+ // To do this, take the rest of the pattern after
662
+ // the **, and see if it would match the file remainder.
663
+ // If so, return success.
664
+ // If not, the ** "swallows" a segment, and try again.
665
+ // This is recursively awful.
666
+ //
667
+ // a/**/b/**/c matching a/b/x/y/z/c
668
+ // - a matches a
669
+ // - doublestar
670
+ // - matchOne(b/x/y/z/c, b/**/c)
671
+ // - b matches b
672
+ // - doublestar
673
+ // - matchOne(x/y/z/c, c) -> no
674
+ // - matchOne(y/z/c, c) -> no
675
+ // - matchOne(z/c, c) -> no
676
+ // - matchOne(c, c) yes, hit
677
+ var fr = fi;
678
+ var pr = pi + 1;
679
+ if (pr === pl) {
680
+ this.debug('** at the end');
681
+ // a ** at the end will just swallow the rest.
682
+ // We have found a match.
683
+ // however, it will not swallow /.x, unless
684
+ // options.dot is set.
685
+ // . and .. are *never* matched by **, for explosively
686
+ // exponential reasons.
687
+ for (; fi < fl; fi++) {
688
+ if (file[fi] === '.' ||
689
+ file[fi] === '..' ||
690
+ (!options.dot && file[fi].charAt(0) === '.'))
691
+ return false;
692
+ }
693
+ return true;
694
+ }
695
+ // ok, let's see if we can swallow whatever we can.
696
+ while (fr < fl) {
697
+ var swallowee = file[fr];
698
+ this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
699
+ // XXX remove this slice. Just pass the start index.
700
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
701
+ this.debug('globstar found match!', fr, fl, swallowee);
702
+ // found a match.
703
+ return true;
704
+ }
705
+ else {
706
+ // can't swallow "." or ".." ever.
707
+ // can only swallow ".foo" when explicitly asked.
708
+ if (swallowee === '.' ||
709
+ swallowee === '..' ||
710
+ (!options.dot && swallowee.charAt(0) === '.')) {
711
+ this.debug('dot detected!', file, fr, pattern, pr);
712
+ break;
713
+ }
714
+ // ** swallows a segment, and continue.
715
+ this.debug('globstar swallow a segment, and continue');
716
+ fr++;
717
+ }
718
+ }
719
+ // no match was found.
720
+ // However, in partial mode, we can't say this is necessarily over.
721
+ /* c8 ignore start */
722
+ if (partial) {
723
+ // ran out of file
724
+ this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
725
+ if (fr === fl) {
726
+ return true;
727
+ }
728
+ }
729
+ /* c8 ignore stop */
730
+ return false;
731
+ }
732
+ // something other than **
733
+ // non-magic patterns just have to match exactly
734
+ // patterns with magic have been turned into regexps.
735
+ let hit;
736
+ if (typeof p === 'string') {
737
+ hit = f === p;
738
+ this.debug('string match', p, f, hit);
739
+ }
740
+ else {
741
+ hit = p.test(f);
742
+ this.debug('pattern match', p, f, hit);
743
+ }
744
+ if (!hit)
745
+ return false;
746
+ }
747
+ // Note: ending in / means that we'll get a final ""
748
+ // at the end of the pattern. This can only match a
749
+ // corresponding "" at the end of the file.
750
+ // If the file ends in /, then it can only match a
751
+ // a pattern that ends in /, unless the pattern just
752
+ // doesn't have any more for it. But, a/b/ should *not*
753
+ // match "a/b/*", even though "" matches against the
754
+ // [^/]*? pattern, except in partial mode, where it might
755
+ // simply not be reached yet.
756
+ // However, a/b/ should still satisfy a/*
757
+ // now either we fell off the end of the pattern, or we're done.
758
+ if (fi === fl && pi === pl) {
759
+ // ran out of pattern and filename at the same time.
760
+ // an exact hit!
761
+ return true;
762
+ }
763
+ else if (fi === fl) {
764
+ // ran out of file, but still had pattern left.
765
+ // this is ok if we're doing the match as part of
766
+ // a glob fs traversal.
767
+ return partial;
768
+ }
769
+ else if (pi === pl) {
770
+ // ran out of pattern, still have file left.
771
+ // this is only acceptable if we're on the very last
772
+ // empty segment of a file with a trailing slash.
773
+ // a/* should match a/b/
774
+ return fi === fl - 1 && file[fi] === '';
775
+ /* c8 ignore start */
776
+ }
777
+ else {
778
+ // should be unreachable.
779
+ throw new Error('wtf?');
780
+ }
781
+ /* c8 ignore stop */
782
+ }
783
+ braceExpand() {
784
+ return braceExpand(this.pattern, this.options);
785
+ }
786
+ parse(pattern) {
787
+ assertValidPattern(pattern);
788
+ const options = this.options;
789
+ // shortcuts
790
+ if (pattern === '**')
791
+ return GLOBSTAR;
792
+ if (pattern === '')
793
+ return '';
794
+ // far and away, the most common glob pattern parts are
795
+ // *, *.*, and *.<ext> Add a fast check method for those.
796
+ let m;
797
+ let fastTest = null;
798
+ if ((m = pattern.match(starRE))) {
799
+ fastTest = options.dot ? starTestDot : starTest;
800
+ }
801
+ else if ((m = pattern.match(starDotExtRE))) {
802
+ fastTest = (options.nocase
803
+ ? options.dot
804
+ ? starDotExtTestNocaseDot
805
+ : starDotExtTestNocase
806
+ : options.dot
807
+ ? starDotExtTestDot
808
+ : starDotExtTest)(m[1]);
809
+ }
810
+ else if ((m = pattern.match(qmarksRE))) {
811
+ fastTest = (options.nocase
812
+ ? options.dot
813
+ ? qmarksTestNocaseDot
814
+ : qmarksTestNocase
815
+ : options.dot
816
+ ? qmarksTestDot
817
+ : qmarksTest)(m);
818
+ }
819
+ else if ((m = pattern.match(starDotStarRE))) {
820
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
821
+ }
822
+ else if ((m = pattern.match(dotStarRE))) {
823
+ fastTest = dotStarTest;
824
+ }
825
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
826
+ if (fastTest && typeof re === 'object') {
827
+ // Avoids overriding in frozen environments
828
+ Reflect.defineProperty(re, 'test', { value: fastTest });
829
+ }
830
+ return re;
831
+ }
832
+ makeRe() {
833
+ if (this.regexp || this.regexp === false)
834
+ return this.regexp;
835
+ // at this point, this.set is a 2d array of partial
836
+ // pattern strings, or "**".
837
+ //
838
+ // It's better to use .match(). This function shouldn't
839
+ // be used, really, but it's pretty convenient sometimes,
840
+ // when you just want to work with a regex.
841
+ const set = this.set;
842
+ if (!set.length) {
843
+ this.regexp = false;
844
+ return this.regexp;
845
+ }
846
+ const options = this.options;
847
+ const twoStar = options.noglobstar
848
+ ? star
849
+ : options.dot
850
+ ? twoStarDot
851
+ : twoStarNoDot;
852
+ const flags = new Set(options.nocase ? ['i'] : []);
853
+ // regexpify non-globstar patterns
854
+ // if ** is only item, then we just do one twoStar
855
+ // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
856
+ // if ** is last, append (\/twoStar|) to previous
857
+ // if ** is in the middle, append (\/|\/twoStar\/) to previous
858
+ // then filter out GLOBSTAR symbols
859
+ let re = set
860
+ .map(pattern => {
861
+ const pp = pattern.map(p => {
862
+ if (p instanceof RegExp) {
863
+ for (const f of p.flags.split(''))
864
+ flags.add(f);
865
+ }
866
+ return typeof p === 'string'
867
+ ? regExpEscape(p)
868
+ : p === GLOBSTAR
869
+ ? GLOBSTAR
870
+ : p._src;
871
+ });
872
+ pp.forEach((p, i) => {
873
+ const next = pp[i + 1];
874
+ const prev = pp[i - 1];
875
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
876
+ return;
877
+ }
878
+ if (prev === undefined) {
879
+ if (next !== undefined && next !== GLOBSTAR) {
880
+ pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
881
+ }
882
+ else {
883
+ pp[i] = twoStar;
884
+ }
885
+ }
886
+ else if (next === undefined) {
887
+ pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
888
+ }
889
+ else if (next !== GLOBSTAR) {
890
+ pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
891
+ pp[i + 1] = GLOBSTAR;
892
+ }
893
+ });
894
+ return pp.filter(p => p !== GLOBSTAR).join('/');
895
+ })
896
+ .join('|');
897
+ // need to wrap in parens if we had more than one thing with |,
898
+ // otherwise only the first will be anchored to ^ and the last to $
899
+ const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
900
+ // must match entire pattern
901
+ // ending in a * or ** will make it less strict.
902
+ re = '^' + open + re + close + '$';
903
+ // can match anything, as long as it's not this.
904
+ if (this.negate)
905
+ re = '^(?!' + re + ').+$';
906
+ try {
907
+ this.regexp = new RegExp(re, [...flags].join(''));
908
+ /* c8 ignore start */
909
+ }
910
+ catch (ex) {
911
+ // should be impossible
912
+ this.regexp = false;
913
+ }
914
+ /* c8 ignore stop */
915
+ return this.regexp;
916
+ }
917
+ slashSplit(p) {
918
+ // if p starts with // on windows, we preserve that
919
+ // so that UNC paths aren't broken. Otherwise, any number of
920
+ // / characters are coalesced into one, unless
921
+ // preserveMultipleSlashes is set to true.
922
+ if (this.preserveMultipleSlashes) {
923
+ return p.split('/');
924
+ }
925
+ else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
926
+ // add an extra '' for the one we lose
927
+ return ['', ...p.split(/\/+/)];
928
+ }
929
+ else {
930
+ return p.split(/\/+/);
931
+ }
932
+ }
933
+ match(f, partial = this.partial) {
934
+ this.debug('match', f, this.pattern);
935
+ // short-circuit in the case of busted things.
936
+ // comments, etc.
937
+ if (this.comment) {
938
+ return false;
939
+ }
940
+ if (this.empty) {
941
+ return f === '';
942
+ }
943
+ if (f === '/' && partial) {
944
+ return true;
945
+ }
946
+ const options = this.options;
947
+ // windows: need to use /, not \
948
+ if (this.isWindows) {
949
+ f = f.split('\\').join('/');
950
+ }
951
+ // treat the test path as a set of pathparts.
952
+ const ff = this.slashSplit(f);
953
+ this.debug(this.pattern, 'split', ff);
954
+ // just ONE of the pattern sets in this.set needs to match
955
+ // in order for it to be valid. If negating, then just one
956
+ // match means that we have failed.
957
+ // Either way, return on the first hit.
958
+ const set = this.set;
959
+ this.debug(this.pattern, 'set', set);
960
+ // Find the basename of the path by looking for the last non-empty segment
961
+ let filename = ff[ff.length - 1];
962
+ if (!filename) {
963
+ for (let i = ff.length - 2; !filename && i >= 0; i--) {
964
+ filename = ff[i];
965
+ }
966
+ }
967
+ for (let i = 0; i < set.length; i++) {
968
+ const pattern = set[i];
969
+ let file = ff;
970
+ if (options.matchBase && pattern.length === 1) {
971
+ file = [filename];
972
+ }
973
+ const hit = this.matchOne(file, pattern, partial);
974
+ if (hit) {
975
+ if (options.flipNegate) {
976
+ return true;
977
+ }
978
+ return !this.negate;
979
+ }
980
+ }
981
+ // didn't get any hits. this is success if it's a negative
982
+ // pattern, failure otherwise.
983
+ if (options.flipNegate) {
984
+ return false;
985
+ }
986
+ return this.negate;
987
+ }
988
+ static defaults(def) {
989
+ return minimatch.defaults(def).Minimatch;
990
+ }
991
+ }
992
+ /* c8 ignore start */
993
+ export { AST } from './ast.js';
994
+ export { escape } from './escape.js';
995
+ export { unescape } from './unescape.js';
996
+ /* c8 ignore stop */
997
+ minimatch.AST = AST;
998
+ minimatch.Minimatch = Minimatch;
999
+ minimatch.escape = escape;
1000
+ minimatch.unescape = unescape;
1001
+ //# sourceMappingURL=index.js.map