projen 0.51.4 → 0.51.8

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 (395) hide show
  1. package/.jsii +69 -9
  2. package/API.md +12 -1
  3. package/changelog.md +1 -1
  4. package/lib/awscdk/auto-discover.js +1 -1
  5. package/lib/awscdk/awscdk-app-java.js +1 -1
  6. package/lib/awscdk/awscdk-app-ts.js +1 -1
  7. package/lib/awscdk/awscdk-construct.js +2 -2
  8. package/lib/awscdk/awscdk-deps-java.js +1 -1
  9. package/lib/awscdk/awscdk-deps-js.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 +9 -2
  14. package/lib/awscdk/lambda-function.js +2 -2
  15. package/lib/build/build-workflow.js +1 -1
  16. package/lib/cdk/construct-lib.js +1 -1
  17. package/lib/cdk/jsii-docgen.js +1 -1
  18. package/lib/cdk/jsii-project.js +1 -1
  19. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  20. package/lib/cdk8s/cdk8s-construct.js +1 -1
  21. package/lib/cdktf/cdktf-construct.js +1 -1
  22. package/lib/component.js +1 -1
  23. package/lib/dependencies.js +1 -1
  24. package/lib/dev-env.js +1 -1
  25. package/lib/docker-compose.js +2 -2
  26. package/lib/file.js +1 -1
  27. package/lib/gitattributes.js +1 -1
  28. package/lib/github/auto-approve.js +1 -1
  29. package/lib/github/auto-merge.js +1 -1
  30. package/lib/github/dependabot.js +1 -1
  31. package/lib/github/github-project.js +1 -1
  32. package/lib/github/github.js +1 -1
  33. package/lib/github/mergify.js +1 -1
  34. package/lib/github/pr-template.js +1 -1
  35. package/lib/github/pull-request-lint.js +1 -1
  36. package/lib/github/stale-util.js +12 -7
  37. package/lib/github/stale.d.ts +10 -1
  38. package/lib/github/stale.js +10 -2
  39. package/lib/github/task-workflow.js +1 -1
  40. package/lib/github/workflows.js +1 -1
  41. package/lib/gitlab/configuration.js +1 -1
  42. package/lib/gitlab/gitlab-configuration.js +1 -1
  43. package/lib/gitlab/nested-configuration.js +1 -1
  44. package/lib/gitpod.js +1 -1
  45. package/lib/ignore-file.js +1 -1
  46. package/lib/ini.js +1 -1
  47. package/lib/java/java-project.js +1 -1
  48. package/lib/java/junit.js +1 -1
  49. package/lib/java/maven-compile.js +1 -1
  50. package/lib/java/maven-packaging.js +1 -1
  51. package/lib/java/maven-sample.js +1 -1
  52. package/lib/java/pom.js +1 -1
  53. package/lib/java/projenrc.js +1 -1
  54. package/lib/javascript/bundler.js +1 -1
  55. package/lib/javascript/eslint.js +1 -1
  56. package/lib/javascript/jest.js +1 -1
  57. package/lib/javascript/node-package.js +1 -1
  58. package/lib/javascript/node-project.js +1 -1
  59. package/lib/javascript/npm-config.js +1 -1
  60. package/lib/javascript/prettier.js +1 -1
  61. package/lib/javascript/projenrc.js +1 -1
  62. package/lib/javascript/typescript-config.js +1 -1
  63. package/lib/javascript/upgrade-dependencies.js +2 -2
  64. package/lib/json.js +1 -1
  65. package/lib/license.js +1 -1
  66. package/lib/logger.js +1 -1
  67. package/lib/makefile.js +1 -1
  68. package/lib/object-file.js +1 -1
  69. package/lib/project-build.js +1 -1
  70. package/lib/project.js +1 -1
  71. package/lib/projects.js +1 -1
  72. package/lib/projenrc-json.js +1 -1
  73. package/lib/python/pip.js +1 -1
  74. package/lib/python/poetry.js +2 -2
  75. package/lib/python/projenrc.js +1 -1
  76. package/lib/python/pytest.js +1 -1
  77. package/lib/python/python-project.js +1 -1
  78. package/lib/python/python-sample.js +1 -1
  79. package/lib/python/requirements-file.js +1 -1
  80. package/lib/python/setuppy.js +1 -1
  81. package/lib/python/setuptools.js +1 -1
  82. package/lib/python/venv.js +1 -1
  83. package/lib/readme.js +1 -1
  84. package/lib/release/publisher.js +1 -1
  85. package/lib/release/release-trigger.js +1 -1
  86. package/lib/release/release.js +1 -1
  87. package/lib/sample-file.js +2 -2
  88. package/lib/semver.js +1 -1
  89. package/lib/source-code.js +1 -1
  90. package/lib/task-runtime.js +1 -1
  91. package/lib/task.js +1 -1
  92. package/lib/tasks.js +1 -1
  93. package/lib/testing.js +1 -1
  94. package/lib/textfile.js +1 -1
  95. package/lib/toml.js +1 -1
  96. package/lib/typescript/projenrc.js +1 -1
  97. package/lib/typescript/typescript-typedoc.js +1 -1
  98. package/lib/typescript/typescript.js +3 -3
  99. package/lib/version.js +1 -1
  100. package/lib/vscode/devcontainer.js +1 -1
  101. package/lib/vscode/launch-config.js +1 -1
  102. package/lib/vscode/vscode.js +1 -1
  103. package/lib/web/next.js +3 -3
  104. package/lib/web/postcss.js +1 -1
  105. package/lib/web/react.js +4 -4
  106. package/lib/web/tailwind.js +1 -1
  107. package/lib/xmlfile.js +1 -1
  108. package/lib/yaml.d.ts +13 -0
  109. package/lib/yaml.js +8 -3
  110. package/node_modules/{fs-extra/node_modules/universalify → universalify}/LICENSE +0 -0
  111. package/node_modules/{fs-extra/node_modules/universalify → universalify}/README.md +0 -0
  112. package/node_modules/{fs-extra/node_modules/universalify → universalify}/index.js +0 -0
  113. package/node_modules/{fs-extra/node_modules/universalify → universalify}/package.json +0 -0
  114. package/node_modules/yaml/LICENSE +1 -1
  115. package/node_modules/yaml/README.md +57 -41
  116. package/node_modules/yaml/browser/dist/compose/compose-collection.js +59 -0
  117. package/node_modules/yaml/browser/dist/compose/compose-doc.js +40 -0
  118. package/node_modules/yaml/browser/dist/compose/compose-node.js +81 -0
  119. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +81 -0
  120. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  121. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +107 -0
  122. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +185 -0
  123. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +45 -0
  124. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  125. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +200 -0
  126. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
  127. package/node_modules/yaml/browser/dist/compose/resolve-props.js +128 -0
  128. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  129. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
  130. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  131. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +17 -0
  132. package/node_modules/yaml/browser/dist/doc/Document.js +321 -0
  133. package/node_modules/yaml/browser/dist/doc/anchors.js +72 -0
  134. package/node_modules/yaml/browser/dist/doc/applyReviver.js +54 -0
  135. package/node_modules/yaml/browser/dist/doc/createNode.js +84 -0
  136. package/node_modules/yaml/browser/dist/doc/directives.js +166 -0
  137. package/node_modules/yaml/browser/dist/errors.js +57 -0
  138. package/node_modules/yaml/browser/dist/index.js +18 -1002
  139. package/node_modules/yaml/browser/dist/log.js +14 -0
  140. package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +164 -0
  141. package/node_modules/yaml/browser/dist/nodes/Alias.js +94 -0
  142. package/node_modules/yaml/browser/dist/nodes/Collection.js +146 -0
  143. package/node_modules/yaml/browser/dist/nodes/Node.js +48 -0
  144. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  145. package/node_modules/yaml/browser/dist/nodes/Scalar.js +23 -0
  146. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +116 -0
  147. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +105 -0
  148. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +104 -0
  149. package/node_modules/yaml/browser/dist/nodes/toJS.js +35 -0
  150. package/node_modules/yaml/browser/dist/options.js +18 -0
  151. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +215 -0
  152. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  153. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  154. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  155. package/node_modules/yaml/browser/dist/parse/lexer.js +692 -0
  156. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  157. package/node_modules/yaml/browser/dist/parse/parser.js +882 -0
  158. package/node_modules/yaml/browser/dist/public-api.js +99 -0
  159. package/node_modules/yaml/browser/dist/schema/Schema.js +34 -0
  160. package/node_modules/yaml/browser/dist/schema/common/map.js +42 -0
  161. package/node_modules/yaml/browser/dist/schema/common/null.js +13 -0
  162. package/node_modules/yaml/browser/dist/schema/common/seq.js +33 -0
  163. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  164. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  165. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  166. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  167. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  168. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  169. package/node_modules/yaml/browser/dist/schema/tags.js +83 -0
  170. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +66 -0
  171. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  172. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  173. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  174. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +73 -0
  175. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +77 -0
  176. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +37 -0
  177. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +87 -0
  178. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  179. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +135 -0
  180. package/node_modules/yaml/browser/dist/stringify/stringify.js +124 -0
  181. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +152 -0
  182. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +18 -0
  183. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +68 -0
  184. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
  185. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +122 -0
  186. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +314 -0
  187. package/node_modules/yaml/browser/dist/util.js +9 -2
  188. package/node_modules/yaml/browser/dist/visit.js +146 -0
  189. package/node_modules/yaml/browser/index.js +5 -1
  190. package/node_modules/yaml/browser/package.json +3 -0
  191. package/node_modules/yaml/dist/compose/compose-collection.d.ts +5 -0
  192. package/node_modules/yaml/dist/compose/compose-collection.js +61 -0
  193. package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -0
  194. package/node_modules/yaml/dist/compose/compose-doc.js +42 -0
  195. package/node_modules/yaml/dist/compose/compose-node.d.ts +26 -0
  196. package/node_modules/yaml/dist/compose/compose-node.js +84 -0
  197. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  198. package/node_modules/yaml/dist/compose/compose-scalar.js +83 -0
  199. package/node_modules/yaml/dist/compose/composer.d.ts +62 -0
  200. package/node_modules/yaml/dist/compose/composer.js +223 -0
  201. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  202. package/node_modules/yaml/dist/compose/resolve-block-map.js +109 -0
  203. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +10 -0
  204. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +187 -0
  205. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -0
  206. package/node_modules/yaml/dist/compose/resolve-block-seq.js +47 -0
  207. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  208. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  209. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +6 -0
  210. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +202 -0
  211. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  212. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
  213. package/node_modules/yaml/dist/compose/resolve-props.d.ts +21 -0
  214. package/node_modules/yaml/dist/compose/resolve-props.js +130 -0
  215. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  216. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  217. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  218. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +29 -0
  219. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  220. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  221. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  222. package/node_modules/yaml/dist/compose/util-map-includes.js +19 -0
  223. package/node_modules/yaml/dist/doc/Document.d.ts +139 -0
  224. package/node_modules/yaml/dist/doc/Document.js +323 -0
  225. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  226. package/node_modules/yaml/dist/doc/anchors.js +77 -0
  227. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  228. package/node_modules/yaml/dist/doc/applyReviver.js +56 -0
  229. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  230. package/node_modules/yaml/dist/doc/createNode.js +86 -0
  231. package/node_modules/yaml/dist/doc/directives.d.ts +47 -0
  232. package/node_modules/yaml/dist/doc/directives.js +168 -0
  233. package/node_modules/yaml/dist/errors.d.ts +21 -0
  234. package/node_modules/yaml/dist/errors.js +62 -0
  235. package/node_modules/yaml/dist/index.d.ts +19 -0
  236. package/node_modules/yaml/dist/index.js +49 -77
  237. package/node_modules/yaml/dist/log.d.ts +3 -0
  238. package/node_modules/yaml/dist/log.js +17 -0
  239. package/node_modules/yaml/dist/node_modules/tslib/tslib.es6.js +76 -0
  240. package/node_modules/yaml/dist/nodes/Alias.d.ts +28 -0
  241. package/node_modules/yaml/dist/nodes/Alias.js +96 -0
  242. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  243. package/node_modules/yaml/dist/nodes/Collection.js +150 -0
  244. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  245. package/node_modules/yaml/dist/nodes/Node.js +66 -0
  246. package/node_modules/yaml/dist/nodes/Pair.d.ts +21 -0
  247. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  248. package/node_modules/yaml/dist/nodes/Scalar.d.ts +42 -0
  249. package/node_modules/yaml/dist/nodes/Scalar.js +26 -0
  250. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +41 -0
  251. package/node_modules/yaml/dist/nodes/YAMLMap.js +119 -0
  252. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +55 -0
  253. package/node_modules/yaml/dist/nodes/YAMLSeq.js +107 -0
  254. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -0
  255. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +106 -0
  256. package/node_modules/yaml/dist/nodes/toJS.d.ts +30 -0
  257. package/node_modules/yaml/dist/nodes/toJS.js +37 -0
  258. package/node_modules/yaml/dist/options.d.ts +338 -0
  259. package/node_modules/yaml/dist/options.js +20 -0
  260. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  261. package/node_modules/yaml/dist/parse/cst-scalar.js +219 -0
  262. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  263. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  264. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  265. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  266. package/node_modules/yaml/dist/parse/cst.d.ts +106 -0
  267. package/node_modules/yaml/dist/parse/cst.js +112 -0
  268. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  269. package/node_modules/yaml/dist/parse/lexer.js +694 -0
  270. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  271. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  272. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  273. package/node_modules/yaml/dist/parse/parser.js +886 -0
  274. package/node_modules/yaml/dist/public-api.d.ts +43 -0
  275. package/node_modules/yaml/dist/public-api.js +104 -0
  276. package/node_modules/yaml/dist/schema/Schema.d.ts +18 -0
  277. package/node_modules/yaml/dist/schema/Schema.js +36 -0
  278. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  279. package/node_modules/yaml/dist/schema/common/map.js +44 -0
  280. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  281. package/node_modules/yaml/dist/schema/common/null.js +15 -0
  282. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  283. package/node_modules/yaml/dist/schema/common/seq.js +35 -0
  284. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  285. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  286. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  287. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  288. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  289. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  290. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  291. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  292. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  293. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  294. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  295. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  296. package/node_modules/yaml/dist/schema/tags.d.ts +40 -0
  297. package/node_modules/yaml/dist/schema/tags.js +86 -0
  298. package/node_modules/yaml/dist/schema/types.d.ts +82 -0
  299. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  300. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
  301. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  302. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  303. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  304. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  305. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  306. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  307. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +21 -0
  308. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +76 -0
  309. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  310. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +81 -0
  311. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  312. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +39 -0
  313. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +22 -0
  314. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +90 -0
  315. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  316. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  317. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  318. package/node_modules/yaml/dist/stringify/foldFlowLines.js +140 -0
  319. package/node_modules/yaml/dist/stringify/stringify.d.ts +20 -0
  320. package/node_modules/yaml/dist/stringify/stringify.js +127 -0
  321. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  322. package/node_modules/yaml/dist/stringify/stringifyCollection.js +154 -0
  323. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  324. package/node_modules/yaml/dist/stringify/stringifyComment.js +22 -0
  325. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -0
  326. package/node_modules/yaml/dist/stringify/stringifyDocument.js +70 -0
  327. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  328. package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
  329. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  330. package/node_modules/yaml/dist/stringify/stringifyPair.js +124 -0
  331. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +3 -0
  332. package/node_modules/yaml/dist/stringify/stringifyString.js +316 -0
  333. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  334. package/node_modules/yaml/dist/test-events.js +126 -152
  335. package/node_modules/yaml/dist/util.d.ts +9 -0
  336. package/node_modules/yaml/dist/util.js +19 -14
  337. package/node_modules/yaml/dist/visit.d.ts +63 -0
  338. package/node_modules/yaml/dist/visit.js +148 -0
  339. package/node_modules/yaml/package.json +43 -55
  340. package/node_modules/yaml/util.d.ts +3 -86
  341. package/node_modules/yaml/util.js +2 -16
  342. package/package.json +3 -3
  343. package/releasetag.txt +1 -1
  344. package/version.txt +1 -1
  345. package/node_modules/jsonfile/node_modules/universalify/LICENSE +0 -20
  346. package/node_modules/jsonfile/node_modules/universalify/README.md +0 -76
  347. package/node_modules/jsonfile/node_modules/universalify/index.js +0 -24
  348. package/node_modules/jsonfile/node_modules/universalify/package.json +0 -34
  349. package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +0 -1275
  350. package/node_modules/yaml/browser/dist/Schema-e94716c8.js +0 -682
  351. package/node_modules/yaml/browser/dist/legacy-exports.js +0 -3
  352. package/node_modules/yaml/browser/dist/package.json +0 -1
  353. package/node_modules/yaml/browser/dist/parse-cst.js +0 -1904
  354. package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +0 -2419
  355. package/node_modules/yaml/browser/dist/types.js +0 -4
  356. package/node_modules/yaml/browser/dist/warnings-df54cb69.js +0 -499
  357. package/node_modules/yaml/browser/map.js +0 -2
  358. package/node_modules/yaml/browser/pair.js +0 -2
  359. package/node_modules/yaml/browser/parse-cst.js +0 -1
  360. package/node_modules/yaml/browser/scalar.js +0 -2
  361. package/node_modules/yaml/browser/schema.js +0 -9
  362. package/node_modules/yaml/browser/seq.js +0 -2
  363. package/node_modules/yaml/browser/types/binary.js +0 -8
  364. package/node_modules/yaml/browser/types/omap.js +0 -3
  365. package/node_modules/yaml/browser/types/pairs.js +0 -3
  366. package/node_modules/yaml/browser/types/set.js +0 -3
  367. package/node_modules/yaml/browser/types/timestamp.js +0 -10
  368. package/node_modules/yaml/browser/types.js +0 -1
  369. package/node_modules/yaml/browser/util.js +0 -1
  370. package/node_modules/yaml/dist/Document-9b4560a1.js +0 -757
  371. package/node_modules/yaml/dist/PlainValue-ec8e588e.js +0 -876
  372. package/node_modules/yaml/dist/Schema-88e323a7.js +0 -525
  373. package/node_modules/yaml/dist/legacy-exports.js +0 -16
  374. package/node_modules/yaml/dist/parse-cst.js +0 -1753
  375. package/node_modules/yaml/dist/resolveSeq-d03cb037.js +0 -2161
  376. package/node_modules/yaml/dist/types.js +0 -23
  377. package/node_modules/yaml/dist/warnings-1000a372.js +0 -416
  378. package/node_modules/yaml/index.d.ts +0 -372
  379. package/node_modules/yaml/index.js +0 -1
  380. package/node_modules/yaml/map.js +0 -2
  381. package/node_modules/yaml/pair.js +0 -2
  382. package/node_modules/yaml/parse-cst.d.ts +0 -191
  383. package/node_modules/yaml/parse-cst.js +0 -1
  384. package/node_modules/yaml/scalar.js +0 -2
  385. package/node_modules/yaml/schema.js +0 -9
  386. package/node_modules/yaml/seq.js +0 -2
  387. package/node_modules/yaml/types/binary.js +0 -8
  388. package/node_modules/yaml/types/omap.js +0 -3
  389. package/node_modules/yaml/types/pairs.js +0 -3
  390. package/node_modules/yaml/types/set.js +0 -3
  391. package/node_modules/yaml/types/timestamp.js +0 -10
  392. package/node_modules/yaml/types.d.ts +0 -407
  393. package/node_modules/yaml/types.js +0 -17
  394. package/node_modules/yaml/types.mjs +0 -17
  395. package/node_modules/yaml/util.mjs +0 -18
@@ -0,0 +1,168 @@
1
+ 'use strict';
2
+
3
+ var Node = require('../nodes/Node.js');
4
+ var visit = require('../visit.js');
5
+
6
+ const escapeChars = {
7
+ '!': '%21',
8
+ ',': '%2C',
9
+ '[': '%5B',
10
+ ']': '%5D',
11
+ '{': '%7B',
12
+ '}': '%7D'
13
+ };
14
+ const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, ch => escapeChars[ch]);
15
+ class Directives {
16
+ constructor(yaml, tags) {
17
+ /**
18
+ * The directives-end/doc-start marker `---`. If `null`, a marker may still be
19
+ * included in the document's stringified representation.
20
+ */
21
+ this.marker = null;
22
+ this.yaml = Object.assign({}, Directives.defaultYaml, yaml);
23
+ this.tags = Object.assign({}, Directives.defaultTags, tags);
24
+ }
25
+ clone() {
26
+ const copy = new Directives(this.yaml, this.tags);
27
+ copy.marker = this.marker;
28
+ return copy;
29
+ }
30
+ /**
31
+ * During parsing, get a Directives instance for the current document and
32
+ * update the stream state according to the current version's spec.
33
+ */
34
+ atDocument() {
35
+ const res = new Directives(this.yaml, this.tags);
36
+ switch (this.yaml.version) {
37
+ case '1.1':
38
+ this.atNextDocument = true;
39
+ break;
40
+ case '1.2':
41
+ this.atNextDocument = false;
42
+ this.yaml = {
43
+ explicit: Directives.defaultYaml.explicit,
44
+ version: '1.2'
45
+ };
46
+ this.tags = Object.assign({}, Directives.defaultTags);
47
+ break;
48
+ }
49
+ return res;
50
+ }
51
+ /**
52
+ * @param onError - May be called even if the action was successful
53
+ * @returns `true` on success
54
+ */
55
+ add(line, onError) {
56
+ if (this.atNextDocument) {
57
+ this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };
58
+ this.tags = Object.assign({}, Directives.defaultTags);
59
+ this.atNextDocument = false;
60
+ }
61
+ const parts = line.trim().split(/[ \t]+/);
62
+ const name = parts.shift();
63
+ switch (name) {
64
+ case '%TAG': {
65
+ if (parts.length !== 2) {
66
+ onError(0, '%TAG directive should contain exactly two parts');
67
+ if (parts.length < 2)
68
+ return false;
69
+ }
70
+ const [handle, prefix] = parts;
71
+ this.tags[handle] = prefix;
72
+ return true;
73
+ }
74
+ case '%YAML': {
75
+ this.yaml.explicit = true;
76
+ if (parts.length < 1) {
77
+ onError(0, '%YAML directive should contain exactly one part');
78
+ return false;
79
+ }
80
+ const [version] = parts;
81
+ if (version === '1.1' || version === '1.2') {
82
+ this.yaml.version = version;
83
+ return true;
84
+ }
85
+ else {
86
+ onError(6, `Unsupported YAML version ${version}`, true);
87
+ return false;
88
+ }
89
+ }
90
+ default:
91
+ onError(0, `Unknown directive ${name}`, true);
92
+ return false;
93
+ }
94
+ }
95
+ /**
96
+ * Resolves a tag, matching handles to those defined in %TAG directives.
97
+ *
98
+ * @returns Resolved tag, which may also be the non-specific tag `'!'` or a
99
+ * `'!local'` tag, or `null` if unresolvable.
100
+ */
101
+ tagName(source, onError) {
102
+ if (source === '!')
103
+ return '!'; // non-specific tag
104
+ if (source[0] !== '!') {
105
+ onError(`Not a valid tag: ${source}`);
106
+ return null;
107
+ }
108
+ if (source[1] === '<') {
109
+ const verbatim = source.slice(2, -1);
110
+ if (verbatim === '!' || verbatim === '!!') {
111
+ onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
112
+ return null;
113
+ }
114
+ if (source[source.length - 1] !== '>')
115
+ onError('Verbatim tags must end with a >');
116
+ return verbatim;
117
+ }
118
+ const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);
119
+ if (!suffix)
120
+ onError(`The ${source} tag has no suffix`);
121
+ const prefix = this.tags[handle];
122
+ if (prefix)
123
+ return prefix + decodeURIComponent(suffix);
124
+ if (handle === '!')
125
+ return source; // local tag
126
+ onError(`Could not resolve tag: ${source}`);
127
+ return null;
128
+ }
129
+ /**
130
+ * Given a fully resolved tag, returns its printable string form,
131
+ * taking into account current tag prefixes and defaults.
132
+ */
133
+ tagString(tag) {
134
+ for (const [handle, prefix] of Object.entries(this.tags)) {
135
+ if (tag.startsWith(prefix))
136
+ return handle + escapeTagName(tag.substring(prefix.length));
137
+ }
138
+ return tag[0] === '!' ? tag : `!<${tag}>`;
139
+ }
140
+ toString(doc) {
141
+ const lines = this.yaml.explicit
142
+ ? [`%YAML ${this.yaml.version || '1.2'}`]
143
+ : [];
144
+ const tagEntries = Object.entries(this.tags);
145
+ let tagNames;
146
+ if (doc && tagEntries.length > 0 && Node.isNode(doc.contents)) {
147
+ const tags = {};
148
+ visit.visit(doc.contents, (_key, node) => {
149
+ if (Node.isNode(node) && node.tag)
150
+ tags[node.tag] = true;
151
+ });
152
+ tagNames = Object.keys(tags);
153
+ }
154
+ else
155
+ tagNames = [];
156
+ for (const [handle, prefix] of tagEntries) {
157
+ if (handle === '!!' && prefix === 'tag:yaml.org,2002:')
158
+ continue;
159
+ if (!doc || tagNames.some(tn => tn.startsWith(prefix)))
160
+ lines.push(`%TAG ${handle} ${prefix}`);
161
+ }
162
+ return lines.join('\n');
163
+ }
164
+ }
165
+ Directives.defaultYaml = { explicit: false, version: '1.2' };
166
+ Directives.defaultTags = { '!!': 'tag:yaml.org,2002:' };
167
+
168
+ exports.Directives = Directives;
@@ -0,0 +1,21 @@
1
+ import type { LineCounter } from './parse/line-counter';
2
+ export declare type ErrorCode = 'ALIAS_PROPS' | 'BAD_ALIAS' | 'BAD_DIRECTIVE' | 'BAD_DQ_ESCAPE' | 'BAD_INDENT' | 'BAD_PROP_ORDER' | 'BAD_SCALAR_START' | 'BLOCK_AS_IMPLICIT_KEY' | 'BLOCK_IN_FLOW' | 'DUPLICATE_KEY' | 'IMPOSSIBLE' | 'KEY_OVER_1024_CHARS' | 'MISSING_CHAR' | 'MULTILINE_IMPLICIT_KEY' | 'MULTIPLE_ANCHORS' | 'MULTIPLE_DOCS' | 'MULTIPLE_TAGS' | 'TAB_AS_INDENT' | 'TAG_RESOLVE_FAILED' | 'UNEXPECTED_TOKEN';
3
+ export declare type LinePos = {
4
+ line: number;
5
+ col: number;
6
+ };
7
+ export declare class YAMLError extends Error {
8
+ name: 'YAMLParseError' | 'YAMLWarning';
9
+ code: ErrorCode;
10
+ message: string;
11
+ pos: [number, number];
12
+ linePos?: [LinePos] | [LinePos, LinePos];
13
+ constructor(name: YAMLError['name'], pos: [number, number], code: ErrorCode, message: string);
14
+ }
15
+ export declare class YAMLParseError extends YAMLError {
16
+ constructor(pos: [number, number], code: ErrorCode, message: string);
17
+ }
18
+ export declare class YAMLWarning extends YAMLError {
19
+ constructor(pos: [number, number], code: ErrorCode, message: string);
20
+ }
21
+ export declare const prettifyError: (src: string, lc: LineCounter) => (error: YAMLError) => void;
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ class YAMLError extends Error {
4
+ constructor(name, pos, code, message) {
5
+ super();
6
+ this.name = name;
7
+ this.code = code;
8
+ this.message = message;
9
+ this.pos = pos;
10
+ }
11
+ }
12
+ class YAMLParseError extends YAMLError {
13
+ constructor(pos, code, message) {
14
+ super('YAMLParseError', pos, code, message);
15
+ }
16
+ }
17
+ class YAMLWarning extends YAMLError {
18
+ constructor(pos, code, message) {
19
+ super('YAMLWarning', pos, code, message);
20
+ }
21
+ }
22
+ const prettifyError = (src, lc) => (error) => {
23
+ if (error.pos[0] === -1)
24
+ return;
25
+ error.linePos = error.pos.map(pos => lc.linePos(pos));
26
+ const { line, col } = error.linePos[0];
27
+ error.message += ` at line ${line}, column ${col}`;
28
+ let ci = col - 1;
29
+ let lineStr = src
30
+ .substring(lc.lineStarts[line - 1], lc.lineStarts[line])
31
+ .replace(/[\n\r]+$/, '');
32
+ // Trim to max 80 chars, keeping col position near the middle
33
+ if (ci >= 60 && lineStr.length > 80) {
34
+ const trimStart = Math.min(ci - 39, lineStr.length - 79);
35
+ lineStr = '…' + lineStr.substring(trimStart);
36
+ ci -= trimStart - 1;
37
+ }
38
+ if (lineStr.length > 80)
39
+ lineStr = lineStr.substring(0, 79) + '…';
40
+ // Include previous line in context if pointing at line start
41
+ if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {
42
+ // Regexp won't match if start is trimmed
43
+ let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
44
+ if (prev.length > 80)
45
+ prev = prev.substring(0, 79) + '…\n';
46
+ lineStr = prev + lineStr;
47
+ }
48
+ if (/[^ ]/.test(lineStr)) {
49
+ let count = 1;
50
+ const end = error.linePos[1];
51
+ if (end && end.line === line && end.col > col) {
52
+ count = Math.min(end.col - col, 80 - ci);
53
+ }
54
+ const pointer = ' '.repeat(ci) + '^'.repeat(count);
55
+ error.message += `:\n\n${lineStr}\n${pointer}\n`;
56
+ }
57
+ };
58
+
59
+ exports.YAMLError = YAMLError;
60
+ exports.YAMLParseError = YAMLParseError;
61
+ exports.YAMLWarning = YAMLWarning;
62
+ exports.prettifyError = prettifyError;
@@ -0,0 +1,19 @@
1
+ export { Composer } from './compose/composer.js';
2
+ export { Document } from './doc/Document.js';
3
+ export { Schema } from './schema/Schema.js';
4
+ export { ErrorCode, YAMLError, YAMLParseError, YAMLWarning } from './errors.js';
5
+ export { Alias } from './nodes/Alias.js';
6
+ export { isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq, Node, ParsedNode, Range } from './nodes/Node.js';
7
+ export { Pair } from './nodes/Pair.js';
8
+ export { Scalar } from './nodes/Scalar.js';
9
+ export { YAMLMap } from './nodes/YAMLMap.js';
10
+ export { YAMLSeq } from './nodes/YAMLSeq.js';
11
+ export { CreateNodeOptions, defaultOptions, DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, ToStringOptions } from './options.js';
12
+ export * as CST from './parse/cst.js';
13
+ export { Lexer } from './parse/lexer.js';
14
+ export { LineCounter } from './parse/line-counter.js';
15
+ export { Parser } from './parse/parser.js';
16
+ export { EmptyStream, parse, parseAllDocuments, parseDocument, stringify } from './public-api.js';
17
+ export type { TagId, Tags } from './schema/tags';
18
+ export type { CollectionTag, ScalarTag } from './schema/types';
19
+ export { visit, visitor, visitorFn } from './visit.js';
@@ -1,79 +1,51 @@
1
1
  'use strict';
2
2
 
3
- var parseCst = require('./parse-cst.js');
4
- var Document$1 = require('./Document-9b4560a1.js');
5
- var Schema = require('./Schema-88e323a7.js');
6
- var PlainValue = require('./PlainValue-ec8e588e.js');
7
- var warnings = require('./warnings-1000a372.js');
8
- require('./resolveSeq-d03cb037.js');
9
-
10
- function createNode(value, wrapScalars = true, tag) {
11
- if (tag === undefined && typeof wrapScalars === 'string') {
12
- tag = wrapScalars;
13
- wrapScalars = true;
14
- }
15
-
16
- const options = Object.assign({}, Document$1.Document.defaults[Document$1.defaultOptions.version], Document$1.defaultOptions);
17
- const schema = new Schema.Schema(options);
18
- return schema.createNode(value, wrapScalars, tag);
19
- }
20
-
21
- class Document extends Document$1.Document {
22
- constructor(options) {
23
- super(Object.assign({}, Document$1.defaultOptions, options));
24
- }
25
-
26
- }
27
-
28
- function parseAllDocuments(src, options) {
29
- const stream = [];
30
- let prev;
31
-
32
- for (const cstDoc of parseCst.parse(src)) {
33
- const doc = new Document(options);
34
- doc.parse(cstDoc, prev);
35
- stream.push(doc);
36
- prev = doc;
37
- }
38
-
39
- return stream;
40
- }
41
-
42
- function parseDocument(src, options) {
43
- const cst = parseCst.parse(src);
44
- const doc = new Document(options).parse(cst[0]);
45
-
46
- if (cst.length > 1) {
47
- const errMsg = 'Source contains multiple documents; please use YAML.parseAllDocuments()';
48
- doc.errors.unshift(new PlainValue.YAMLSemanticError(cst[1], errMsg));
49
- }
50
-
51
- return doc;
52
- }
53
-
54
- function parse(src, options) {
55
- const doc = parseDocument(src, options);
56
- doc.warnings.forEach(warning => warnings.warn(warning));
57
- if (doc.errors.length > 0) throw doc.errors[0];
58
- return doc.toJSON();
59
- }
60
-
61
- function stringify(value, options) {
62
- const doc = new Document(options);
63
- doc.contents = value;
64
- return String(doc);
65
- }
66
-
67
- const YAML = {
68
- createNode,
69
- defaultOptions: Document$1.defaultOptions,
70
- Document,
71
- parse,
72
- parseAllDocuments,
73
- parseCST: parseCst.parse,
74
- parseDocument,
75
- scalarOptions: Document$1.scalarOptions,
76
- stringify
77
- };
78
-
79
- exports.YAML = YAML;
3
+ var composer = require('./compose/composer.js');
4
+ var Document = require('./doc/Document.js');
5
+ var Schema = require('./schema/Schema.js');
6
+ var errors = require('./errors.js');
7
+ var Alias = require('./nodes/Alias.js');
8
+ var Node = require('./nodes/Node.js');
9
+ var Pair = require('./nodes/Pair.js');
10
+ var Scalar = require('./nodes/Scalar.js');
11
+ var YAMLMap = require('./nodes/YAMLMap.js');
12
+ var YAMLSeq = require('./nodes/YAMLSeq.js');
13
+ var options = require('./options.js');
14
+ var cst = require('./parse/cst.js');
15
+ var lexer = require('./parse/lexer.js');
16
+ var lineCounter = require('./parse/line-counter.js');
17
+ var parser = require('./parse/parser.js');
18
+ var publicApi = require('./public-api.js');
19
+ var visit = require('./visit.js');
20
+
21
+
22
+
23
+ exports.Composer = composer.Composer;
24
+ exports.Document = Document.Document;
25
+ exports.Schema = Schema.Schema;
26
+ exports.YAMLError = errors.YAMLError;
27
+ exports.YAMLParseError = errors.YAMLParseError;
28
+ exports.YAMLWarning = errors.YAMLWarning;
29
+ exports.Alias = Alias.Alias;
30
+ exports.isAlias = Node.isAlias;
31
+ exports.isCollection = Node.isCollection;
32
+ exports.isDocument = Node.isDocument;
33
+ exports.isMap = Node.isMap;
34
+ exports.isNode = Node.isNode;
35
+ exports.isPair = Node.isPair;
36
+ exports.isScalar = Node.isScalar;
37
+ exports.isSeq = Node.isSeq;
38
+ exports.Pair = Pair.Pair;
39
+ exports.Scalar = Scalar.Scalar;
40
+ exports.YAMLMap = YAMLMap.YAMLMap;
41
+ exports.YAMLSeq = YAMLSeq.YAMLSeq;
42
+ exports.defaultOptions = options.defaultOptions;
43
+ exports.CST = cst;
44
+ exports.Lexer = lexer.Lexer;
45
+ exports.LineCounter = lineCounter.LineCounter;
46
+ exports.Parser = parser.Parser;
47
+ exports.parse = publicApi.parse;
48
+ exports.parseAllDocuments = publicApi.parseAllDocuments;
49
+ exports.parseDocument = publicApi.parseDocument;
50
+ exports.stringify = publicApi.stringify;
51
+ exports.visit = visit.visit;
@@ -0,0 +1,3 @@
1
+ export declare type LogLevelId = 'silent' | 'error' | 'warn' | 'debug';
2
+ export declare function debug(logLevel: LogLevelId, ...messages: any[]): void;
3
+ export declare function warn(logLevel: LogLevelId, warning: string | Error): void;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ function debug(logLevel, ...messages) {
4
+ if (logLevel === 'debug')
5
+ console.log(...messages);
6
+ }
7
+ function warn(logLevel, warning) {
8
+ if (logLevel === 'debug' || logLevel === 'warn') {
9
+ if (typeof process !== 'undefined' && process.emitWarning)
10
+ process.emitWarning(warning);
11
+ else
12
+ console.warn(warning);
13
+ }
14
+ }
15
+
16
+ exports.debug = debug;
17
+ exports.warn = warn;
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ /*! *****************************************************************************
4
+ Copyright (c) Microsoft Corporation.
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
16
+ ***************************************************************************** */
17
+ /* global Reflect, Promise */
18
+
19
+ var extendStatics = function(d, b) {
20
+ extendStatics = Object.setPrototypeOf ||
21
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
22
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
23
+ return extendStatics(d, b);
24
+ };
25
+
26
+ function __extends(d, b) {
27
+ if (typeof b !== "function" && b !== null)
28
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
29
+ extendStatics(d, b);
30
+ function __() { this.constructor = d; }
31
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
32
+ }
33
+
34
+ function __generator(thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (_) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ }
61
+
62
+ function __values(o) {
63
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
64
+ if (m) return m.call(o);
65
+ if (o && typeof o.length === "number") return {
66
+ next: function () {
67
+ if (o && i >= o.length) o = void 0;
68
+ return { value: o && o[i++], done: !o };
69
+ }
70
+ };
71
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
72
+ }
73
+
74
+ exports.__extends = __extends;
75
+ exports.__generator = __generator;
76
+ exports.__values = __values;
@@ -0,0 +1,28 @@
1
+ import type { Document } from '../doc/Document.js';
2
+ import type { FlowScalar } from '../parse/cst.js';
3
+ import type { StringifyContext } from '../stringify/stringify.js';
4
+ import { NodeBase, Range } from './Node.js';
5
+ import type { Scalar } from './Scalar';
6
+ import type { ToJSContext } from './toJS.js';
7
+ import type { YAMLMap } from './YAMLMap.js';
8
+ import type { YAMLSeq } from './YAMLSeq.js';
9
+ export declare namespace Alias {
10
+ interface Parsed extends Alias {
11
+ range: Range;
12
+ srcToken?: FlowScalar & {
13
+ type: 'alias';
14
+ };
15
+ }
16
+ }
17
+ export declare class Alias extends NodeBase {
18
+ source: string;
19
+ anchor?: never;
20
+ constructor(source: string);
21
+ /**
22
+ * Resolve the value of this alias within `doc`, finding the last
23
+ * instance of the `source` anchor before this node.
24
+ */
25
+ resolve(doc: Document): Scalar | YAMLMap | YAMLSeq | undefined;
26
+ toJSON(_arg?: unknown, ctx?: ToJSContext): unknown;
27
+ toString(ctx?: StringifyContext, _onComment?: () => void, _onChompKeep?: () => void): string;
28
+ }
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ var anchors = require('../doc/anchors.js');
4
+ var visit = require('../visit.js');
5
+ var Node = require('./Node.js');
6
+
7
+ class Alias extends Node.NodeBase {
8
+ constructor(source) {
9
+ super(Node.ALIAS);
10
+ this.source = source;
11
+ Object.defineProperty(this, 'tag', {
12
+ set() {
13
+ throw new Error('Alias nodes cannot have tags');
14
+ }
15
+ });
16
+ }
17
+ /**
18
+ * Resolve the value of this alias within `doc`, finding the last
19
+ * instance of the `source` anchor before this node.
20
+ */
21
+ resolve(doc) {
22
+ let found = undefined;
23
+ visit.visit(doc, {
24
+ Node: (_key, node) => {
25
+ if (node === this)
26
+ return visit.visit.BREAK;
27
+ if (node.anchor === this.source)
28
+ found = node;
29
+ }
30
+ });
31
+ return found;
32
+ }
33
+ toJSON(_arg, ctx) {
34
+ if (!ctx)
35
+ return { source: this.source };
36
+ const { anchors, doc, maxAliasCount } = ctx;
37
+ const source = this.resolve(doc);
38
+ if (!source) {
39
+ const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
40
+ throw new ReferenceError(msg);
41
+ }
42
+ const data = anchors.get(source);
43
+ /* istanbul ignore if */
44
+ if (!data || data.res === undefined) {
45
+ const msg = 'This should not happen: Alias anchor was not resolved?';
46
+ throw new ReferenceError(msg);
47
+ }
48
+ if (maxAliasCount >= 0) {
49
+ data.count += 1;
50
+ if (data.aliasCount === 0)
51
+ data.aliasCount = getAliasCount(doc, source, anchors);
52
+ if (data.count * data.aliasCount > maxAliasCount) {
53
+ const msg = 'Excessive alias count indicates a resource exhaustion attack';
54
+ throw new ReferenceError(msg);
55
+ }
56
+ }
57
+ return data.res;
58
+ }
59
+ toString(ctx, _onComment, _onChompKeep) {
60
+ const src = `*${this.source}`;
61
+ if (ctx) {
62
+ anchors.anchorIsValid(this.source);
63
+ if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
64
+ const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
65
+ throw new Error(msg);
66
+ }
67
+ if (ctx.implicitKey)
68
+ return `${src} `;
69
+ }
70
+ return src;
71
+ }
72
+ }
73
+ function getAliasCount(doc, node, anchors) {
74
+ if (Node.isAlias(node)) {
75
+ const source = node.resolve(doc);
76
+ const anchor = anchors && source && anchors.get(source);
77
+ return anchor ? anchor.count * anchor.aliasCount : 0;
78
+ }
79
+ else if (Node.isCollection(node)) {
80
+ let count = 0;
81
+ for (const item of node.items) {
82
+ const c = getAliasCount(doc, item, anchors);
83
+ if (c > count)
84
+ count = c;
85
+ }
86
+ return count;
87
+ }
88
+ else if (Node.isPair(node)) {
89
+ const kc = getAliasCount(doc, node.key, anchors);
90
+ const vc = getAliasCount(doc, node.value, anchors);
91
+ return Math.max(kc, vc);
92
+ }
93
+ return 1;
94
+ }
95
+
96
+ exports.Alias = Alias;