projen 0.51.7 → 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 (385) hide show
  1. package/.jsii +42 -6
  2. package/API.md +10 -0
  3. package/changelog.md +1 -6
  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 +1 -1
  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.js +1 -1
  37. package/lib/github/task-workflow.js +1 -1
  38. package/lib/github/workflows.js +1 -1
  39. package/lib/gitlab/configuration.js +1 -1
  40. package/lib/gitlab/gitlab-configuration.js +1 -1
  41. package/lib/gitlab/nested-configuration.js +1 -1
  42. package/lib/gitpod.js +1 -1
  43. package/lib/ignore-file.js +1 -1
  44. package/lib/ini.js +1 -1
  45. package/lib/java/java-project.js +1 -1
  46. package/lib/java/junit.js +1 -1
  47. package/lib/java/maven-compile.js +1 -1
  48. package/lib/java/maven-packaging.js +1 -1
  49. package/lib/java/maven-sample.js +1 -1
  50. package/lib/java/pom.js +1 -1
  51. package/lib/java/projenrc.js +1 -1
  52. package/lib/javascript/bundler.js +1 -1
  53. package/lib/javascript/eslint.js +1 -1
  54. package/lib/javascript/jest.js +1 -1
  55. package/lib/javascript/node-package.js +1 -1
  56. package/lib/javascript/node-project.js +1 -1
  57. package/lib/javascript/npm-config.js +1 -1
  58. package/lib/javascript/prettier.js +1 -1
  59. package/lib/javascript/projenrc.js +1 -1
  60. package/lib/javascript/typescript-config.js +1 -1
  61. package/lib/javascript/upgrade-dependencies.js +2 -2
  62. package/lib/json.js +1 -1
  63. package/lib/license.js +1 -1
  64. package/lib/logger.js +1 -1
  65. package/lib/makefile.js +1 -1
  66. package/lib/object-file.js +1 -1
  67. package/lib/project-build.js +1 -1
  68. package/lib/project.js +1 -1
  69. package/lib/projects.js +1 -1
  70. package/lib/projenrc-json.js +1 -1
  71. package/lib/python/pip.js +1 -1
  72. package/lib/python/poetry.js +2 -2
  73. package/lib/python/projenrc.js +1 -1
  74. package/lib/python/pytest.js +1 -1
  75. package/lib/python/python-project.js +1 -1
  76. package/lib/python/python-sample.js +1 -1
  77. package/lib/python/requirements-file.js +1 -1
  78. package/lib/python/setuppy.js +1 -1
  79. package/lib/python/setuptools.js +1 -1
  80. package/lib/python/venv.js +1 -1
  81. package/lib/readme.js +1 -1
  82. package/lib/release/publisher.js +1 -1
  83. package/lib/release/release-trigger.js +1 -1
  84. package/lib/release/release.js +1 -1
  85. package/lib/sample-file.js +2 -2
  86. package/lib/semver.js +1 -1
  87. package/lib/source-code.js +1 -1
  88. package/lib/task-runtime.js +1 -1
  89. package/lib/task.js +1 -1
  90. package/lib/tasks.js +1 -1
  91. package/lib/testing.js +1 -1
  92. package/lib/textfile.js +1 -1
  93. package/lib/toml.js +1 -1
  94. package/lib/typescript/projenrc.js +1 -1
  95. package/lib/typescript/typescript-typedoc.js +1 -1
  96. package/lib/typescript/typescript.js +3 -3
  97. package/lib/version.js +1 -1
  98. package/lib/vscode/devcontainer.js +1 -1
  99. package/lib/vscode/launch-config.js +1 -1
  100. package/lib/vscode/vscode.js +1 -1
  101. package/lib/web/next.js +3 -3
  102. package/lib/web/postcss.js +1 -1
  103. package/lib/web/react.js +4 -4
  104. package/lib/web/tailwind.js +1 -1
  105. package/lib/xmlfile.js +1 -1
  106. package/lib/yaml.d.ts +13 -0
  107. package/lib/yaml.js +8 -3
  108. package/node_modules/yaml/LICENSE +1 -1
  109. package/node_modules/yaml/README.md +57 -41
  110. package/node_modules/yaml/browser/dist/compose/compose-collection.js +59 -0
  111. package/node_modules/yaml/browser/dist/compose/compose-doc.js +40 -0
  112. package/node_modules/yaml/browser/dist/compose/compose-node.js +81 -0
  113. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +81 -0
  114. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  115. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +107 -0
  116. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +185 -0
  117. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +45 -0
  118. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  119. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +200 -0
  120. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
  121. package/node_modules/yaml/browser/dist/compose/resolve-props.js +128 -0
  122. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  123. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
  124. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  125. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +17 -0
  126. package/node_modules/yaml/browser/dist/doc/Document.js +321 -0
  127. package/node_modules/yaml/browser/dist/doc/anchors.js +72 -0
  128. package/node_modules/yaml/browser/dist/doc/applyReviver.js +54 -0
  129. package/node_modules/yaml/browser/dist/doc/createNode.js +84 -0
  130. package/node_modules/yaml/browser/dist/doc/directives.js +166 -0
  131. package/node_modules/yaml/browser/dist/errors.js +57 -0
  132. package/node_modules/yaml/browser/dist/index.js +18 -1002
  133. package/node_modules/yaml/browser/dist/log.js +14 -0
  134. package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +164 -0
  135. package/node_modules/yaml/browser/dist/nodes/Alias.js +94 -0
  136. package/node_modules/yaml/browser/dist/nodes/Collection.js +146 -0
  137. package/node_modules/yaml/browser/dist/nodes/Node.js +48 -0
  138. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  139. package/node_modules/yaml/browser/dist/nodes/Scalar.js +23 -0
  140. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +116 -0
  141. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +105 -0
  142. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +104 -0
  143. package/node_modules/yaml/browser/dist/nodes/toJS.js +35 -0
  144. package/node_modules/yaml/browser/dist/options.js +18 -0
  145. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +215 -0
  146. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  147. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  148. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  149. package/node_modules/yaml/browser/dist/parse/lexer.js +692 -0
  150. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  151. package/node_modules/yaml/browser/dist/parse/parser.js +882 -0
  152. package/node_modules/yaml/browser/dist/public-api.js +99 -0
  153. package/node_modules/yaml/browser/dist/schema/Schema.js +34 -0
  154. package/node_modules/yaml/browser/dist/schema/common/map.js +42 -0
  155. package/node_modules/yaml/browser/dist/schema/common/null.js +13 -0
  156. package/node_modules/yaml/browser/dist/schema/common/seq.js +33 -0
  157. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  158. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  159. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  160. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  161. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  162. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  163. package/node_modules/yaml/browser/dist/schema/tags.js +83 -0
  164. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +66 -0
  165. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  166. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  167. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  168. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +73 -0
  169. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +77 -0
  170. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +37 -0
  171. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +87 -0
  172. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  173. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +135 -0
  174. package/node_modules/yaml/browser/dist/stringify/stringify.js +124 -0
  175. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +152 -0
  176. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +18 -0
  177. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +68 -0
  178. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
  179. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +122 -0
  180. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +314 -0
  181. package/node_modules/yaml/browser/dist/util.js +9 -2
  182. package/node_modules/yaml/browser/dist/visit.js +146 -0
  183. package/node_modules/yaml/browser/index.js +5 -1
  184. package/node_modules/yaml/browser/package.json +3 -0
  185. package/node_modules/yaml/dist/compose/compose-collection.d.ts +5 -0
  186. package/node_modules/yaml/dist/compose/compose-collection.js +61 -0
  187. package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -0
  188. package/node_modules/yaml/dist/compose/compose-doc.js +42 -0
  189. package/node_modules/yaml/dist/compose/compose-node.d.ts +26 -0
  190. package/node_modules/yaml/dist/compose/compose-node.js +84 -0
  191. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  192. package/node_modules/yaml/dist/compose/compose-scalar.js +83 -0
  193. package/node_modules/yaml/dist/compose/composer.d.ts +62 -0
  194. package/node_modules/yaml/dist/compose/composer.js +223 -0
  195. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  196. package/node_modules/yaml/dist/compose/resolve-block-map.js +109 -0
  197. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +10 -0
  198. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +187 -0
  199. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -0
  200. package/node_modules/yaml/dist/compose/resolve-block-seq.js +47 -0
  201. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  202. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  203. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +6 -0
  204. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +202 -0
  205. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  206. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
  207. package/node_modules/yaml/dist/compose/resolve-props.d.ts +21 -0
  208. package/node_modules/yaml/dist/compose/resolve-props.js +130 -0
  209. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  210. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  211. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  212. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +29 -0
  213. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  214. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  215. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  216. package/node_modules/yaml/dist/compose/util-map-includes.js +19 -0
  217. package/node_modules/yaml/dist/doc/Document.d.ts +139 -0
  218. package/node_modules/yaml/dist/doc/Document.js +323 -0
  219. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  220. package/node_modules/yaml/dist/doc/anchors.js +77 -0
  221. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  222. package/node_modules/yaml/dist/doc/applyReviver.js +56 -0
  223. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  224. package/node_modules/yaml/dist/doc/createNode.js +86 -0
  225. package/node_modules/yaml/dist/doc/directives.d.ts +47 -0
  226. package/node_modules/yaml/dist/doc/directives.js +168 -0
  227. package/node_modules/yaml/dist/errors.d.ts +21 -0
  228. package/node_modules/yaml/dist/errors.js +62 -0
  229. package/node_modules/yaml/dist/index.d.ts +19 -0
  230. package/node_modules/yaml/dist/index.js +49 -77
  231. package/node_modules/yaml/dist/log.d.ts +3 -0
  232. package/node_modules/yaml/dist/log.js +17 -0
  233. package/node_modules/yaml/dist/node_modules/tslib/tslib.es6.js +76 -0
  234. package/node_modules/yaml/dist/nodes/Alias.d.ts +28 -0
  235. package/node_modules/yaml/dist/nodes/Alias.js +96 -0
  236. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  237. package/node_modules/yaml/dist/nodes/Collection.js +150 -0
  238. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  239. package/node_modules/yaml/dist/nodes/Node.js +66 -0
  240. package/node_modules/yaml/dist/nodes/Pair.d.ts +21 -0
  241. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  242. package/node_modules/yaml/dist/nodes/Scalar.d.ts +42 -0
  243. package/node_modules/yaml/dist/nodes/Scalar.js +26 -0
  244. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +41 -0
  245. package/node_modules/yaml/dist/nodes/YAMLMap.js +119 -0
  246. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +55 -0
  247. package/node_modules/yaml/dist/nodes/YAMLSeq.js +107 -0
  248. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -0
  249. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +106 -0
  250. package/node_modules/yaml/dist/nodes/toJS.d.ts +30 -0
  251. package/node_modules/yaml/dist/nodes/toJS.js +37 -0
  252. package/node_modules/yaml/dist/options.d.ts +338 -0
  253. package/node_modules/yaml/dist/options.js +20 -0
  254. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  255. package/node_modules/yaml/dist/parse/cst-scalar.js +219 -0
  256. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  257. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  258. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  259. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  260. package/node_modules/yaml/dist/parse/cst.d.ts +106 -0
  261. package/node_modules/yaml/dist/parse/cst.js +112 -0
  262. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  263. package/node_modules/yaml/dist/parse/lexer.js +694 -0
  264. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  265. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  266. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  267. package/node_modules/yaml/dist/parse/parser.js +886 -0
  268. package/node_modules/yaml/dist/public-api.d.ts +43 -0
  269. package/node_modules/yaml/dist/public-api.js +104 -0
  270. package/node_modules/yaml/dist/schema/Schema.d.ts +18 -0
  271. package/node_modules/yaml/dist/schema/Schema.js +36 -0
  272. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  273. package/node_modules/yaml/dist/schema/common/map.js +44 -0
  274. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  275. package/node_modules/yaml/dist/schema/common/null.js +15 -0
  276. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  277. package/node_modules/yaml/dist/schema/common/seq.js +35 -0
  278. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  279. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  280. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  281. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  282. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  283. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  284. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  285. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  286. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  287. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  288. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  289. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  290. package/node_modules/yaml/dist/schema/tags.d.ts +40 -0
  291. package/node_modules/yaml/dist/schema/tags.js +86 -0
  292. package/node_modules/yaml/dist/schema/types.d.ts +82 -0
  293. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  294. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
  295. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  296. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  297. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  298. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  299. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  300. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  301. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +21 -0
  302. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +76 -0
  303. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  304. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +81 -0
  305. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  306. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +39 -0
  307. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +22 -0
  308. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +90 -0
  309. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  310. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  311. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  312. package/node_modules/yaml/dist/stringify/foldFlowLines.js +140 -0
  313. package/node_modules/yaml/dist/stringify/stringify.d.ts +20 -0
  314. package/node_modules/yaml/dist/stringify/stringify.js +127 -0
  315. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  316. package/node_modules/yaml/dist/stringify/stringifyCollection.js +154 -0
  317. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  318. package/node_modules/yaml/dist/stringify/stringifyComment.js +22 -0
  319. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -0
  320. package/node_modules/yaml/dist/stringify/stringifyDocument.js +70 -0
  321. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  322. package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
  323. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  324. package/node_modules/yaml/dist/stringify/stringifyPair.js +124 -0
  325. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +3 -0
  326. package/node_modules/yaml/dist/stringify/stringifyString.js +316 -0
  327. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  328. package/node_modules/yaml/dist/test-events.js +126 -152
  329. package/node_modules/yaml/dist/util.d.ts +9 -0
  330. package/node_modules/yaml/dist/util.js +19 -14
  331. package/node_modules/yaml/dist/visit.d.ts +63 -0
  332. package/node_modules/yaml/dist/visit.js +148 -0
  333. package/node_modules/yaml/package.json +43 -55
  334. package/node_modules/yaml/util.d.ts +3 -86
  335. package/node_modules/yaml/util.js +2 -16
  336. package/package.json +2 -2
  337. package/releasetag.txt +1 -1
  338. package/version.txt +1 -1
  339. package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +0 -1275
  340. package/node_modules/yaml/browser/dist/Schema-e94716c8.js +0 -682
  341. package/node_modules/yaml/browser/dist/legacy-exports.js +0 -3
  342. package/node_modules/yaml/browser/dist/package.json +0 -1
  343. package/node_modules/yaml/browser/dist/parse-cst.js +0 -1904
  344. package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +0 -2419
  345. package/node_modules/yaml/browser/dist/types.js +0 -4
  346. package/node_modules/yaml/browser/dist/warnings-df54cb69.js +0 -499
  347. package/node_modules/yaml/browser/map.js +0 -2
  348. package/node_modules/yaml/browser/pair.js +0 -2
  349. package/node_modules/yaml/browser/parse-cst.js +0 -1
  350. package/node_modules/yaml/browser/scalar.js +0 -2
  351. package/node_modules/yaml/browser/schema.js +0 -9
  352. package/node_modules/yaml/browser/seq.js +0 -2
  353. package/node_modules/yaml/browser/types/binary.js +0 -8
  354. package/node_modules/yaml/browser/types/omap.js +0 -3
  355. package/node_modules/yaml/browser/types/pairs.js +0 -3
  356. package/node_modules/yaml/browser/types/set.js +0 -3
  357. package/node_modules/yaml/browser/types/timestamp.js +0 -10
  358. package/node_modules/yaml/browser/types.js +0 -1
  359. package/node_modules/yaml/browser/util.js +0 -1
  360. package/node_modules/yaml/dist/Document-9b4560a1.js +0 -757
  361. package/node_modules/yaml/dist/PlainValue-ec8e588e.js +0 -876
  362. package/node_modules/yaml/dist/Schema-88e323a7.js +0 -525
  363. package/node_modules/yaml/dist/legacy-exports.js +0 -16
  364. package/node_modules/yaml/dist/parse-cst.js +0 -1753
  365. package/node_modules/yaml/dist/resolveSeq-d03cb037.js +0 -2161
  366. package/node_modules/yaml/dist/types.js +0 -23
  367. package/node_modules/yaml/dist/warnings-1000a372.js +0 -416
  368. package/node_modules/yaml/index.d.ts +0 -372
  369. package/node_modules/yaml/index.js +0 -1
  370. package/node_modules/yaml/map.js +0 -2
  371. package/node_modules/yaml/pair.js +0 -2
  372. package/node_modules/yaml/parse-cst.d.ts +0 -191
  373. package/node_modules/yaml/parse-cst.js +0 -1
  374. package/node_modules/yaml/scalar.js +0 -2
  375. package/node_modules/yaml/schema.js +0 -9
  376. package/node_modules/yaml/seq.js +0 -2
  377. package/node_modules/yaml/types/binary.js +0 -8
  378. package/node_modules/yaml/types/omap.js +0 -3
  379. package/node_modules/yaml/types/pairs.js +0 -3
  380. package/node_modules/yaml/types/set.js +0 -3
  381. package/node_modules/yaml/types/timestamp.js +0 -10
  382. package/node_modules/yaml/types.d.ts +0 -407
  383. package/node_modules/yaml/types.js +0 -17
  384. package/node_modules/yaml/types.mjs +0 -17
  385. package/node_modules/yaml/util.mjs +0 -18
@@ -0,0 +1,692 @@
1
+ import { BOM, DOCUMENT, FLOW_END, SCALAR } from './cst.js';
2
+
3
+ /*
4
+ START -> stream
5
+
6
+ stream
7
+ directive -> line-end -> stream
8
+ indent + line-end -> stream
9
+ [else] -> line-start
10
+
11
+ line-end
12
+ comment -> line-end
13
+ newline -> .
14
+ input-end -> END
15
+
16
+ line-start
17
+ doc-start -> doc
18
+ doc-end -> stream
19
+ [else] -> indent -> block-start
20
+
21
+ block-start
22
+ seq-item-start -> block-start
23
+ explicit-key-start -> block-start
24
+ map-value-start -> block-start
25
+ [else] -> doc
26
+
27
+ doc
28
+ line-end -> line-start
29
+ spaces -> doc
30
+ anchor -> doc
31
+ tag -> doc
32
+ flow-start -> flow -> doc
33
+ flow-end -> error -> doc
34
+ seq-item-start -> error -> doc
35
+ explicit-key-start -> error -> doc
36
+ map-value-start -> doc
37
+ alias -> doc
38
+ quote-start -> quoted-scalar -> doc
39
+ block-scalar-header -> line-end -> block-scalar(min) -> line-start
40
+ [else] -> plain-scalar(false, min) -> doc
41
+
42
+ flow
43
+ line-end -> flow
44
+ spaces -> flow
45
+ anchor -> flow
46
+ tag -> flow
47
+ flow-start -> flow -> flow
48
+ flow-end -> .
49
+ seq-item-start -> error -> flow
50
+ explicit-key-start -> flow
51
+ map-value-start -> flow
52
+ alias -> flow
53
+ quote-start -> quoted-scalar -> flow
54
+ comma -> flow
55
+ [else] -> plain-scalar(true, 0) -> flow
56
+
57
+ quoted-scalar
58
+ quote-end -> .
59
+ [else] -> quoted-scalar
60
+
61
+ block-scalar(min)
62
+ newline + peek(indent < min) -> .
63
+ [else] -> block-scalar(min)
64
+
65
+ plain-scalar(is-flow, min)
66
+ scalar-end(is-flow) -> .
67
+ peek(newline + (indent < min)) -> .
68
+ [else] -> plain-scalar(min)
69
+ */
70
+ function isEmpty(ch) {
71
+ switch (ch) {
72
+ case undefined:
73
+ case ' ':
74
+ case '\n':
75
+ case '\r':
76
+ case '\t':
77
+ return true;
78
+ default:
79
+ return false;
80
+ }
81
+ }
82
+ const hexDigits = '0123456789ABCDEFabcdef'.split('');
83
+ const tagChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split('');
84
+ const invalidFlowScalarChars = ',[]{}'.split('');
85
+ const invalidAnchorChars = ' ,[]{}\n\r\t'.split('');
86
+ const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.includes(ch);
87
+ /**
88
+ * Splits an input string into lexical tokens, i.e. smaller strings that are
89
+ * easily identifiable by `tokens.tokenType()`.
90
+ *
91
+ * Lexing starts always in a "stream" context. Incomplete input may be buffered
92
+ * until a complete token can be emitted.
93
+ *
94
+ * In addition to slices of the original input, the following control characters
95
+ * may also be emitted:
96
+ *
97
+ * - `\x02` (Start of Text): A document starts with the next token
98
+ * - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error)
99
+ * - `\x1f` (Unit Separator): Next token is a scalar value
100
+ * - `\u{FEFF}` (Byte order mark): Emitted separately outside documents
101
+ */
102
+ class Lexer {
103
+ constructor() {
104
+ /**
105
+ * Flag indicating whether the end of the current buffer marks the end of
106
+ * all input
107
+ */
108
+ this.atEnd = false;
109
+ /**
110
+ * Explicit indent set in block scalar header, as an offset from the current
111
+ * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not
112
+ * explicitly set.
113
+ */
114
+ this.blockScalarIndent = -1;
115
+ /**
116
+ * Block scalars that include a + (keep) chomping indicator in their header
117
+ * include trailing empty lines, which are otherwise excluded from the
118
+ * scalar's contents.
119
+ */
120
+ this.blockScalarKeep = false;
121
+ /** Current input */
122
+ this.buffer = '';
123
+ /**
124
+ * Flag noting whether the map value indicator : can immediately follow this
125
+ * node within a flow context.
126
+ */
127
+ this.flowKey = false;
128
+ /** Count of surrounding flow collection levels. */
129
+ this.flowLevel = 0;
130
+ /**
131
+ * Minimum level of indentation required for next lines to be parsed as a
132
+ * part of the current scalar value.
133
+ */
134
+ this.indentNext = 0;
135
+ /** Indentation level of the current line. */
136
+ this.indentValue = 0;
137
+ /** Position of the next \n character. */
138
+ this.lineEndPos = null;
139
+ /** Stores the state of the lexer if reaching the end of incpomplete input */
140
+ this.next = null;
141
+ /** A pointer to `buffer`; the current position of the lexer. */
142
+ this.pos = 0;
143
+ }
144
+ /**
145
+ * Generate YAML tokens from the `source` string. If `incomplete`,
146
+ * a part of the last line may be left as a buffer for the next call.
147
+ *
148
+ * @returns A generator of lexical tokens
149
+ */
150
+ *lex(source, incomplete = false) {
151
+ if (source) {
152
+ this.buffer = this.buffer ? this.buffer + source : source;
153
+ this.lineEndPos = null;
154
+ }
155
+ this.atEnd = !incomplete;
156
+ let next = this.next || 'stream';
157
+ while (next && (incomplete || this.hasChars(1)))
158
+ next = yield* this.parseNext(next);
159
+ }
160
+ atLineEnd() {
161
+ let i = this.pos;
162
+ let ch = this.buffer[i];
163
+ while (ch === ' ' || ch === '\t')
164
+ ch = this.buffer[++i];
165
+ if (!ch || ch === '#' || ch === '\n')
166
+ return true;
167
+ if (ch === '\r')
168
+ return this.buffer[i + 1] === '\n';
169
+ return false;
170
+ }
171
+ charAt(n) {
172
+ return this.buffer[this.pos + n];
173
+ }
174
+ continueScalar(offset) {
175
+ let ch = this.buffer[offset];
176
+ if (this.indentNext > 0) {
177
+ let indent = 0;
178
+ while (ch === ' ')
179
+ ch = this.buffer[++indent + offset];
180
+ if (ch === '\r') {
181
+ const next = this.buffer[indent + offset + 1];
182
+ if (next === '\n' || (!next && !this.atEnd))
183
+ return offset + indent + 1;
184
+ }
185
+ return ch === '\n' || indent >= this.indentNext || (!ch && !this.atEnd)
186
+ ? offset + indent
187
+ : -1;
188
+ }
189
+ if (ch === '-' || ch === '.') {
190
+ const dt = this.buffer.substr(offset, 3);
191
+ if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))
192
+ return -1;
193
+ }
194
+ return offset;
195
+ }
196
+ getLine() {
197
+ let end = this.lineEndPos;
198
+ if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {
199
+ end = this.buffer.indexOf('\n', this.pos);
200
+ this.lineEndPos = end;
201
+ }
202
+ if (end === -1)
203
+ return this.atEnd ? this.buffer.substring(this.pos) : null;
204
+ if (this.buffer[end - 1] === '\r')
205
+ end -= 1;
206
+ return this.buffer.substring(this.pos, end);
207
+ }
208
+ hasChars(n) {
209
+ return this.pos + n <= this.buffer.length;
210
+ }
211
+ setNext(state) {
212
+ this.buffer = this.buffer.substring(this.pos);
213
+ this.pos = 0;
214
+ this.lineEndPos = null;
215
+ this.next = state;
216
+ return null;
217
+ }
218
+ peek(n) {
219
+ return this.buffer.substr(this.pos, n);
220
+ }
221
+ *parseNext(next) {
222
+ switch (next) {
223
+ case 'stream':
224
+ return yield* this.parseStream();
225
+ case 'line-start':
226
+ return yield* this.parseLineStart();
227
+ case 'block-start':
228
+ return yield* this.parseBlockStart();
229
+ case 'doc':
230
+ return yield* this.parseDocument();
231
+ case 'flow':
232
+ return yield* this.parseFlowCollection();
233
+ case 'quoted-scalar':
234
+ return yield* this.parseQuotedScalar();
235
+ case 'block-scalar':
236
+ return yield* this.parseBlockScalar();
237
+ case 'plain-scalar':
238
+ return yield* this.parsePlainScalar();
239
+ }
240
+ }
241
+ *parseStream() {
242
+ let line = this.getLine();
243
+ if (line === null)
244
+ return this.setNext('stream');
245
+ if (line[0] === BOM) {
246
+ yield* this.pushCount(1);
247
+ line = line.substring(1);
248
+ }
249
+ if (line[0] === '%') {
250
+ let dirEnd = line.length;
251
+ const cs = line.indexOf('#');
252
+ if (cs !== -1) {
253
+ const ch = line[cs - 1];
254
+ if (ch === ' ' || ch === '\t')
255
+ dirEnd = cs - 1;
256
+ }
257
+ while (true) {
258
+ const ch = line[dirEnd - 1];
259
+ if (ch === ' ' || ch === '\t')
260
+ dirEnd -= 1;
261
+ else
262
+ break;
263
+ }
264
+ const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
265
+ yield* this.pushCount(line.length - n); // possible comment
266
+ this.pushNewline();
267
+ return 'stream';
268
+ }
269
+ if (this.atLineEnd()) {
270
+ const sp = yield* this.pushSpaces(true);
271
+ yield* this.pushCount(line.length - sp);
272
+ yield* this.pushNewline();
273
+ return 'stream';
274
+ }
275
+ yield DOCUMENT;
276
+ return yield* this.parseLineStart();
277
+ }
278
+ *parseLineStart() {
279
+ const ch = this.charAt(0);
280
+ if (!ch && !this.atEnd)
281
+ return this.setNext('line-start');
282
+ if (ch === '-' || ch === '.') {
283
+ if (!this.atEnd && !this.hasChars(4))
284
+ return this.setNext('line-start');
285
+ const s = this.peek(3);
286
+ if (s === '---' && isEmpty(this.charAt(3))) {
287
+ yield* this.pushCount(3);
288
+ this.indentValue = 0;
289
+ this.indentNext = 0;
290
+ return 'doc';
291
+ }
292
+ else if (s === '...' && isEmpty(this.charAt(3))) {
293
+ yield* this.pushCount(3);
294
+ return 'stream';
295
+ }
296
+ }
297
+ this.indentValue = yield* this.pushSpaces(false);
298
+ if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))
299
+ this.indentNext = this.indentValue;
300
+ return yield* this.parseBlockStart();
301
+ }
302
+ *parseBlockStart() {
303
+ const [ch0, ch1] = this.peek(2);
304
+ if (!ch1 && !this.atEnd)
305
+ return this.setNext('block-start');
306
+ if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {
307
+ const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
308
+ this.indentNext = this.indentValue + 1;
309
+ this.indentValue += n;
310
+ return yield* this.parseBlockStart();
311
+ }
312
+ return 'doc';
313
+ }
314
+ *parseDocument() {
315
+ yield* this.pushSpaces(true);
316
+ const line = this.getLine();
317
+ if (line === null)
318
+ return this.setNext('doc');
319
+ let n = yield* this.pushIndicators();
320
+ switch (line[n]) {
321
+ case '#':
322
+ yield* this.pushCount(line.length - n);
323
+ // fallthrough
324
+ case undefined:
325
+ yield* this.pushNewline();
326
+ return yield* this.parseLineStart();
327
+ case '{':
328
+ case '[':
329
+ yield* this.pushCount(1);
330
+ this.flowKey = false;
331
+ this.flowLevel = 1;
332
+ return 'flow';
333
+ case '}':
334
+ case ']':
335
+ // this is an error
336
+ yield* this.pushCount(1);
337
+ return 'doc';
338
+ case '*':
339
+ yield* this.pushUntil(isNotAnchorChar);
340
+ return 'doc';
341
+ case '"':
342
+ case "'":
343
+ return yield* this.parseQuotedScalar();
344
+ case '|':
345
+ case '>':
346
+ n += yield* this.parseBlockScalarHeader();
347
+ n += yield* this.pushSpaces(true);
348
+ yield* this.pushCount(line.length - n);
349
+ yield* this.pushNewline();
350
+ return yield* this.parseBlockScalar();
351
+ default:
352
+ return yield* this.parsePlainScalar();
353
+ }
354
+ }
355
+ *parseFlowCollection() {
356
+ let nl, sp;
357
+ let indent = -1;
358
+ do {
359
+ nl = yield* this.pushNewline();
360
+ sp = yield* this.pushSpaces(true);
361
+ if (nl > 0)
362
+ this.indentValue = indent = sp;
363
+ } while (nl + sp > 0);
364
+ const line = this.getLine();
365
+ if (line === null)
366
+ return this.setNext('flow');
367
+ if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||
368
+ (indent === 0 &&
369
+ (line.startsWith('---') || line.startsWith('...')) &&
370
+ isEmpty(line[3]))) {
371
+ // Allowing for the terminal ] or } at the same (rather than greater)
372
+ // indent level as the initial [ or { is technically invalid, but
373
+ // failing here would be surprising to users.
374
+ const atFlowEndMarker = indent === this.indentNext - 1 &&
375
+ this.flowLevel === 1 &&
376
+ (line[0] === ']' || line[0] === '}');
377
+ if (!atFlowEndMarker) {
378
+ // this is an error
379
+ this.flowLevel = 0;
380
+ yield FLOW_END;
381
+ return yield* this.parseLineStart();
382
+ }
383
+ }
384
+ let n = 0;
385
+ while (line[n] === ',') {
386
+ n += yield* this.pushCount(1);
387
+ n += yield* this.pushSpaces(true);
388
+ this.flowKey = false;
389
+ }
390
+ n += yield* this.pushIndicators();
391
+ switch (line[n]) {
392
+ case undefined:
393
+ return 'flow';
394
+ case '#':
395
+ yield* this.pushCount(line.length - n);
396
+ return 'flow';
397
+ case '{':
398
+ case '[':
399
+ yield* this.pushCount(1);
400
+ this.flowKey = false;
401
+ this.flowLevel += 1;
402
+ return 'flow';
403
+ case '}':
404
+ case ']':
405
+ yield* this.pushCount(1);
406
+ this.flowKey = true;
407
+ this.flowLevel -= 1;
408
+ return this.flowLevel ? 'flow' : 'doc';
409
+ case '*':
410
+ yield* this.pushUntil(isNotAnchorChar);
411
+ return 'flow';
412
+ case '"':
413
+ case "'":
414
+ this.flowKey = true;
415
+ return yield* this.parseQuotedScalar();
416
+ case ':': {
417
+ const next = this.charAt(1);
418
+ if (this.flowKey || isEmpty(next) || next === ',') {
419
+ this.flowKey = false;
420
+ yield* this.pushCount(1);
421
+ yield* this.pushSpaces(true);
422
+ return 'flow';
423
+ }
424
+ }
425
+ // fallthrough
426
+ default:
427
+ this.flowKey = false;
428
+ return yield* this.parsePlainScalar();
429
+ }
430
+ }
431
+ *parseQuotedScalar() {
432
+ const quote = this.charAt(0);
433
+ let end = this.buffer.indexOf(quote, this.pos + 1);
434
+ if (quote === "'") {
435
+ while (end !== -1 && this.buffer[end + 1] === "'")
436
+ end = this.buffer.indexOf("'", end + 2);
437
+ }
438
+ else {
439
+ // double-quote
440
+ while (end !== -1) {
441
+ let n = 0;
442
+ while (this.buffer[end - 1 - n] === '\\')
443
+ n += 1;
444
+ if (n % 2 === 0)
445
+ break;
446
+ end = this.buffer.indexOf('"', end + 1);
447
+ }
448
+ }
449
+ // Only looking for newlines within the quotes
450
+ const qb = this.buffer.substring(0, end);
451
+ let nl = qb.indexOf('\n', this.pos);
452
+ if (nl !== -1) {
453
+ while (nl !== -1) {
454
+ const cs = this.continueScalar(nl + 1);
455
+ if (cs === -1)
456
+ break;
457
+ nl = qb.indexOf('\n', cs);
458
+ }
459
+ if (nl !== -1) {
460
+ // this is an error caused by an unexpected unindent
461
+ end = nl - (qb[nl - 1] === '\r' ? 2 : 1);
462
+ }
463
+ }
464
+ if (end === -1) {
465
+ if (!this.atEnd)
466
+ return this.setNext('quoted-scalar');
467
+ end = this.buffer.length;
468
+ }
469
+ yield* this.pushToIndex(end + 1, false);
470
+ return this.flowLevel ? 'flow' : 'doc';
471
+ }
472
+ *parseBlockScalarHeader() {
473
+ this.blockScalarIndent = -1;
474
+ this.blockScalarKeep = false;
475
+ let i = this.pos;
476
+ while (true) {
477
+ const ch = this.buffer[++i];
478
+ if (ch === '+')
479
+ this.blockScalarKeep = true;
480
+ else if (ch > '0' && ch <= '9')
481
+ this.blockScalarIndent = Number(ch) - 1;
482
+ else if (ch !== '-')
483
+ break;
484
+ }
485
+ return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');
486
+ }
487
+ *parseBlockScalar() {
488
+ let nl = this.pos - 1; // may be -1 if this.pos === 0
489
+ let indent = 0;
490
+ let ch;
491
+ loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {
492
+ switch (ch) {
493
+ case ' ':
494
+ indent += 1;
495
+ break;
496
+ case '\n':
497
+ nl = i;
498
+ indent = 0;
499
+ break;
500
+ case '\r': {
501
+ const next = this.buffer[i + 1];
502
+ if (!next && !this.atEnd)
503
+ return this.setNext('block-scalar');
504
+ if (next === '\n')
505
+ break;
506
+ } // fallthrough
507
+ default:
508
+ break loop;
509
+ }
510
+ }
511
+ if (!ch && !this.atEnd)
512
+ return this.setNext('block-scalar');
513
+ if (indent >= this.indentNext) {
514
+ if (this.blockScalarIndent === -1)
515
+ this.indentNext = indent;
516
+ else
517
+ this.indentNext += this.blockScalarIndent;
518
+ do {
519
+ const cs = this.continueScalar(nl + 1);
520
+ if (cs === -1)
521
+ break;
522
+ nl = this.buffer.indexOf('\n', cs);
523
+ } while (nl !== -1);
524
+ if (nl === -1) {
525
+ if (!this.atEnd)
526
+ return this.setNext('block-scalar');
527
+ nl = this.buffer.length;
528
+ }
529
+ }
530
+ if (!this.blockScalarKeep) {
531
+ do {
532
+ let i = nl - 1;
533
+ let ch = this.buffer[i];
534
+ if (ch === '\r')
535
+ ch = this.buffer[--i];
536
+ while (ch === ' ' || ch === '\t')
537
+ ch = this.buffer[--i];
538
+ if (ch === '\n' && i >= this.pos)
539
+ nl = i;
540
+ else
541
+ break;
542
+ } while (true);
543
+ }
544
+ yield SCALAR;
545
+ yield* this.pushToIndex(nl + 1, true);
546
+ return yield* this.parseLineStart();
547
+ }
548
+ *parsePlainScalar() {
549
+ const inFlow = this.flowLevel > 0;
550
+ let end = this.pos - 1;
551
+ let i = this.pos - 1;
552
+ let ch;
553
+ while ((ch = this.buffer[++i])) {
554
+ if (ch === ':') {
555
+ const next = this.buffer[i + 1];
556
+ if (isEmpty(next) || (inFlow && next === ','))
557
+ break;
558
+ end = i;
559
+ }
560
+ else if (isEmpty(ch)) {
561
+ let next = this.buffer[i + 1];
562
+ if (ch === '\r') {
563
+ if (next === '\n') {
564
+ i += 1;
565
+ ch = '\n';
566
+ next = this.buffer[i + 1];
567
+ }
568
+ else
569
+ end = i;
570
+ }
571
+ if (next === '#' || (inFlow && invalidFlowScalarChars.includes(next)))
572
+ break;
573
+ if (ch === '\n') {
574
+ const cs = this.continueScalar(i + 1);
575
+ if (cs === -1)
576
+ break;
577
+ i = Math.max(i, cs - 2); // to advance, but still account for ' #'
578
+ }
579
+ }
580
+ else {
581
+ if (inFlow && invalidFlowScalarChars.includes(ch))
582
+ break;
583
+ end = i;
584
+ }
585
+ }
586
+ if (!ch && !this.atEnd)
587
+ return this.setNext('plain-scalar');
588
+ yield SCALAR;
589
+ yield* this.pushToIndex(end + 1, true);
590
+ return inFlow ? 'flow' : 'doc';
591
+ }
592
+ *pushCount(n) {
593
+ if (n > 0) {
594
+ yield this.buffer.substr(this.pos, n);
595
+ this.pos += n;
596
+ return n;
597
+ }
598
+ return 0;
599
+ }
600
+ *pushToIndex(i, allowEmpty) {
601
+ const s = this.buffer.slice(this.pos, i);
602
+ if (s) {
603
+ yield s;
604
+ this.pos += s.length;
605
+ return s.length;
606
+ }
607
+ else if (allowEmpty)
608
+ yield '';
609
+ return 0;
610
+ }
611
+ *pushIndicators() {
612
+ switch (this.charAt(0)) {
613
+ case '!':
614
+ return ((yield* this.pushTag()) +
615
+ (yield* this.pushSpaces(true)) +
616
+ (yield* this.pushIndicators()));
617
+ case '&':
618
+ return ((yield* this.pushUntil(isNotAnchorChar)) +
619
+ (yield* this.pushSpaces(true)) +
620
+ (yield* this.pushIndicators()));
621
+ case ':':
622
+ case '?': // this is an error outside flow collections
623
+ case '-': // this is an error
624
+ if (isEmpty(this.charAt(1))) {
625
+ if (this.flowLevel === 0)
626
+ this.indentNext = this.indentValue + 1;
627
+ else if (this.flowKey)
628
+ this.flowKey = false;
629
+ return ((yield* this.pushCount(1)) +
630
+ (yield* this.pushSpaces(true)) +
631
+ (yield* this.pushIndicators()));
632
+ }
633
+ }
634
+ return 0;
635
+ }
636
+ *pushTag() {
637
+ if (this.charAt(1) === '<') {
638
+ let i = this.pos + 2;
639
+ let ch = this.buffer[i];
640
+ while (!isEmpty(ch) && ch !== '>')
641
+ ch = this.buffer[++i];
642
+ return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);
643
+ }
644
+ else {
645
+ let i = this.pos + 1;
646
+ let ch = this.buffer[i];
647
+ while (ch) {
648
+ if (tagChars.includes(ch))
649
+ ch = this.buffer[++i];
650
+ else if (ch === '%' &&
651
+ hexDigits.includes(this.buffer[i + 1]) &&
652
+ hexDigits.includes(this.buffer[i + 2])) {
653
+ ch = this.buffer[(i += 3)];
654
+ }
655
+ else
656
+ break;
657
+ }
658
+ return yield* this.pushToIndex(i, false);
659
+ }
660
+ }
661
+ *pushNewline() {
662
+ const ch = this.buffer[this.pos];
663
+ if (ch === '\n')
664
+ return yield* this.pushCount(1);
665
+ else if (ch === '\r' && this.charAt(1) === '\n')
666
+ return yield* this.pushCount(2);
667
+ else
668
+ return 0;
669
+ }
670
+ *pushSpaces(allowTabs) {
671
+ let i = this.pos - 1;
672
+ let ch;
673
+ do {
674
+ ch = this.buffer[++i];
675
+ } while (ch === ' ' || (allowTabs && ch === '\t'));
676
+ const n = i - this.pos;
677
+ if (n > 0) {
678
+ yield this.buffer.substr(this.pos, n);
679
+ this.pos = i;
680
+ }
681
+ return n;
682
+ }
683
+ *pushUntil(test) {
684
+ let i = this.pos;
685
+ let ch = this.buffer[i];
686
+ while (!test(ch))
687
+ ch = this.buffer[++i];
688
+ return yield* this.pushToIndex(i, false);
689
+ }
690
+ }
691
+
692
+ export { Lexer };