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