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