projen 0.91.17 → 0.91.18

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 (492) hide show
  1. package/.jsii +3 -3
  2. package/lib/awscdk/auto-discover.js +5 -5
  3. package/lib/awscdk/awscdk-app-java.js +1 -1
  4. package/lib/awscdk/awscdk-app-py.js +1 -1
  5. package/lib/awscdk/awscdk-app-ts.js +1 -1
  6. package/lib/awscdk/awscdk-construct.js +2 -2
  7. package/lib/awscdk/awscdk-deps-java.js +1 -1
  8. package/lib/awscdk/awscdk-deps-js.js +1 -1
  9. package/lib/awscdk/awscdk-deps-py.js +1 -1
  10. package/lib/awscdk/awscdk-deps.js +1 -1
  11. package/lib/awscdk/cdk-config.js +1 -1
  12. package/lib/awscdk/cdk-tasks.js +1 -1
  13. package/lib/awscdk/integration-test.js +1 -1
  14. package/lib/awscdk/lambda-extension.js +1 -1
  15. package/lib/awscdk/lambda-function.js +2 -2
  16. package/lib/build/build-workflow.js +1 -1
  17. package/lib/cdk/auto-discover-base.js +2 -2
  18. package/lib/cdk/construct-lib.js +1 -1
  19. package/lib/cdk/integration-test-base.js +1 -1
  20. package/lib/cdk/jsii-docgen.js +1 -1
  21. package/lib/cdk/jsii-project.js +1 -1
  22. package/lib/cdk8s/auto-discover.js +2 -2
  23. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  24. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  25. package/lib/cdk8s/cdk8s-construct.js +1 -1
  26. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps.js +1 -1
  28. package/lib/cdk8s/integration-test.js +1 -1
  29. package/lib/cdktf/cdktf-construct.js +1 -1
  30. package/lib/circleci/circleci.js +1 -1
  31. package/lib/component.js +1 -1
  32. package/lib/dependencies.js +1 -1
  33. package/lib/dev-env.js +1 -1
  34. package/lib/docker-compose/docker-compose-service.js +1 -1
  35. package/lib/docker-compose/docker-compose.js +1 -1
  36. package/lib/file.js +1 -1
  37. package/lib/gitattributes.js +1 -1
  38. package/lib/github/actions-provider.js +1 -1
  39. package/lib/github/auto-approve.js +1 -1
  40. package/lib/github/auto-merge.js +1 -1
  41. package/lib/github/auto-queue.js +1 -1
  42. package/lib/github/dependabot.js +1 -1
  43. package/lib/github/github-credentials.js +1 -1
  44. package/lib/github/github-project.js +1 -1
  45. package/lib/github/github.js +1 -1
  46. package/lib/github/merge-queue.js +1 -1
  47. package/lib/github/mergify.js +1 -1
  48. package/lib/github/pr-template.js +1 -1
  49. package/lib/github/pull-request-backport.js +1 -1
  50. package/lib/github/pull-request-lint.js +1 -1
  51. package/lib/github/stale.js +1 -1
  52. package/lib/github/task-workflow-job.js +1 -1
  53. package/lib/github/task-workflow.js +1 -1
  54. package/lib/github/workflow-actions.js +1 -1
  55. package/lib/github/workflow-jobs.js +1 -1
  56. package/lib/github/workflow-steps.js +1 -1
  57. package/lib/github/workflows.js +1 -1
  58. package/lib/gitlab/configuration.js +1 -1
  59. package/lib/gitlab/gitlab-configuration.js +1 -1
  60. package/lib/gitlab/nested-configuration.js +1 -1
  61. package/lib/gitpod.js +1 -1
  62. package/lib/ignore-file.js +1 -1
  63. package/lib/ini.js +1 -1
  64. package/lib/java/java-project.js +1 -1
  65. package/lib/java/junit.js +1 -1
  66. package/lib/java/maven-compile.js +1 -1
  67. package/lib/java/maven-packaging.js +1 -1
  68. package/lib/java/maven-sample.js +1 -1
  69. package/lib/java/pom.js +2 -2
  70. package/lib/java/projenrc.js +1 -1
  71. package/lib/javascript/bundler.js +1 -1
  72. package/lib/javascript/eslint.js +1 -1
  73. package/lib/javascript/jest.js +4 -4
  74. package/lib/javascript/license-checker.js +1 -1
  75. package/lib/javascript/node-package.js +1 -1
  76. package/lib/javascript/node-project.js +1 -1
  77. package/lib/javascript/npm-config.js +1 -1
  78. package/lib/javascript/prettier.js +1 -1
  79. package/lib/javascript/projenrc.js +1 -1
  80. package/lib/javascript/typescript-config.js +2 -2
  81. package/lib/javascript/upgrade-dependencies.js +2 -2
  82. package/lib/javascript/yarnrc.js +1 -1
  83. package/lib/json-patch.js +1 -1
  84. package/lib/json.js +1 -1
  85. package/lib/license.js +1 -1
  86. package/lib/logger.js +1 -1
  87. package/lib/makefile.js +1 -1
  88. package/lib/object-file.js +1 -1
  89. package/lib/project-build.js +1 -1
  90. package/lib/project-tree.js +1 -1
  91. package/lib/project.js +1 -1
  92. package/lib/projects.js +1 -1
  93. package/lib/projenrc-json.js +2 -2
  94. package/lib/projenrc.js +1 -1
  95. package/lib/python/pip.js +1 -1
  96. package/lib/python/poetry.js +2 -2
  97. package/lib/python/projenrc.js +1 -1
  98. package/lib/python/pytest-sample.js +1 -1
  99. package/lib/python/pytest.js +1 -1
  100. package/lib/python/python-project.js +1 -1
  101. package/lib/python/python-sample.js +1 -1
  102. package/lib/python/requirements-file.js +1 -1
  103. package/lib/python/setuppy.js +1 -1
  104. package/lib/python/setuptools.js +1 -1
  105. package/lib/python/venv.js +1 -1
  106. package/lib/readme.js +1 -1
  107. package/lib/release/publisher.js +1 -1
  108. package/lib/release/release-trigger.js +1 -1
  109. package/lib/release/release.js +1 -1
  110. package/lib/renovatebot.js +1 -1
  111. package/lib/sample-file.js +2 -2
  112. package/lib/semver.js +1 -1
  113. package/lib/source-code.js +1 -1
  114. package/lib/task-runtime.js +1 -1
  115. package/lib/task.js +1 -1
  116. package/lib/tasks.js +1 -1
  117. package/lib/testing.js +1 -1
  118. package/lib/textfile.js +1 -1
  119. package/lib/toml.js +1 -1
  120. package/lib/typescript/projenrc-ts.js +1 -1
  121. package/lib/typescript/projenrc.js +1 -1
  122. package/lib/typescript/typescript-typedoc.js +1 -1
  123. package/lib/typescript/typescript.js +6 -6
  124. package/lib/version.js +2 -2
  125. package/lib/vscode/devcontainer.js +1 -1
  126. package/lib/vscode/extensions.js +1 -1
  127. package/lib/vscode/launch-config.js +1 -1
  128. package/lib/vscode/settings.js +1 -1
  129. package/lib/vscode/vscode.js +1 -1
  130. package/lib/web/next.js +3 -3
  131. package/lib/web/postcss.js +1 -1
  132. package/lib/web/react.js +4 -4
  133. package/lib/web/tailwind.js +1 -1
  134. package/lib/xmlfile.js +1 -1
  135. package/lib/yaml.js +1 -1
  136. package/node_modules/{minimatch/node_modules/brace-expansion → @nodelib/fs.scandir}/LICENSE +2 -2
  137. package/node_modules/@nodelib/fs.scandir/README.md +171 -0
  138. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  139. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
  140. package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
  141. package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
  142. package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
  143. package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
  144. package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  145. package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
  146. package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
  147. package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
  148. package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
  149. package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
  150. package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  151. package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
  152. package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  153. package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
  154. package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
  155. package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
  156. package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
  157. package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
  158. package/node_modules/@nodelib/fs.scandir/package.json +44 -0
  159. package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
  160. package/node_modules/@nodelib/fs.stat/README.md +126 -0
  161. package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  162. package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
  163. package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
  164. package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
  165. package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  166. package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
  167. package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
  168. package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
  169. package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
  170. package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
  171. package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  172. package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
  173. package/node_modules/@nodelib/fs.stat/package.json +37 -0
  174. package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
  175. package/node_modules/@nodelib/fs.walk/README.md +215 -0
  176. package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
  177. package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
  178. package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  179. package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
  180. package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
  181. package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
  182. package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
  183. package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
  184. package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
  185. package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
  186. package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  187. package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
  188. package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
  189. package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
  190. package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  191. package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
  192. package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
  193. package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
  194. package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
  195. package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
  196. package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  197. package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
  198. package/node_modules/@nodelib/fs.walk/package.json +44 -0
  199. package/node_modules/braces/LICENSE +21 -0
  200. package/node_modules/braces/README.md +586 -0
  201. package/node_modules/braces/index.js +170 -0
  202. package/node_modules/braces/lib/compile.js +60 -0
  203. package/node_modules/braces/lib/constants.js +57 -0
  204. package/node_modules/braces/lib/expand.js +113 -0
  205. package/node_modules/braces/lib/parse.js +331 -0
  206. package/node_modules/braces/lib/stringify.js +32 -0
  207. package/node_modules/braces/lib/utils.js +122 -0
  208. package/node_modules/braces/package.json +77 -0
  209. package/node_modules/end-of-stream/LICENSE +21 -0
  210. package/node_modules/end-of-stream/README.md +54 -0
  211. package/node_modules/end-of-stream/index.js +94 -0
  212. package/node_modules/end-of-stream/package.json +37 -0
  213. package/node_modules/execa/index.js +361 -0
  214. package/node_modules/execa/lib/errname.js +39 -0
  215. package/node_modules/execa/lib/stdio.js +41 -0
  216. package/node_modules/execa/license +9 -0
  217. package/node_modules/execa/node_modules/cross-spawn/LICENSE +21 -0
  218. package/node_modules/execa/node_modules/cross-spawn/README.md +94 -0
  219. package/node_modules/execa/node_modules/cross-spawn/index.js +39 -0
  220. package/node_modules/execa/node_modules/cross-spawn/lib/enoent.js +59 -0
  221. package/node_modules/execa/node_modules/cross-spawn/lib/parse.js +125 -0
  222. package/node_modules/execa/node_modules/cross-spawn/lib/util/escape.js +47 -0
  223. package/node_modules/execa/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
  224. package/node_modules/execa/node_modules/cross-spawn/lib/util/resolveCommand.js +51 -0
  225. package/node_modules/execa/node_modules/cross-spawn/package.json +75 -0
  226. package/node_modules/execa/node_modules/semver/README.md +412 -0
  227. package/node_modules/execa/node_modules/semver/bin/semver +160 -0
  228. package/node_modules/execa/node_modules/semver/package.json +38 -0
  229. package/node_modules/execa/node_modules/semver/range.bnf +16 -0
  230. package/node_modules/execa/node_modules/semver/semver.js +1525 -0
  231. package/node_modules/execa/node_modules/shebang-command/index.js +19 -0
  232. package/node_modules/execa/node_modules/shebang-command/license +21 -0
  233. package/node_modules/execa/node_modules/shebang-command/package.json +39 -0
  234. package/node_modules/execa/node_modules/shebang-command/readme.md +39 -0
  235. package/node_modules/execa/node_modules/shebang-regex/index.js +2 -0
  236. package/node_modules/execa/node_modules/shebang-regex/package.json +32 -0
  237. package/node_modules/execa/node_modules/shebang-regex/readme.md +29 -0
  238. package/node_modules/{shelljs/node_modules/glob → execa/node_modules/which}/LICENSE +0 -6
  239. package/node_modules/execa/node_modules/which/README.md +51 -0
  240. package/node_modules/execa/node_modules/which/bin/which +52 -0
  241. package/node_modules/execa/node_modules/which/package.json +30 -0
  242. package/node_modules/execa/node_modules/which/which.js +135 -0
  243. package/node_modules/execa/package.json +69 -0
  244. package/node_modules/execa/readme.md +327 -0
  245. package/node_modules/fast-glob/LICENSE +21 -0
  246. package/node_modules/fast-glob/README.md +830 -0
  247. package/node_modules/fast-glob/node_modules/glob-parent/LICENSE +15 -0
  248. package/node_modules/fast-glob/node_modules/glob-parent/README.md +137 -0
  249. package/node_modules/fast-glob/node_modules/glob-parent/index.js +42 -0
  250. package/node_modules/fast-glob/node_modules/glob-parent/package.json +48 -0
  251. package/node_modules/fast-glob/out/index.d.ts +40 -0
  252. package/node_modules/fast-glob/out/index.js +102 -0
  253. package/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
  254. package/node_modules/fast-glob/out/managers/tasks.js +110 -0
  255. package/node_modules/fast-glob/out/providers/async.d.ts +9 -0
  256. package/node_modules/fast-glob/out/providers/async.js +23 -0
  257. package/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
  258. package/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
  259. package/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
  260. package/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
  261. package/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
  262. package/node_modules/fast-glob/out/providers/filters/error.js +15 -0
  263. package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
  264. package/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
  265. package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
  266. package/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
  267. package/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
  268. package/node_modules/fast-glob/out/providers/provider.js +48 -0
  269. package/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
  270. package/node_modules/fast-glob/out/providers/stream.js +31 -0
  271. package/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
  272. package/node_modules/fast-glob/out/providers/sync.js +23 -0
  273. package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
  274. package/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
  275. package/node_modules/fast-glob/out/readers/async.d.ts +10 -0
  276. package/node_modules/fast-glob/out/readers/async.js +35 -0
  277. package/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
  278. package/node_modules/fast-glob/out/readers/reader.js +33 -0
  279. package/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
  280. package/node_modules/fast-glob/out/readers/stream.js +55 -0
  281. package/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
  282. package/node_modules/fast-glob/out/readers/sync.js +43 -0
  283. package/node_modules/fast-glob/out/settings.d.ts +164 -0
  284. package/node_modules/fast-glob/out/settings.js +59 -0
  285. package/node_modules/fast-glob/out/types/index.d.ts +31 -0
  286. package/node_modules/fast-glob/out/types/index.js +2 -0
  287. package/node_modules/fast-glob/out/utils/array.d.ts +2 -0
  288. package/node_modules/fast-glob/out/utils/array.js +22 -0
  289. package/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
  290. package/node_modules/fast-glob/out/utils/errno.js +7 -0
  291. package/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
  292. package/node_modules/fast-glob/out/utils/fs.js +19 -0
  293. package/node_modules/fast-glob/out/utils/index.d.ts +8 -0
  294. package/node_modules/fast-glob/out/utils/index.js +17 -0
  295. package/node_modules/fast-glob/out/utils/path.d.ts +13 -0
  296. package/node_modules/fast-glob/out/utils/path.js +68 -0
  297. package/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
  298. package/node_modules/fast-glob/out/utils/pattern.js +206 -0
  299. package/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
  300. package/node_modules/fast-glob/out/utils/stream.js +17 -0
  301. package/node_modules/fast-glob/out/utils/string.d.ts +2 -0
  302. package/node_modules/fast-glob/out/utils/string.js +11 -0
  303. package/node_modules/fast-glob/package.json +81 -0
  304. package/node_modules/fastq/.github/dependabot.yml +11 -0
  305. package/node_modules/fastq/.github/workflows/ci.yml +75 -0
  306. package/node_modules/fastq/LICENSE +13 -0
  307. package/node_modules/fastq/README.md +312 -0
  308. package/node_modules/fastq/SECURITY.md +15 -0
  309. package/node_modules/fastq/bench.js +66 -0
  310. package/node_modules/fastq/example.js +14 -0
  311. package/node_modules/fastq/example.mjs +11 -0
  312. package/node_modules/fastq/index.d.ts +57 -0
  313. package/node_modules/fastq/package.json +53 -0
  314. package/node_modules/fastq/queue.js +311 -0
  315. package/node_modules/fastq/test/example.ts +83 -0
  316. package/node_modules/fastq/test/promise.js +291 -0
  317. package/node_modules/fastq/test/test.js +653 -0
  318. package/node_modules/fastq/test/tsconfig.json +11 -0
  319. package/node_modules/fill-range/LICENSE +21 -0
  320. package/node_modules/fill-range/README.md +237 -0
  321. package/node_modules/fill-range/index.js +248 -0
  322. package/node_modules/fill-range/package.json +74 -0
  323. package/node_modules/get-stream/buffer-stream.js +51 -0
  324. package/node_modules/get-stream/index.js +50 -0
  325. package/node_modules/get-stream/license +9 -0
  326. package/node_modules/get-stream/package.json +46 -0
  327. package/node_modules/get-stream/readme.md +123 -0
  328. package/node_modules/is-extglob/LICENSE +21 -0
  329. package/node_modules/is-extglob/README.md +107 -0
  330. package/node_modules/is-extglob/index.js +20 -0
  331. package/node_modules/is-extglob/package.json +69 -0
  332. package/node_modules/is-glob/LICENSE +21 -0
  333. package/node_modules/is-glob/README.md +206 -0
  334. package/node_modules/is-glob/index.js +150 -0
  335. package/node_modules/is-glob/package.json +81 -0
  336. package/node_modules/is-number/LICENSE +21 -0
  337. package/node_modules/is-number/README.md +187 -0
  338. package/node_modules/is-number/index.js +18 -0
  339. package/node_modules/is-number/package.json +82 -0
  340. package/node_modules/is-stream/index.js +21 -0
  341. package/node_modules/is-stream/license +21 -0
  342. package/node_modules/is-stream/package.json +38 -0
  343. package/node_modules/is-stream/readme.md +42 -0
  344. package/node_modules/isexe/.npmignore +2 -0
  345. package/node_modules/isexe/LICENSE +15 -0
  346. package/node_modules/isexe/README.md +51 -0
  347. package/node_modules/isexe/index.js +57 -0
  348. package/node_modules/isexe/mode.js +41 -0
  349. package/node_modules/isexe/package.json +31 -0
  350. package/node_modules/isexe/test/basic.js +221 -0
  351. package/node_modules/isexe/windows.js +42 -0
  352. package/node_modules/merge2/LICENSE +21 -0
  353. package/node_modules/merge2/README.md +144 -0
  354. package/node_modules/merge2/index.js +144 -0
  355. package/node_modules/merge2/package.json +43 -0
  356. package/node_modules/micromatch/LICENSE +21 -0
  357. package/node_modules/micromatch/README.md +1024 -0
  358. package/node_modules/micromatch/index.js +474 -0
  359. package/node_modules/micromatch/package.json +119 -0
  360. package/node_modules/nice-try/LICENSE +21 -0
  361. package/node_modules/nice-try/README.md +32 -0
  362. package/node_modules/nice-try/package.json +33 -0
  363. package/node_modules/nice-try/src/index.js +12 -0
  364. package/node_modules/npm-run-path/index.js +39 -0
  365. package/node_modules/npm-run-path/license +21 -0
  366. package/node_modules/npm-run-path/package.json +45 -0
  367. package/node_modules/npm-run-path/readme.md +81 -0
  368. package/node_modules/p-finally/index.js +15 -0
  369. package/node_modules/p-finally/license +21 -0
  370. package/node_modules/p-finally/package.json +42 -0
  371. package/node_modules/p-finally/readme.md +47 -0
  372. package/node_modules/path-key/index.js +13 -0
  373. package/node_modules/path-key/license +21 -0
  374. package/node_modules/path-key/package.json +39 -0
  375. package/node_modules/path-key/readme.md +51 -0
  376. package/node_modules/picomatch/LICENSE +21 -0
  377. package/node_modules/picomatch/README.md +708 -0
  378. package/node_modules/picomatch/index.js +3 -0
  379. package/node_modules/picomatch/lib/constants.js +179 -0
  380. package/node_modules/picomatch/lib/parse.js +1091 -0
  381. package/node_modules/picomatch/lib/picomatch.js +342 -0
  382. package/node_modules/picomatch/lib/scan.js +391 -0
  383. package/node_modules/picomatch/lib/utils.js +64 -0
  384. package/node_modules/picomatch/package.json +81 -0
  385. package/node_modules/pump/.github/FUNDING.yml +2 -0
  386. package/node_modules/pump/.travis.yml +5 -0
  387. package/node_modules/pump/LICENSE +21 -0
  388. package/node_modules/pump/README.md +74 -0
  389. package/node_modules/pump/SECURITY.md +5 -0
  390. package/node_modules/pump/index.js +86 -0
  391. package/node_modules/pump/package.json +24 -0
  392. package/node_modules/pump/test-browser.js +66 -0
  393. package/node_modules/pump/test-node.js +53 -0
  394. package/node_modules/{concat-map → queue-microtask}/LICENSE +3 -1
  395. package/node_modules/queue-microtask/README.md +90 -0
  396. package/node_modules/queue-microtask/index.d.ts +2 -0
  397. package/node_modules/queue-microtask/index.js +9 -0
  398. package/node_modules/queue-microtask/package.json +55 -0
  399. package/node_modules/reusify/.github/dependabot.yml +7 -0
  400. package/node_modules/reusify/.github/workflows/ci.yml +96 -0
  401. package/node_modules/reusify/LICENSE +22 -0
  402. package/node_modules/reusify/README.md +139 -0
  403. package/node_modules/reusify/SECURITY.md +15 -0
  404. package/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
  405. package/node_modules/reusify/benchmarks/fib.js +13 -0
  406. package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
  407. package/node_modules/reusify/eslint.config.js +14 -0
  408. package/node_modules/reusify/package.json +50 -0
  409. package/node_modules/reusify/reusify.d.ts +14 -0
  410. package/node_modules/reusify/reusify.js +33 -0
  411. package/node_modules/reusify/test.js +66 -0
  412. package/node_modules/reusify/tsconfig.json +11 -0
  413. package/node_modules/run-parallel/LICENSE +20 -0
  414. package/node_modules/run-parallel/README.md +85 -0
  415. package/node_modules/run-parallel/index.js +51 -0
  416. package/node_modules/run-parallel/package.json +58 -0
  417. package/node_modules/shelljs/LICENSE +23 -20
  418. package/node_modules/shelljs/README.md +173 -65
  419. package/node_modules/shelljs/package.json +38 -22
  420. package/node_modules/shelljs/plugin.js +1 -1
  421. package/node_modules/shelljs/shell.js +70 -12
  422. package/node_modules/shelljs/src/cat.js +3 -3
  423. package/node_modules/shelljs/src/cd.js +2 -1
  424. package/node_modules/shelljs/src/chmod.js +17 -11
  425. package/node_modules/shelljs/src/cmd.js +122 -0
  426. package/node_modules/shelljs/src/common.js +103 -29
  427. package/node_modules/shelljs/src/cp.js +24 -14
  428. package/node_modules/shelljs/src/dirs.js +7 -9
  429. package/node_modules/shelljs/src/echo.js +1 -2
  430. package/node_modules/shelljs/src/errorCode.js +10 -0
  431. package/node_modules/shelljs/src/exec-child.js +60 -28
  432. package/node_modules/shelljs/src/exec.js +39 -10
  433. package/node_modules/shelljs/src/find.js +8 -3
  434. package/node_modules/shelljs/src/grep.js +15 -4
  435. package/node_modules/shelljs/src/head.js +1 -1
  436. package/node_modules/shelljs/src/ln.js +3 -1
  437. package/node_modules/shelljs/src/ls.js +29 -15
  438. package/node_modules/shelljs/src/mkdir.js +13 -11
  439. package/node_modules/shelljs/src/mv.js +4 -3
  440. package/node_modules/shelljs/src/pwd.js +1 -1
  441. package/node_modules/shelljs/src/rm.js +11 -11
  442. package/node_modules/shelljs/src/sed.js +12 -4
  443. package/node_modules/shelljs/src/set.js +0 -1
  444. package/node_modules/shelljs/src/sort.js +3 -2
  445. package/node_modules/shelljs/src/tail.js +12 -2
  446. package/node_modules/shelljs/src/test.js +3 -2
  447. package/node_modules/shelljs/src/to.js +2 -1
  448. package/node_modules/shelljs/src/toEnd.js +2 -1
  449. package/node_modules/shelljs/src/touch.js +13 -7
  450. package/node_modules/shelljs/src/uniq.js +5 -4
  451. package/node_modules/shelljs/src/which.js +5 -4
  452. package/node_modules/shx/README.md +27 -15
  453. package/node_modules/shx/lib/help.js +1 -1
  454. package/node_modules/shx/lib/shx.js +13 -8
  455. package/node_modules/shx/package.json +17 -25
  456. package/node_modules/signal-exit/LICENSE.txt +16 -0
  457. package/node_modules/signal-exit/README.md +39 -0
  458. package/node_modules/signal-exit/index.js +202 -0
  459. package/node_modules/signal-exit/package.json +38 -0
  460. package/node_modules/signal-exit/signals.js +53 -0
  461. package/node_modules/strip-eof/index.js +15 -0
  462. package/node_modules/strip-eof/license +21 -0
  463. package/node_modules/strip-eof/package.json +39 -0
  464. package/node_modules/strip-eof/readme.md +28 -0
  465. package/node_modules/to-regex-range/LICENSE +21 -0
  466. package/node_modules/to-regex-range/README.md +305 -0
  467. package/node_modules/to-regex-range/index.js +288 -0
  468. package/node_modules/to-regex-range/package.json +88 -0
  469. package/package.json +2 -2
  470. package/node_modules/concat-map/.travis.yml +0 -4
  471. package/node_modules/concat-map/README.markdown +0 -62
  472. package/node_modules/concat-map/example/map.js +0 -6
  473. package/node_modules/concat-map/index.js +0 -13
  474. package/node_modules/concat-map/package.json +0 -43
  475. package/node_modules/concat-map/test/map.js +0 -39
  476. package/node_modules/minimatch/README.md +0 -230
  477. package/node_modules/minimatch/minimatch.js +0 -947
  478. package/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
  479. package/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
  480. package/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
  481. package/node_modules/minimatch/package.json +0 -33
  482. package/node_modules/path-is-absolute/index.js +0 -20
  483. package/node_modules/path-is-absolute/package.json +0 -43
  484. package/node_modules/path-is-absolute/readme.md +0 -59
  485. package/node_modules/shelljs/commands.js +0 -29
  486. package/node_modules/shelljs/node_modules/glob/README.md +0 -378
  487. package/node_modules/shelljs/node_modules/glob/common.js +0 -238
  488. package/node_modules/shelljs/node_modules/glob/glob.js +0 -790
  489. package/node_modules/shelljs/node_modules/glob/package.json +0 -55
  490. package/node_modules/shelljs/node_modules/glob/sync.js +0 -486
  491. /package/node_modules/{minimatch → execa/node_modules/semver}/LICENSE +0 -0
  492. /package/node_modules/{path-is-absolute → execa/node_modules/shebang-regex}/license +0 -0
@@ -0,0 +1,1525 @@
1
+ exports = module.exports = SemVer
2
+
3
+ var debug
4
+ /* istanbul ignore next */
5
+ if (typeof process === 'object' &&
6
+ process.env &&
7
+ process.env.NODE_DEBUG &&
8
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
9
+ debug = function () {
10
+ var args = Array.prototype.slice.call(arguments, 0)
11
+ args.unshift('SEMVER')
12
+ console.log.apply(console, args)
13
+ }
14
+ } else {
15
+ debug = function () {}
16
+ }
17
+
18
+ // Note: this is the semver.org version of the spec that it implements
19
+ // Not necessarily the package version of this code.
20
+ exports.SEMVER_SPEC_VERSION = '2.0.0'
21
+
22
+ var MAX_LENGTH = 256
23
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
24
+ /* istanbul ignore next */ 9007199254740991
25
+
26
+ // Max safe segment length for coercion.
27
+ var MAX_SAFE_COMPONENT_LENGTH = 16
28
+
29
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
30
+
31
+ // The actual regexps go on exports.re
32
+ var re = exports.re = []
33
+ var safeRe = exports.safeRe = []
34
+ var src = exports.src = []
35
+ var R = 0
36
+
37
+ var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
38
+
39
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
40
+ // used internally via the safeRe object since all inputs in this library get
41
+ // normalized first to trim and collapse all extra whitespace. The original
42
+ // regexes are exported for userland consumption and lower level usage. A
43
+ // future breaking change could export the safer regex only with a note that
44
+ // all input should have extra whitespace removed.
45
+ var safeRegexReplacements = [
46
+ ['\\s', 1],
47
+ ['\\d', MAX_LENGTH],
48
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
49
+ ]
50
+
51
+ function makeSafeRe (value) {
52
+ for (var i = 0; i < safeRegexReplacements.length; i++) {
53
+ var token = safeRegexReplacements[i][0]
54
+ var max = safeRegexReplacements[i][1]
55
+ value = value
56
+ .split(token + '*').join(token + '{0,' + max + '}')
57
+ .split(token + '+').join(token + '{1,' + max + '}')
58
+ }
59
+ return value
60
+ }
61
+
62
+ // The following Regular Expressions can be used for tokenizing,
63
+ // validating, and parsing SemVer version strings.
64
+
65
+ // ## Numeric Identifier
66
+ // A single `0`, or a non-zero digit followed by zero or more digits.
67
+
68
+ var NUMERICIDENTIFIER = R++
69
+ src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
70
+ var NUMERICIDENTIFIERLOOSE = R++
71
+ src[NUMERICIDENTIFIERLOOSE] = '\\d+'
72
+
73
+ // ## Non-numeric Identifier
74
+ // Zero or more digits, followed by a letter or hyphen, and then zero or
75
+ // more letters, digits, or hyphens.
76
+
77
+ var NONNUMERICIDENTIFIER = R++
78
+ src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
79
+
80
+ // ## Main Version
81
+ // Three dot-separated numeric identifiers.
82
+
83
+ var MAINVERSION = R++
84
+ src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
85
+ '(' + src[NUMERICIDENTIFIER] + ')\\.' +
86
+ '(' + src[NUMERICIDENTIFIER] + ')'
87
+
88
+ var MAINVERSIONLOOSE = R++
89
+ src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
90
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
91
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
92
+
93
+ // ## Pre-release Version Identifier
94
+ // A numeric identifier, or a non-numeric identifier.
95
+
96
+ var PRERELEASEIDENTIFIER = R++
97
+ src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
98
+ '|' + src[NONNUMERICIDENTIFIER] + ')'
99
+
100
+ var PRERELEASEIDENTIFIERLOOSE = R++
101
+ src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
102
+ '|' + src[NONNUMERICIDENTIFIER] + ')'
103
+
104
+ // ## Pre-release Version
105
+ // Hyphen, followed by one or more dot-separated pre-release version
106
+ // identifiers.
107
+
108
+ var PRERELEASE = R++
109
+ src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
110
+ '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
111
+
112
+ var PRERELEASELOOSE = R++
113
+ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
114
+ '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
115
+
116
+ // ## Build Metadata Identifier
117
+ // Any combination of digits, letters, or hyphens.
118
+
119
+ var BUILDIDENTIFIER = R++
120
+ src[BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
121
+
122
+ // ## Build Metadata
123
+ // Plus sign, followed by one or more period-separated build metadata
124
+ // identifiers.
125
+
126
+ var BUILD = R++
127
+ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
128
+ '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
129
+
130
+ // ## Full Version String
131
+ // A main version, followed optionally by a pre-release version and
132
+ // build metadata.
133
+
134
+ // Note that the only major, minor, patch, and pre-release sections of
135
+ // the version string are capturing groups. The build metadata is not a
136
+ // capturing group, because it should not ever be used in version
137
+ // comparison.
138
+
139
+ var FULL = R++
140
+ var FULLPLAIN = 'v?' + src[MAINVERSION] +
141
+ src[PRERELEASE] + '?' +
142
+ src[BUILD] + '?'
143
+
144
+ src[FULL] = '^' + FULLPLAIN + '$'
145
+
146
+ // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
147
+ // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
148
+ // common in the npm registry.
149
+ var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
150
+ src[PRERELEASELOOSE] + '?' +
151
+ src[BUILD] + '?'
152
+
153
+ var LOOSE = R++
154
+ src[LOOSE] = '^' + LOOSEPLAIN + '$'
155
+
156
+ var GTLT = R++
157
+ src[GTLT] = '((?:<|>)?=?)'
158
+
159
+ // Something like "2.*" or "1.2.x".
160
+ // Note that "x.x" is a valid xRange identifer, meaning "any version"
161
+ // Only the first item is strictly required.
162
+ var XRANGEIDENTIFIERLOOSE = R++
163
+ src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
164
+ var XRANGEIDENTIFIER = R++
165
+ src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
166
+
167
+ var XRANGEPLAIN = R++
168
+ src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
169
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
170
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
171
+ '(?:' + src[PRERELEASE] + ')?' +
172
+ src[BUILD] + '?' +
173
+ ')?)?'
174
+
175
+ var XRANGEPLAINLOOSE = R++
176
+ src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
177
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
178
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
179
+ '(?:' + src[PRERELEASELOOSE] + ')?' +
180
+ src[BUILD] + '?' +
181
+ ')?)?'
182
+
183
+ var XRANGE = R++
184
+ src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
185
+ var XRANGELOOSE = R++
186
+ src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
187
+
188
+ // Coercion.
189
+ // Extract anything that could conceivably be a part of a valid semver
190
+ var COERCE = R++
191
+ src[COERCE] = '(?:^|[^\\d])' +
192
+ '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
193
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
194
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
195
+ '(?:$|[^\\d])'
196
+
197
+ // Tilde ranges.
198
+ // Meaning is "reasonably at or greater than"
199
+ var LONETILDE = R++
200
+ src[LONETILDE] = '(?:~>?)'
201
+
202
+ var TILDETRIM = R++
203
+ src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
204
+ re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
205
+ safeRe[TILDETRIM] = new RegExp(makeSafeRe(src[TILDETRIM]), 'g')
206
+ var tildeTrimReplace = '$1~'
207
+
208
+ var TILDE = R++
209
+ src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
210
+ var TILDELOOSE = R++
211
+ src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
212
+
213
+ // Caret ranges.
214
+ // Meaning is "at least and backwards compatible with"
215
+ var LONECARET = R++
216
+ src[LONECARET] = '(?:\\^)'
217
+
218
+ var CARETTRIM = R++
219
+ src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
220
+ re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
221
+ safeRe[CARETTRIM] = new RegExp(makeSafeRe(src[CARETTRIM]), 'g')
222
+ var caretTrimReplace = '$1^'
223
+
224
+ var CARET = R++
225
+ src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
226
+ var CARETLOOSE = R++
227
+ src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
228
+
229
+ // A simple gt/lt/eq thing, or just "" to indicate "any version"
230
+ var COMPARATORLOOSE = R++
231
+ src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
232
+ var COMPARATOR = R++
233
+ src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
234
+
235
+ // An expression to strip any whitespace between the gtlt and the thing
236
+ // it modifies, so that `> 1.2.3` ==> `>1.2.3`
237
+ var COMPARATORTRIM = R++
238
+ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
239
+ '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
240
+
241
+ // this one has to use the /g flag
242
+ re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
243
+ safeRe[COMPARATORTRIM] = new RegExp(makeSafeRe(src[COMPARATORTRIM]), 'g')
244
+ var comparatorTrimReplace = '$1$2$3'
245
+
246
+ // Something like `1.2.3 - 1.2.4`
247
+ // Note that these all use the loose form, because they'll be
248
+ // checked against either the strict or loose comparator form
249
+ // later.
250
+ var HYPHENRANGE = R++
251
+ src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
252
+ '\\s+-\\s+' +
253
+ '(' + src[XRANGEPLAIN] + ')' +
254
+ '\\s*$'
255
+
256
+ var HYPHENRANGELOOSE = R++
257
+ src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
258
+ '\\s+-\\s+' +
259
+ '(' + src[XRANGEPLAINLOOSE] + ')' +
260
+ '\\s*$'
261
+
262
+ // Star ranges basically just allow anything at all.
263
+ var STAR = R++
264
+ src[STAR] = '(<|>)?=?\\s*\\*'
265
+
266
+ // Compile to actual regexp objects.
267
+ // All are flag-free, unless they were created above with a flag.
268
+ for (var i = 0; i < R; i++) {
269
+ debug(i, src[i])
270
+ if (!re[i]) {
271
+ re[i] = new RegExp(src[i])
272
+
273
+ // Replace all greedy whitespace to prevent regex dos issues. These regex are
274
+ // used internally via the safeRe object since all inputs in this library get
275
+ // normalized first to trim and collapse all extra whitespace. The original
276
+ // regexes are exported for userland consumption and lower level usage. A
277
+ // future breaking change could export the safer regex only with a note that
278
+ // all input should have extra whitespace removed.
279
+ safeRe[i] = new RegExp(makeSafeRe(src[i]))
280
+ }
281
+ }
282
+
283
+ exports.parse = parse
284
+ function parse (version, options) {
285
+ if (!options || typeof options !== 'object') {
286
+ options = {
287
+ loose: !!options,
288
+ includePrerelease: false
289
+ }
290
+ }
291
+
292
+ if (version instanceof SemVer) {
293
+ return version
294
+ }
295
+
296
+ if (typeof version !== 'string') {
297
+ return null
298
+ }
299
+
300
+ if (version.length > MAX_LENGTH) {
301
+ return null
302
+ }
303
+
304
+ var r = options.loose ? safeRe[LOOSE] : safeRe[FULL]
305
+ if (!r.test(version)) {
306
+ return null
307
+ }
308
+
309
+ try {
310
+ return new SemVer(version, options)
311
+ } catch (er) {
312
+ return null
313
+ }
314
+ }
315
+
316
+ exports.valid = valid
317
+ function valid (version, options) {
318
+ var v = parse(version, options)
319
+ return v ? v.version : null
320
+ }
321
+
322
+ exports.clean = clean
323
+ function clean (version, options) {
324
+ var s = parse(version.trim().replace(/^[=v]+/, ''), options)
325
+ return s ? s.version : null
326
+ }
327
+
328
+ exports.SemVer = SemVer
329
+
330
+ function SemVer (version, options) {
331
+ if (!options || typeof options !== 'object') {
332
+ options = {
333
+ loose: !!options,
334
+ includePrerelease: false
335
+ }
336
+ }
337
+ if (version instanceof SemVer) {
338
+ if (version.loose === options.loose) {
339
+ return version
340
+ } else {
341
+ version = version.version
342
+ }
343
+ } else if (typeof version !== 'string') {
344
+ throw new TypeError('Invalid Version: ' + version)
345
+ }
346
+
347
+ if (version.length > MAX_LENGTH) {
348
+ throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
349
+ }
350
+
351
+ if (!(this instanceof SemVer)) {
352
+ return new SemVer(version, options)
353
+ }
354
+
355
+ debug('SemVer', version, options)
356
+ this.options = options
357
+ this.loose = !!options.loose
358
+
359
+ var m = version.trim().match(options.loose ? safeRe[LOOSE] : safeRe[FULL])
360
+
361
+ if (!m) {
362
+ throw new TypeError('Invalid Version: ' + version)
363
+ }
364
+
365
+ this.raw = version
366
+
367
+ // these are actually numbers
368
+ this.major = +m[1]
369
+ this.minor = +m[2]
370
+ this.patch = +m[3]
371
+
372
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
373
+ throw new TypeError('Invalid major version')
374
+ }
375
+
376
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
377
+ throw new TypeError('Invalid minor version')
378
+ }
379
+
380
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
381
+ throw new TypeError('Invalid patch version')
382
+ }
383
+
384
+ // numberify any prerelease numeric ids
385
+ if (!m[4]) {
386
+ this.prerelease = []
387
+ } else {
388
+ this.prerelease = m[4].split('.').map(function (id) {
389
+ if (/^[0-9]+$/.test(id)) {
390
+ var num = +id
391
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
392
+ return num
393
+ }
394
+ }
395
+ return id
396
+ })
397
+ }
398
+
399
+ this.build = m[5] ? m[5].split('.') : []
400
+ this.format()
401
+ }
402
+
403
+ SemVer.prototype.format = function () {
404
+ this.version = this.major + '.' + this.minor + '.' + this.patch
405
+ if (this.prerelease.length) {
406
+ this.version += '-' + this.prerelease.join('.')
407
+ }
408
+ return this.version
409
+ }
410
+
411
+ SemVer.prototype.toString = function () {
412
+ return this.version
413
+ }
414
+
415
+ SemVer.prototype.compare = function (other) {
416
+ debug('SemVer.compare', this.version, this.options, other)
417
+ if (!(other instanceof SemVer)) {
418
+ other = new SemVer(other, this.options)
419
+ }
420
+
421
+ return this.compareMain(other) || this.comparePre(other)
422
+ }
423
+
424
+ SemVer.prototype.compareMain = function (other) {
425
+ if (!(other instanceof SemVer)) {
426
+ other = new SemVer(other, this.options)
427
+ }
428
+
429
+ return compareIdentifiers(this.major, other.major) ||
430
+ compareIdentifiers(this.minor, other.minor) ||
431
+ compareIdentifiers(this.patch, other.patch)
432
+ }
433
+
434
+ SemVer.prototype.comparePre = function (other) {
435
+ if (!(other instanceof SemVer)) {
436
+ other = new SemVer(other, this.options)
437
+ }
438
+
439
+ // NOT having a prerelease is > having one
440
+ if (this.prerelease.length && !other.prerelease.length) {
441
+ return -1
442
+ } else if (!this.prerelease.length && other.prerelease.length) {
443
+ return 1
444
+ } else if (!this.prerelease.length && !other.prerelease.length) {
445
+ return 0
446
+ }
447
+
448
+ var i = 0
449
+ do {
450
+ var a = this.prerelease[i]
451
+ var b = other.prerelease[i]
452
+ debug('prerelease compare', i, a, b)
453
+ if (a === undefined && b === undefined) {
454
+ return 0
455
+ } else if (b === undefined) {
456
+ return 1
457
+ } else if (a === undefined) {
458
+ return -1
459
+ } else if (a === b) {
460
+ continue
461
+ } else {
462
+ return compareIdentifiers(a, b)
463
+ }
464
+ } while (++i)
465
+ }
466
+
467
+ // preminor will bump the version up to the next minor release, and immediately
468
+ // down to pre-release. premajor and prepatch work the same way.
469
+ SemVer.prototype.inc = function (release, identifier) {
470
+ switch (release) {
471
+ case 'premajor':
472
+ this.prerelease.length = 0
473
+ this.patch = 0
474
+ this.minor = 0
475
+ this.major++
476
+ this.inc('pre', identifier)
477
+ break
478
+ case 'preminor':
479
+ this.prerelease.length = 0
480
+ this.patch = 0
481
+ this.minor++
482
+ this.inc('pre', identifier)
483
+ break
484
+ case 'prepatch':
485
+ // If this is already a prerelease, it will bump to the next version
486
+ // drop any prereleases that might already exist, since they are not
487
+ // relevant at this point.
488
+ this.prerelease.length = 0
489
+ this.inc('patch', identifier)
490
+ this.inc('pre', identifier)
491
+ break
492
+ // If the input is a non-prerelease version, this acts the same as
493
+ // prepatch.
494
+ case 'prerelease':
495
+ if (this.prerelease.length === 0) {
496
+ this.inc('patch', identifier)
497
+ }
498
+ this.inc('pre', identifier)
499
+ break
500
+
501
+ case 'major':
502
+ // If this is a pre-major version, bump up to the same major version.
503
+ // Otherwise increment major.
504
+ // 1.0.0-5 bumps to 1.0.0
505
+ // 1.1.0 bumps to 2.0.0
506
+ if (this.minor !== 0 ||
507
+ this.patch !== 0 ||
508
+ this.prerelease.length === 0) {
509
+ this.major++
510
+ }
511
+ this.minor = 0
512
+ this.patch = 0
513
+ this.prerelease = []
514
+ break
515
+ case 'minor':
516
+ // If this is a pre-minor version, bump up to the same minor version.
517
+ // Otherwise increment minor.
518
+ // 1.2.0-5 bumps to 1.2.0
519
+ // 1.2.1 bumps to 1.3.0
520
+ if (this.patch !== 0 || this.prerelease.length === 0) {
521
+ this.minor++
522
+ }
523
+ this.patch = 0
524
+ this.prerelease = []
525
+ break
526
+ case 'patch':
527
+ // If this is not a pre-release version, it will increment the patch.
528
+ // If it is a pre-release it will bump up to the same patch version.
529
+ // 1.2.0-5 patches to 1.2.0
530
+ // 1.2.0 patches to 1.2.1
531
+ if (this.prerelease.length === 0) {
532
+ this.patch++
533
+ }
534
+ this.prerelease = []
535
+ break
536
+ // This probably shouldn't be used publicly.
537
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
538
+ case 'pre':
539
+ if (this.prerelease.length === 0) {
540
+ this.prerelease = [0]
541
+ } else {
542
+ var i = this.prerelease.length
543
+ while (--i >= 0) {
544
+ if (typeof this.prerelease[i] === 'number') {
545
+ this.prerelease[i]++
546
+ i = -2
547
+ }
548
+ }
549
+ if (i === -1) {
550
+ // didn't increment anything
551
+ this.prerelease.push(0)
552
+ }
553
+ }
554
+ if (identifier) {
555
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
556
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
557
+ if (this.prerelease[0] === identifier) {
558
+ if (isNaN(this.prerelease[1])) {
559
+ this.prerelease = [identifier, 0]
560
+ }
561
+ } else {
562
+ this.prerelease = [identifier, 0]
563
+ }
564
+ }
565
+ break
566
+
567
+ default:
568
+ throw new Error('invalid increment argument: ' + release)
569
+ }
570
+ this.format()
571
+ this.raw = this.version
572
+ return this
573
+ }
574
+
575
+ exports.inc = inc
576
+ function inc (version, release, loose, identifier) {
577
+ if (typeof (loose) === 'string') {
578
+ identifier = loose
579
+ loose = undefined
580
+ }
581
+
582
+ try {
583
+ return new SemVer(version, loose).inc(release, identifier).version
584
+ } catch (er) {
585
+ return null
586
+ }
587
+ }
588
+
589
+ exports.diff = diff
590
+ function diff (version1, version2) {
591
+ if (eq(version1, version2)) {
592
+ return null
593
+ } else {
594
+ var v1 = parse(version1)
595
+ var v2 = parse(version2)
596
+ var prefix = ''
597
+ if (v1.prerelease.length || v2.prerelease.length) {
598
+ prefix = 'pre'
599
+ var defaultResult = 'prerelease'
600
+ }
601
+ for (var key in v1) {
602
+ if (key === 'major' || key === 'minor' || key === 'patch') {
603
+ if (v1[key] !== v2[key]) {
604
+ return prefix + key
605
+ }
606
+ }
607
+ }
608
+ return defaultResult // may be undefined
609
+ }
610
+ }
611
+
612
+ exports.compareIdentifiers = compareIdentifiers
613
+
614
+ var numeric = /^[0-9]+$/
615
+ function compareIdentifiers (a, b) {
616
+ var anum = numeric.test(a)
617
+ var bnum = numeric.test(b)
618
+
619
+ if (anum && bnum) {
620
+ a = +a
621
+ b = +b
622
+ }
623
+
624
+ return a === b ? 0
625
+ : (anum && !bnum) ? -1
626
+ : (bnum && !anum) ? 1
627
+ : a < b ? -1
628
+ : 1
629
+ }
630
+
631
+ exports.rcompareIdentifiers = rcompareIdentifiers
632
+ function rcompareIdentifiers (a, b) {
633
+ return compareIdentifiers(b, a)
634
+ }
635
+
636
+ exports.major = major
637
+ function major (a, loose) {
638
+ return new SemVer(a, loose).major
639
+ }
640
+
641
+ exports.minor = minor
642
+ function minor (a, loose) {
643
+ return new SemVer(a, loose).minor
644
+ }
645
+
646
+ exports.patch = patch
647
+ function patch (a, loose) {
648
+ return new SemVer(a, loose).patch
649
+ }
650
+
651
+ exports.compare = compare
652
+ function compare (a, b, loose) {
653
+ return new SemVer(a, loose).compare(new SemVer(b, loose))
654
+ }
655
+
656
+ exports.compareLoose = compareLoose
657
+ function compareLoose (a, b) {
658
+ return compare(a, b, true)
659
+ }
660
+
661
+ exports.rcompare = rcompare
662
+ function rcompare (a, b, loose) {
663
+ return compare(b, a, loose)
664
+ }
665
+
666
+ exports.sort = sort
667
+ function sort (list, loose) {
668
+ return list.sort(function (a, b) {
669
+ return exports.compare(a, b, loose)
670
+ })
671
+ }
672
+
673
+ exports.rsort = rsort
674
+ function rsort (list, loose) {
675
+ return list.sort(function (a, b) {
676
+ return exports.rcompare(a, b, loose)
677
+ })
678
+ }
679
+
680
+ exports.gt = gt
681
+ function gt (a, b, loose) {
682
+ return compare(a, b, loose) > 0
683
+ }
684
+
685
+ exports.lt = lt
686
+ function lt (a, b, loose) {
687
+ return compare(a, b, loose) < 0
688
+ }
689
+
690
+ exports.eq = eq
691
+ function eq (a, b, loose) {
692
+ return compare(a, b, loose) === 0
693
+ }
694
+
695
+ exports.neq = neq
696
+ function neq (a, b, loose) {
697
+ return compare(a, b, loose) !== 0
698
+ }
699
+
700
+ exports.gte = gte
701
+ function gte (a, b, loose) {
702
+ return compare(a, b, loose) >= 0
703
+ }
704
+
705
+ exports.lte = lte
706
+ function lte (a, b, loose) {
707
+ return compare(a, b, loose) <= 0
708
+ }
709
+
710
+ exports.cmp = cmp
711
+ function cmp (a, op, b, loose) {
712
+ switch (op) {
713
+ case '===':
714
+ if (typeof a === 'object')
715
+ a = a.version
716
+ if (typeof b === 'object')
717
+ b = b.version
718
+ return a === b
719
+
720
+ case '!==':
721
+ if (typeof a === 'object')
722
+ a = a.version
723
+ if (typeof b === 'object')
724
+ b = b.version
725
+ return a !== b
726
+
727
+ case '':
728
+ case '=':
729
+ case '==':
730
+ return eq(a, b, loose)
731
+
732
+ case '!=':
733
+ return neq(a, b, loose)
734
+
735
+ case '>':
736
+ return gt(a, b, loose)
737
+
738
+ case '>=':
739
+ return gte(a, b, loose)
740
+
741
+ case '<':
742
+ return lt(a, b, loose)
743
+
744
+ case '<=':
745
+ return lte(a, b, loose)
746
+
747
+ default:
748
+ throw new TypeError('Invalid operator: ' + op)
749
+ }
750
+ }
751
+
752
+ exports.Comparator = Comparator
753
+ function Comparator (comp, options) {
754
+ if (!options || typeof options !== 'object') {
755
+ options = {
756
+ loose: !!options,
757
+ includePrerelease: false
758
+ }
759
+ }
760
+
761
+ if (comp instanceof Comparator) {
762
+ if (comp.loose === !!options.loose) {
763
+ return comp
764
+ } else {
765
+ comp = comp.value
766
+ }
767
+ }
768
+
769
+ if (!(this instanceof Comparator)) {
770
+ return new Comparator(comp, options)
771
+ }
772
+
773
+ comp = comp.trim().split(/\s+/).join(' ')
774
+ debug('comparator', comp, options)
775
+ this.options = options
776
+ this.loose = !!options.loose
777
+ this.parse(comp)
778
+
779
+ if (this.semver === ANY) {
780
+ this.value = ''
781
+ } else {
782
+ this.value = this.operator + this.semver.version
783
+ }
784
+
785
+ debug('comp', this)
786
+ }
787
+
788
+ var ANY = {}
789
+ Comparator.prototype.parse = function (comp) {
790
+ var r = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]
791
+ var m = comp.match(r)
792
+
793
+ if (!m) {
794
+ throw new TypeError('Invalid comparator: ' + comp)
795
+ }
796
+
797
+ this.operator = m[1]
798
+ if (this.operator === '=') {
799
+ this.operator = ''
800
+ }
801
+
802
+ // if it literally is just '>' or '' then allow anything.
803
+ if (!m[2]) {
804
+ this.semver = ANY
805
+ } else {
806
+ this.semver = new SemVer(m[2], this.options.loose)
807
+ }
808
+ }
809
+
810
+ Comparator.prototype.toString = function () {
811
+ return this.value
812
+ }
813
+
814
+ Comparator.prototype.test = function (version) {
815
+ debug('Comparator.test', version, this.options.loose)
816
+
817
+ if (this.semver === ANY) {
818
+ return true
819
+ }
820
+
821
+ if (typeof version === 'string') {
822
+ version = new SemVer(version, this.options)
823
+ }
824
+
825
+ return cmp(version, this.operator, this.semver, this.options)
826
+ }
827
+
828
+ Comparator.prototype.intersects = function (comp, options) {
829
+ if (!(comp instanceof Comparator)) {
830
+ throw new TypeError('a Comparator is required')
831
+ }
832
+
833
+ if (!options || typeof options !== 'object') {
834
+ options = {
835
+ loose: !!options,
836
+ includePrerelease: false
837
+ }
838
+ }
839
+
840
+ var rangeTmp
841
+
842
+ if (this.operator === '') {
843
+ rangeTmp = new Range(comp.value, options)
844
+ return satisfies(this.value, rangeTmp, options)
845
+ } else if (comp.operator === '') {
846
+ rangeTmp = new Range(this.value, options)
847
+ return satisfies(comp.semver, rangeTmp, options)
848
+ }
849
+
850
+ var sameDirectionIncreasing =
851
+ (this.operator === '>=' || this.operator === '>') &&
852
+ (comp.operator === '>=' || comp.operator === '>')
853
+ var sameDirectionDecreasing =
854
+ (this.operator === '<=' || this.operator === '<') &&
855
+ (comp.operator === '<=' || comp.operator === '<')
856
+ var sameSemVer = this.semver.version === comp.semver.version
857
+ var differentDirectionsInclusive =
858
+ (this.operator === '>=' || this.operator === '<=') &&
859
+ (comp.operator === '>=' || comp.operator === '<=')
860
+ var oppositeDirectionsLessThan =
861
+ cmp(this.semver, '<', comp.semver, options) &&
862
+ ((this.operator === '>=' || this.operator === '>') &&
863
+ (comp.operator === '<=' || comp.operator === '<'))
864
+ var oppositeDirectionsGreaterThan =
865
+ cmp(this.semver, '>', comp.semver, options) &&
866
+ ((this.operator === '<=' || this.operator === '<') &&
867
+ (comp.operator === '>=' || comp.operator === '>'))
868
+
869
+ return sameDirectionIncreasing || sameDirectionDecreasing ||
870
+ (sameSemVer && differentDirectionsInclusive) ||
871
+ oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
872
+ }
873
+
874
+ exports.Range = Range
875
+ function Range (range, options) {
876
+ if (!options || typeof options !== 'object') {
877
+ options = {
878
+ loose: !!options,
879
+ includePrerelease: false
880
+ }
881
+ }
882
+
883
+ if (range instanceof Range) {
884
+ if (range.loose === !!options.loose &&
885
+ range.includePrerelease === !!options.includePrerelease) {
886
+ return range
887
+ } else {
888
+ return new Range(range.raw, options)
889
+ }
890
+ }
891
+
892
+ if (range instanceof Comparator) {
893
+ return new Range(range.value, options)
894
+ }
895
+
896
+ if (!(this instanceof Range)) {
897
+ return new Range(range, options)
898
+ }
899
+
900
+ this.options = options
901
+ this.loose = !!options.loose
902
+ this.includePrerelease = !!options.includePrerelease
903
+
904
+ // First reduce all whitespace as much as possible so we do not have to rely
905
+ // on potentially slow regexes like \s*. This is then stored and used for
906
+ // future error messages as well.
907
+ this.raw = range
908
+ .trim()
909
+ .split(/\s+/)
910
+ .join(' ')
911
+
912
+ // First, split based on boolean or ||
913
+ this.set = this.raw.split('||').map(function (range) {
914
+ return this.parseRange(range.trim())
915
+ }, this).filter(function (c) {
916
+ // throw out any that are not relevant for whatever reason
917
+ return c.length
918
+ })
919
+
920
+ if (!this.set.length) {
921
+ throw new TypeError('Invalid SemVer Range: ' + this.raw)
922
+ }
923
+
924
+ this.format()
925
+ }
926
+
927
+ Range.prototype.format = function () {
928
+ this.range = this.set.map(function (comps) {
929
+ return comps.join(' ').trim()
930
+ }).join('||').trim()
931
+ return this.range
932
+ }
933
+
934
+ Range.prototype.toString = function () {
935
+ return this.range
936
+ }
937
+
938
+ Range.prototype.parseRange = function (range) {
939
+ var loose = this.options.loose
940
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
941
+ var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE]
942
+ range = range.replace(hr, hyphenReplace)
943
+ debug('hyphen replace', range)
944
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
945
+ range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace)
946
+ debug('comparator trim', range, safeRe[COMPARATORTRIM])
947
+
948
+ // `~ 1.2.3` => `~1.2.3`
949
+ range = range.replace(safeRe[TILDETRIM], tildeTrimReplace)
950
+
951
+ // `^ 1.2.3` => `^1.2.3`
952
+ range = range.replace(safeRe[CARETTRIM], caretTrimReplace)
953
+
954
+ // At this point, the range is completely trimmed and
955
+ // ready to be split into comparators.
956
+ var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]
957
+ var set = range.split(' ').map(function (comp) {
958
+ return parseComparator(comp, this.options)
959
+ }, this).join(' ').split(/\s+/)
960
+ if (this.options.loose) {
961
+ // in loose mode, throw out any that are not valid comparators
962
+ set = set.filter(function (comp) {
963
+ return !!comp.match(compRe)
964
+ })
965
+ }
966
+ set = set.map(function (comp) {
967
+ return new Comparator(comp, this.options)
968
+ }, this)
969
+
970
+ return set
971
+ }
972
+
973
+ Range.prototype.intersects = function (range, options) {
974
+ if (!(range instanceof Range)) {
975
+ throw new TypeError('a Range is required')
976
+ }
977
+
978
+ return this.set.some(function (thisComparators) {
979
+ return thisComparators.every(function (thisComparator) {
980
+ return range.set.some(function (rangeComparators) {
981
+ return rangeComparators.every(function (rangeComparator) {
982
+ return thisComparator.intersects(rangeComparator, options)
983
+ })
984
+ })
985
+ })
986
+ })
987
+ }
988
+
989
+ // Mostly just for testing and legacy API reasons
990
+ exports.toComparators = toComparators
991
+ function toComparators (range, options) {
992
+ return new Range(range, options).set.map(function (comp) {
993
+ return comp.map(function (c) {
994
+ return c.value
995
+ }).join(' ').trim().split(' ')
996
+ })
997
+ }
998
+
999
+ // comprised of xranges, tildes, stars, and gtlt's at this point.
1000
+ // already replaced the hyphen ranges
1001
+ // turn into a set of JUST comparators.
1002
+ function parseComparator (comp, options) {
1003
+ debug('comp', comp, options)
1004
+ comp = replaceCarets(comp, options)
1005
+ debug('caret', comp)
1006
+ comp = replaceTildes(comp, options)
1007
+ debug('tildes', comp)
1008
+ comp = replaceXRanges(comp, options)
1009
+ debug('xrange', comp)
1010
+ comp = replaceStars(comp, options)
1011
+ debug('stars', comp)
1012
+ return comp
1013
+ }
1014
+
1015
+ function isX (id) {
1016
+ return !id || id.toLowerCase() === 'x' || id === '*'
1017
+ }
1018
+
1019
+ // ~, ~> --> * (any, kinda silly)
1020
+ // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
1021
+ // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
1022
+ // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
1023
+ // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
1024
+ // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
1025
+ function replaceTildes (comp, options) {
1026
+ return comp.trim().split(/\s+/).map(function (comp) {
1027
+ return replaceTilde(comp, options)
1028
+ }).join(' ')
1029
+ }
1030
+
1031
+ function replaceTilde (comp, options) {
1032
+ var r = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE]
1033
+ return comp.replace(r, function (_, M, m, p, pr) {
1034
+ debug('tilde', comp, _, M, m, p, pr)
1035
+ var ret
1036
+
1037
+ if (isX(M)) {
1038
+ ret = ''
1039
+ } else if (isX(m)) {
1040
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
1041
+ } else if (isX(p)) {
1042
+ // ~1.2 == >=1.2.0 <1.3.0
1043
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
1044
+ } else if (pr) {
1045
+ debug('replaceTilde pr', pr)
1046
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
1047
+ ' <' + M + '.' + (+m + 1) + '.0'
1048
+ } else {
1049
+ // ~1.2.3 == >=1.2.3 <1.3.0
1050
+ ret = '>=' + M + '.' + m + '.' + p +
1051
+ ' <' + M + '.' + (+m + 1) + '.0'
1052
+ }
1053
+
1054
+ debug('tilde return', ret)
1055
+ return ret
1056
+ })
1057
+ }
1058
+
1059
+ // ^ --> * (any, kinda silly)
1060
+ // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
1061
+ // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
1062
+ // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
1063
+ // ^1.2.3 --> >=1.2.3 <2.0.0
1064
+ // ^1.2.0 --> >=1.2.0 <2.0.0
1065
+ function replaceCarets (comp, options) {
1066
+ return comp.trim().split(/\s+/).map(function (comp) {
1067
+ return replaceCaret(comp, options)
1068
+ }).join(' ')
1069
+ }
1070
+
1071
+ function replaceCaret (comp, options) {
1072
+ debug('caret', comp, options)
1073
+ var r = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET]
1074
+ return comp.replace(r, function (_, M, m, p, pr) {
1075
+ debug('caret', comp, _, M, m, p, pr)
1076
+ var ret
1077
+
1078
+ if (isX(M)) {
1079
+ ret = ''
1080
+ } else if (isX(m)) {
1081
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
1082
+ } else if (isX(p)) {
1083
+ if (M === '0') {
1084
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
1085
+ } else {
1086
+ ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
1087
+ }
1088
+ } else if (pr) {
1089
+ debug('replaceCaret pr', pr)
1090
+ if (M === '0') {
1091
+ if (m === '0') {
1092
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
1093
+ ' <' + M + '.' + m + '.' + (+p + 1)
1094
+ } else {
1095
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
1096
+ ' <' + M + '.' + (+m + 1) + '.0'
1097
+ }
1098
+ } else {
1099
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
1100
+ ' <' + (+M + 1) + '.0.0'
1101
+ }
1102
+ } else {
1103
+ debug('no pr')
1104
+ if (M === '0') {
1105
+ if (m === '0') {
1106
+ ret = '>=' + M + '.' + m + '.' + p +
1107
+ ' <' + M + '.' + m + '.' + (+p + 1)
1108
+ } else {
1109
+ ret = '>=' + M + '.' + m + '.' + p +
1110
+ ' <' + M + '.' + (+m + 1) + '.0'
1111
+ }
1112
+ } else {
1113
+ ret = '>=' + M + '.' + m + '.' + p +
1114
+ ' <' + (+M + 1) + '.0.0'
1115
+ }
1116
+ }
1117
+
1118
+ debug('caret return', ret)
1119
+ return ret
1120
+ })
1121
+ }
1122
+
1123
+ function replaceXRanges (comp, options) {
1124
+ debug('replaceXRanges', comp, options)
1125
+ return comp.split(/\s+/).map(function (comp) {
1126
+ return replaceXRange(comp, options)
1127
+ }).join(' ')
1128
+ }
1129
+
1130
+ function replaceXRange (comp, options) {
1131
+ comp = comp.trim()
1132
+ var r = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE]
1133
+ return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
1134
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
1135
+ var xM = isX(M)
1136
+ var xm = xM || isX(m)
1137
+ var xp = xm || isX(p)
1138
+ var anyX = xp
1139
+
1140
+ if (gtlt === '=' && anyX) {
1141
+ gtlt = ''
1142
+ }
1143
+
1144
+ if (xM) {
1145
+ if (gtlt === '>' || gtlt === '<') {
1146
+ // nothing is allowed
1147
+ ret = '<0.0.0'
1148
+ } else {
1149
+ // nothing is forbidden
1150
+ ret = '*'
1151
+ }
1152
+ } else if (gtlt && anyX) {
1153
+ // we know patch is an x, because we have any x at all.
1154
+ // replace X with 0
1155
+ if (xm) {
1156
+ m = 0
1157
+ }
1158
+ p = 0
1159
+
1160
+ if (gtlt === '>') {
1161
+ // >1 => >=2.0.0
1162
+ // >1.2 => >=1.3.0
1163
+ // >1.2.3 => >= 1.2.4
1164
+ gtlt = '>='
1165
+ if (xm) {
1166
+ M = +M + 1
1167
+ m = 0
1168
+ p = 0
1169
+ } else {
1170
+ m = +m + 1
1171
+ p = 0
1172
+ }
1173
+ } else if (gtlt === '<=') {
1174
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
1175
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
1176
+ gtlt = '<'
1177
+ if (xm) {
1178
+ M = +M + 1
1179
+ } else {
1180
+ m = +m + 1
1181
+ }
1182
+ }
1183
+
1184
+ ret = gtlt + M + '.' + m + '.' + p
1185
+ } else if (xm) {
1186
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
1187
+ } else if (xp) {
1188
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
1189
+ }
1190
+
1191
+ debug('xRange return', ret)
1192
+
1193
+ return ret
1194
+ })
1195
+ }
1196
+
1197
+ // Because * is AND-ed with everything else in the comparator,
1198
+ // and '' means "any version", just remove the *s entirely.
1199
+ function replaceStars (comp, options) {
1200
+ debug('replaceStars', comp, options)
1201
+ // Looseness is ignored here. star is always as loose as it gets!
1202
+ return comp.trim().replace(safeRe[STAR], '')
1203
+ }
1204
+
1205
+ // This function is passed to string.replace(safeRe[HYPHENRANGE])
1206
+ // M, m, patch, prerelease, build
1207
+ // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
1208
+ // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
1209
+ // 1.2 - 3.4 => >=1.2.0 <3.5.0
1210
+ function hyphenReplace ($0,
1211
+ from, fM, fm, fp, fpr, fb,
1212
+ to, tM, tm, tp, tpr, tb) {
1213
+ if (isX(fM)) {
1214
+ from = ''
1215
+ } else if (isX(fm)) {
1216
+ from = '>=' + fM + '.0.0'
1217
+ } else if (isX(fp)) {
1218
+ from = '>=' + fM + '.' + fm + '.0'
1219
+ } else {
1220
+ from = '>=' + from
1221
+ }
1222
+
1223
+ if (isX(tM)) {
1224
+ to = ''
1225
+ } else if (isX(tm)) {
1226
+ to = '<' + (+tM + 1) + '.0.0'
1227
+ } else if (isX(tp)) {
1228
+ to = '<' + tM + '.' + (+tm + 1) + '.0'
1229
+ } else if (tpr) {
1230
+ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
1231
+ } else {
1232
+ to = '<=' + to
1233
+ }
1234
+
1235
+ return (from + ' ' + to).trim()
1236
+ }
1237
+
1238
+ // if ANY of the sets match ALL of its comparators, then pass
1239
+ Range.prototype.test = function (version) {
1240
+ if (!version) {
1241
+ return false
1242
+ }
1243
+
1244
+ if (typeof version === 'string') {
1245
+ version = new SemVer(version, this.options)
1246
+ }
1247
+
1248
+ for (var i = 0; i < this.set.length; i++) {
1249
+ if (testSet(this.set[i], version, this.options)) {
1250
+ return true
1251
+ }
1252
+ }
1253
+ return false
1254
+ }
1255
+
1256
+ function testSet (set, version, options) {
1257
+ for (var i = 0; i < set.length; i++) {
1258
+ if (!set[i].test(version)) {
1259
+ return false
1260
+ }
1261
+ }
1262
+
1263
+ if (version.prerelease.length && !options.includePrerelease) {
1264
+ // Find the set of versions that are allowed to have prereleases
1265
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
1266
+ // That should allow `1.2.3-pr.2` to pass.
1267
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
1268
+ // even though it's within the range set by the comparators.
1269
+ for (i = 0; i < set.length; i++) {
1270
+ debug(set[i].semver)
1271
+ if (set[i].semver === ANY) {
1272
+ continue
1273
+ }
1274
+
1275
+ if (set[i].semver.prerelease.length > 0) {
1276
+ var allowed = set[i].semver
1277
+ if (allowed.major === version.major &&
1278
+ allowed.minor === version.minor &&
1279
+ allowed.patch === version.patch) {
1280
+ return true
1281
+ }
1282
+ }
1283
+ }
1284
+
1285
+ // Version has a -pre, but it's not one of the ones we like.
1286
+ return false
1287
+ }
1288
+
1289
+ return true
1290
+ }
1291
+
1292
+ exports.satisfies = satisfies
1293
+ function satisfies (version, range, options) {
1294
+ try {
1295
+ range = new Range(range, options)
1296
+ } catch (er) {
1297
+ return false
1298
+ }
1299
+ return range.test(version)
1300
+ }
1301
+
1302
+ exports.maxSatisfying = maxSatisfying
1303
+ function maxSatisfying (versions, range, options) {
1304
+ var max = null
1305
+ var maxSV = null
1306
+ try {
1307
+ var rangeObj = new Range(range, options)
1308
+ } catch (er) {
1309
+ return null
1310
+ }
1311
+ versions.forEach(function (v) {
1312
+ if (rangeObj.test(v)) {
1313
+ // satisfies(v, range, options)
1314
+ if (!max || maxSV.compare(v) === -1) {
1315
+ // compare(max, v, true)
1316
+ max = v
1317
+ maxSV = new SemVer(max, options)
1318
+ }
1319
+ }
1320
+ })
1321
+ return max
1322
+ }
1323
+
1324
+ exports.minSatisfying = minSatisfying
1325
+ function minSatisfying (versions, range, options) {
1326
+ var min = null
1327
+ var minSV = null
1328
+ try {
1329
+ var rangeObj = new Range(range, options)
1330
+ } catch (er) {
1331
+ return null
1332
+ }
1333
+ versions.forEach(function (v) {
1334
+ if (rangeObj.test(v)) {
1335
+ // satisfies(v, range, options)
1336
+ if (!min || minSV.compare(v) === 1) {
1337
+ // compare(min, v, true)
1338
+ min = v
1339
+ minSV = new SemVer(min, options)
1340
+ }
1341
+ }
1342
+ })
1343
+ return min
1344
+ }
1345
+
1346
+ exports.minVersion = minVersion
1347
+ function minVersion (range, loose) {
1348
+ range = new Range(range, loose)
1349
+
1350
+ var minver = new SemVer('0.0.0')
1351
+ if (range.test(minver)) {
1352
+ return minver
1353
+ }
1354
+
1355
+ minver = new SemVer('0.0.0-0')
1356
+ if (range.test(minver)) {
1357
+ return minver
1358
+ }
1359
+
1360
+ minver = null
1361
+ for (var i = 0; i < range.set.length; ++i) {
1362
+ var comparators = range.set[i]
1363
+
1364
+ comparators.forEach(function (comparator) {
1365
+ // Clone to avoid manipulating the comparator's semver object.
1366
+ var compver = new SemVer(comparator.semver.version)
1367
+ switch (comparator.operator) {
1368
+ case '>':
1369
+ if (compver.prerelease.length === 0) {
1370
+ compver.patch++
1371
+ } else {
1372
+ compver.prerelease.push(0)
1373
+ }
1374
+ compver.raw = compver.format()
1375
+ /* fallthrough */
1376
+ case '':
1377
+ case '>=':
1378
+ if (!minver || gt(minver, compver)) {
1379
+ minver = compver
1380
+ }
1381
+ break
1382
+ case '<':
1383
+ case '<=':
1384
+ /* Ignore maximum versions */
1385
+ break
1386
+ /* istanbul ignore next */
1387
+ default:
1388
+ throw new Error('Unexpected operation: ' + comparator.operator)
1389
+ }
1390
+ })
1391
+ }
1392
+
1393
+ if (minver && range.test(minver)) {
1394
+ return minver
1395
+ }
1396
+
1397
+ return null
1398
+ }
1399
+
1400
+ exports.validRange = validRange
1401
+ function validRange (range, options) {
1402
+ try {
1403
+ // Return '*' instead of '' so that truthiness works.
1404
+ // This will throw if it's invalid anyway
1405
+ return new Range(range, options).range || '*'
1406
+ } catch (er) {
1407
+ return null
1408
+ }
1409
+ }
1410
+
1411
+ // Determine if version is less than all the versions possible in the range
1412
+ exports.ltr = ltr
1413
+ function ltr (version, range, options) {
1414
+ return outside(version, range, '<', options)
1415
+ }
1416
+
1417
+ // Determine if version is greater than all the versions possible in the range.
1418
+ exports.gtr = gtr
1419
+ function gtr (version, range, options) {
1420
+ return outside(version, range, '>', options)
1421
+ }
1422
+
1423
+ exports.outside = outside
1424
+ function outside (version, range, hilo, options) {
1425
+ version = new SemVer(version, options)
1426
+ range = new Range(range, options)
1427
+
1428
+ var gtfn, ltefn, ltfn, comp, ecomp
1429
+ switch (hilo) {
1430
+ case '>':
1431
+ gtfn = gt
1432
+ ltefn = lte
1433
+ ltfn = lt
1434
+ comp = '>'
1435
+ ecomp = '>='
1436
+ break
1437
+ case '<':
1438
+ gtfn = lt
1439
+ ltefn = gte
1440
+ ltfn = gt
1441
+ comp = '<'
1442
+ ecomp = '<='
1443
+ break
1444
+ default:
1445
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
1446
+ }
1447
+
1448
+ // If it satisifes the range it is not outside
1449
+ if (satisfies(version, range, options)) {
1450
+ return false
1451
+ }
1452
+
1453
+ // From now on, variable terms are as if we're in "gtr" mode.
1454
+ // but note that everything is flipped for the "ltr" function.
1455
+
1456
+ for (var i = 0; i < range.set.length; ++i) {
1457
+ var comparators = range.set[i]
1458
+
1459
+ var high = null
1460
+ var low = null
1461
+
1462
+ comparators.forEach(function (comparator) {
1463
+ if (comparator.semver === ANY) {
1464
+ comparator = new Comparator('>=0.0.0')
1465
+ }
1466
+ high = high || comparator
1467
+ low = low || comparator
1468
+ if (gtfn(comparator.semver, high.semver, options)) {
1469
+ high = comparator
1470
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1471
+ low = comparator
1472
+ }
1473
+ })
1474
+
1475
+ // If the edge version comparator has a operator then our version
1476
+ // isn't outside it
1477
+ if (high.operator === comp || high.operator === ecomp) {
1478
+ return false
1479
+ }
1480
+
1481
+ // If the lowest version comparator has an operator and our version
1482
+ // is less than it then it isn't higher than the range
1483
+ if ((!low.operator || low.operator === comp) &&
1484
+ ltefn(version, low.semver)) {
1485
+ return false
1486
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1487
+ return false
1488
+ }
1489
+ }
1490
+ return true
1491
+ }
1492
+
1493
+ exports.prerelease = prerelease
1494
+ function prerelease (version, options) {
1495
+ var parsed = parse(version, options)
1496
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
1497
+ }
1498
+
1499
+ exports.intersects = intersects
1500
+ function intersects (r1, r2, options) {
1501
+ r1 = new Range(r1, options)
1502
+ r2 = new Range(r2, options)
1503
+ return r1.intersects(r2)
1504
+ }
1505
+
1506
+ exports.coerce = coerce
1507
+ function coerce (version) {
1508
+ if (version instanceof SemVer) {
1509
+ return version
1510
+ }
1511
+
1512
+ if (typeof version !== 'string') {
1513
+ return null
1514
+ }
1515
+
1516
+ var match = version.match(safeRe[COERCE])
1517
+
1518
+ if (match == null) {
1519
+ return null
1520
+ }
1521
+
1522
+ return parse(match[1] +
1523
+ '.' + (match[2] || '0') +
1524
+ '.' + (match[3] || '0'))
1525
+ }