projen 0.51.7 → 0.51.11

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 +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/resolve/.eslintrc +1 -0
  109. package/node_modules/resolve/bin/resolve +7 -4
  110. package/node_modules/resolve/lib/async.js +10 -1
  111. package/node_modules/resolve/lib/core.json +5 -5
  112. package/node_modules/resolve/lib/homedir.js +24 -0
  113. package/node_modules/resolve/lib/sync.js +10 -1
  114. package/node_modules/resolve/package.json +11 -6
  115. package/node_modules/resolve/test/home_paths.js +127 -0
  116. package/node_modules/resolve/test/home_paths_sync.js +114 -0
  117. package/node_modules/resolve/test/resolver_sync.js +230 -28
  118. package/node_modules/yaml/LICENSE +1 -1
  119. package/node_modules/yaml/README.md +57 -41
  120. package/node_modules/yaml/browser/dist/compose/compose-collection.js +59 -0
  121. package/node_modules/yaml/browser/dist/compose/compose-doc.js +40 -0
  122. package/node_modules/yaml/browser/dist/compose/compose-node.js +81 -0
  123. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +81 -0
  124. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  125. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +107 -0
  126. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +185 -0
  127. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +45 -0
  128. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  129. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +200 -0
  130. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
  131. package/node_modules/yaml/browser/dist/compose/resolve-props.js +128 -0
  132. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  133. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
  134. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  135. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +17 -0
  136. package/node_modules/yaml/browser/dist/doc/Document.js +321 -0
  137. package/node_modules/yaml/browser/dist/doc/anchors.js +72 -0
  138. package/node_modules/yaml/browser/dist/doc/applyReviver.js +54 -0
  139. package/node_modules/yaml/browser/dist/doc/createNode.js +84 -0
  140. package/node_modules/yaml/browser/dist/doc/directives.js +166 -0
  141. package/node_modules/yaml/browser/dist/errors.js +57 -0
  142. package/node_modules/yaml/browser/dist/index.js +18 -1002
  143. package/node_modules/yaml/browser/dist/log.js +14 -0
  144. package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +164 -0
  145. package/node_modules/yaml/browser/dist/nodes/Alias.js +94 -0
  146. package/node_modules/yaml/browser/dist/nodes/Collection.js +146 -0
  147. package/node_modules/yaml/browser/dist/nodes/Node.js +48 -0
  148. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  149. package/node_modules/yaml/browser/dist/nodes/Scalar.js +23 -0
  150. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +116 -0
  151. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +105 -0
  152. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +104 -0
  153. package/node_modules/yaml/browser/dist/nodes/toJS.js +35 -0
  154. package/node_modules/yaml/browser/dist/options.js +18 -0
  155. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +215 -0
  156. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  157. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  158. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  159. package/node_modules/yaml/browser/dist/parse/lexer.js +692 -0
  160. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  161. package/node_modules/yaml/browser/dist/parse/parser.js +882 -0
  162. package/node_modules/yaml/browser/dist/public-api.js +99 -0
  163. package/node_modules/yaml/browser/dist/schema/Schema.js +34 -0
  164. package/node_modules/yaml/browser/dist/schema/common/map.js +42 -0
  165. package/node_modules/yaml/browser/dist/schema/common/null.js +13 -0
  166. package/node_modules/yaml/browser/dist/schema/common/seq.js +33 -0
  167. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  168. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  169. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  170. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  171. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  172. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  173. package/node_modules/yaml/browser/dist/schema/tags.js +83 -0
  174. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +66 -0
  175. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  176. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  177. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  178. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +73 -0
  179. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +77 -0
  180. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +37 -0
  181. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +87 -0
  182. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  183. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +135 -0
  184. package/node_modules/yaml/browser/dist/stringify/stringify.js +124 -0
  185. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +152 -0
  186. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +18 -0
  187. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +68 -0
  188. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
  189. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +122 -0
  190. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +314 -0
  191. package/node_modules/yaml/browser/dist/util.js +9 -2
  192. package/node_modules/yaml/browser/dist/visit.js +146 -0
  193. package/node_modules/yaml/browser/index.js +5 -1
  194. package/node_modules/yaml/browser/package.json +3 -0
  195. package/node_modules/yaml/dist/compose/compose-collection.d.ts +5 -0
  196. package/node_modules/yaml/dist/compose/compose-collection.js +61 -0
  197. package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -0
  198. package/node_modules/yaml/dist/compose/compose-doc.js +42 -0
  199. package/node_modules/yaml/dist/compose/compose-node.d.ts +26 -0
  200. package/node_modules/yaml/dist/compose/compose-node.js +84 -0
  201. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  202. package/node_modules/yaml/dist/compose/compose-scalar.js +83 -0
  203. package/node_modules/yaml/dist/compose/composer.d.ts +62 -0
  204. package/node_modules/yaml/dist/compose/composer.js +223 -0
  205. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  206. package/node_modules/yaml/dist/compose/resolve-block-map.js +109 -0
  207. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +10 -0
  208. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +187 -0
  209. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -0
  210. package/node_modules/yaml/dist/compose/resolve-block-seq.js +47 -0
  211. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  212. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  213. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +6 -0
  214. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +202 -0
  215. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  216. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
  217. package/node_modules/yaml/dist/compose/resolve-props.d.ts +21 -0
  218. package/node_modules/yaml/dist/compose/resolve-props.js +130 -0
  219. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  220. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  221. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  222. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +29 -0
  223. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  224. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  225. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  226. package/node_modules/yaml/dist/compose/util-map-includes.js +19 -0
  227. package/node_modules/yaml/dist/doc/Document.d.ts +139 -0
  228. package/node_modules/yaml/dist/doc/Document.js +323 -0
  229. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  230. package/node_modules/yaml/dist/doc/anchors.js +77 -0
  231. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  232. package/node_modules/yaml/dist/doc/applyReviver.js +56 -0
  233. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  234. package/node_modules/yaml/dist/doc/createNode.js +86 -0
  235. package/node_modules/yaml/dist/doc/directives.d.ts +47 -0
  236. package/node_modules/yaml/dist/doc/directives.js +168 -0
  237. package/node_modules/yaml/dist/errors.d.ts +21 -0
  238. package/node_modules/yaml/dist/errors.js +62 -0
  239. package/node_modules/yaml/dist/index.d.ts +19 -0
  240. package/node_modules/yaml/dist/index.js +49 -77
  241. package/node_modules/yaml/dist/log.d.ts +3 -0
  242. package/node_modules/yaml/dist/log.js +17 -0
  243. package/node_modules/yaml/dist/node_modules/tslib/tslib.es6.js +76 -0
  244. package/node_modules/yaml/dist/nodes/Alias.d.ts +28 -0
  245. package/node_modules/yaml/dist/nodes/Alias.js +96 -0
  246. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  247. package/node_modules/yaml/dist/nodes/Collection.js +150 -0
  248. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  249. package/node_modules/yaml/dist/nodes/Node.js +66 -0
  250. package/node_modules/yaml/dist/nodes/Pair.d.ts +21 -0
  251. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  252. package/node_modules/yaml/dist/nodes/Scalar.d.ts +42 -0
  253. package/node_modules/yaml/dist/nodes/Scalar.js +26 -0
  254. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +41 -0
  255. package/node_modules/yaml/dist/nodes/YAMLMap.js +119 -0
  256. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +55 -0
  257. package/node_modules/yaml/dist/nodes/YAMLSeq.js +107 -0
  258. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -0
  259. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +106 -0
  260. package/node_modules/yaml/dist/nodes/toJS.d.ts +30 -0
  261. package/node_modules/yaml/dist/nodes/toJS.js +37 -0
  262. package/node_modules/yaml/dist/options.d.ts +338 -0
  263. package/node_modules/yaml/dist/options.js +20 -0
  264. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  265. package/node_modules/yaml/dist/parse/cst-scalar.js +219 -0
  266. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  267. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  268. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  269. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  270. package/node_modules/yaml/dist/parse/cst.d.ts +106 -0
  271. package/node_modules/yaml/dist/parse/cst.js +112 -0
  272. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  273. package/node_modules/yaml/dist/parse/lexer.js +694 -0
  274. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  275. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  276. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  277. package/node_modules/yaml/dist/parse/parser.js +886 -0
  278. package/node_modules/yaml/dist/public-api.d.ts +43 -0
  279. package/node_modules/yaml/dist/public-api.js +104 -0
  280. package/node_modules/yaml/dist/schema/Schema.d.ts +18 -0
  281. package/node_modules/yaml/dist/schema/Schema.js +36 -0
  282. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  283. package/node_modules/yaml/dist/schema/common/map.js +44 -0
  284. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  285. package/node_modules/yaml/dist/schema/common/null.js +15 -0
  286. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  287. package/node_modules/yaml/dist/schema/common/seq.js +35 -0
  288. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  289. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  290. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  291. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  292. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  293. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  294. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  295. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  296. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  297. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  298. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  299. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  300. package/node_modules/yaml/dist/schema/tags.d.ts +40 -0
  301. package/node_modules/yaml/dist/schema/tags.js +86 -0
  302. package/node_modules/yaml/dist/schema/types.d.ts +82 -0
  303. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  304. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
  305. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  306. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  307. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  308. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  309. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  310. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  311. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +21 -0
  312. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +76 -0
  313. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  314. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +81 -0
  315. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  316. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +39 -0
  317. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +22 -0
  318. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +90 -0
  319. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  320. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  321. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  322. package/node_modules/yaml/dist/stringify/foldFlowLines.js +140 -0
  323. package/node_modules/yaml/dist/stringify/stringify.d.ts +20 -0
  324. package/node_modules/yaml/dist/stringify/stringify.js +127 -0
  325. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  326. package/node_modules/yaml/dist/stringify/stringifyCollection.js +154 -0
  327. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  328. package/node_modules/yaml/dist/stringify/stringifyComment.js +22 -0
  329. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -0
  330. package/node_modules/yaml/dist/stringify/stringifyDocument.js +70 -0
  331. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  332. package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
  333. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  334. package/node_modules/yaml/dist/stringify/stringifyPair.js +124 -0
  335. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +3 -0
  336. package/node_modules/yaml/dist/stringify/stringifyString.js +316 -0
  337. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  338. package/node_modules/yaml/dist/test-events.js +126 -152
  339. package/node_modules/yaml/dist/util.d.ts +9 -0
  340. package/node_modules/yaml/dist/util.js +19 -14
  341. package/node_modules/yaml/dist/visit.d.ts +63 -0
  342. package/node_modules/yaml/dist/visit.js +148 -0
  343. package/node_modules/yaml/package.json +43 -55
  344. package/node_modules/yaml/util.d.ts +3 -86
  345. package/node_modules/yaml/util.js +2 -16
  346. package/package.json +3 -3
  347. package/releasetag.txt +1 -1
  348. package/version.txt +1 -1
  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,316 @@
1
+ 'use strict';
2
+
3
+ var Scalar = require('../nodes/Scalar.js');
4
+ var foldFlowLines = require('./foldFlowLines.js');
5
+
6
+ const getFoldOptions = (ctx) => ({
7
+ indentAtStart: ctx.indentAtStart,
8
+ lineWidth: ctx.options.lineWidth,
9
+ minContentWidth: ctx.options.minContentWidth
10
+ });
11
+ // Also checks for lines starting with %, as parsing the output as YAML 1.1 will
12
+ // presume that's starting a new document.
13
+ const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
14
+ function lineLengthOverLimit(str, lineWidth, indentLength) {
15
+ if (!lineWidth || lineWidth < 0)
16
+ return false;
17
+ const limit = lineWidth - indentLength;
18
+ const strLen = str.length;
19
+ if (strLen <= limit)
20
+ return false;
21
+ for (let i = 0, start = 0; i < strLen; ++i) {
22
+ if (str[i] === '\n') {
23
+ if (i - start > limit)
24
+ return true;
25
+ start = i + 1;
26
+ if (strLen - start <= limit)
27
+ return false;
28
+ }
29
+ }
30
+ return true;
31
+ }
32
+ function doubleQuotedString(value, ctx) {
33
+ const json = JSON.stringify(value);
34
+ if (ctx.options.doubleQuotedAsJSON)
35
+ return json;
36
+ const { implicitKey } = ctx;
37
+ const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
38
+ const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
39
+ let str = '';
40
+ let start = 0;
41
+ for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
42
+ if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') {
43
+ // space before newline needs to be escaped to not be folded
44
+ str += json.slice(start, i) + '\\ ';
45
+ i += 1;
46
+ start = i;
47
+ ch = '\\';
48
+ }
49
+ if (ch === '\\')
50
+ switch (json[i + 1]) {
51
+ case 'u':
52
+ {
53
+ str += json.slice(start, i);
54
+ const code = json.substr(i + 2, 4);
55
+ switch (code) {
56
+ case '0000':
57
+ str += '\\0';
58
+ break;
59
+ case '0007':
60
+ str += '\\a';
61
+ break;
62
+ case '000b':
63
+ str += '\\v';
64
+ break;
65
+ case '001b':
66
+ str += '\\e';
67
+ break;
68
+ case '0085':
69
+ str += '\\N';
70
+ break;
71
+ case '00a0':
72
+ str += '\\_';
73
+ break;
74
+ case '2028':
75
+ str += '\\L';
76
+ break;
77
+ case '2029':
78
+ str += '\\P';
79
+ break;
80
+ default:
81
+ if (code.substr(0, 2) === '00')
82
+ str += '\\x' + code.substr(2);
83
+ else
84
+ str += json.substr(i, 6);
85
+ }
86
+ i += 5;
87
+ start = i + 1;
88
+ }
89
+ break;
90
+ case 'n':
91
+ if (implicitKey ||
92
+ json[i + 2] === '"' ||
93
+ json.length < minMultiLineLength) {
94
+ i += 1;
95
+ }
96
+ else {
97
+ // folding will eat first newline
98
+ str += json.slice(start, i) + '\n\n';
99
+ while (json[i + 2] === '\\' &&
100
+ json[i + 3] === 'n' &&
101
+ json[i + 4] !== '"') {
102
+ str += '\n';
103
+ i += 2;
104
+ }
105
+ str += indent;
106
+ // space after newline needs to be escaped to not be folded
107
+ if (json[i + 2] === ' ')
108
+ str += '\\';
109
+ i += 1;
110
+ start = i + 1;
111
+ }
112
+ break;
113
+ default:
114
+ i += 1;
115
+ }
116
+ }
117
+ str = start ? str + json.slice(start) : json;
118
+ return implicitKey
119
+ ? str
120
+ : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx));
121
+ }
122
+ function singleQuotedString(value, ctx) {
123
+ if (ctx.options.singleQuote === false ||
124
+ (ctx.implicitKey && value.includes('\n')) ||
125
+ /[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline
126
+ )
127
+ return doubleQuotedString(value, ctx);
128
+ const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
129
+ const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
130
+ return ctx.implicitKey
131
+ ? res
132
+ : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx));
133
+ }
134
+ function quotedString(value, ctx) {
135
+ const { singleQuote } = ctx.options;
136
+ let qs;
137
+ if (singleQuote === false)
138
+ qs = doubleQuotedString;
139
+ else {
140
+ const hasDouble = value.includes('"');
141
+ const hasSingle = value.includes("'");
142
+ if (hasDouble && !hasSingle)
143
+ qs = singleQuotedString;
144
+ else if (hasSingle && !hasDouble)
145
+ qs = doubleQuotedString;
146
+ else
147
+ qs = singleQuote ? singleQuotedString : doubleQuotedString;
148
+ }
149
+ return qs(value, ctx);
150
+ }
151
+ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
152
+ const { blockQuote, commentString, lineWidth } = ctx.options;
153
+ // 1. Block can't end in whitespace unless the last line is non-empty.
154
+ // 2. Strings consisting of only whitespace are best rendered explicitly.
155
+ if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
156
+ return quotedString(value, ctx);
157
+ }
158
+ const indent = ctx.indent ||
159
+ (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');
160
+ const literal = blockQuote === 'literal'
161
+ ? true
162
+ : blockQuote === 'folded' || type === Scalar.Scalar.BLOCK_FOLDED
163
+ ? false
164
+ : type === Scalar.Scalar.BLOCK_LITERAL
165
+ ? true
166
+ : !lineLengthOverLimit(value, lineWidth, indent.length);
167
+ if (!value)
168
+ return literal ? '|\n' : '>\n';
169
+ // determine chomping from whitespace at value end
170
+ let chomp;
171
+ let endStart;
172
+ for (endStart = value.length; endStart > 0; --endStart) {
173
+ const ch = value[endStart - 1];
174
+ if (ch !== '\n' && ch !== '\t' && ch !== ' ')
175
+ break;
176
+ }
177
+ let end = value.substring(endStart);
178
+ const endNlPos = end.indexOf('\n');
179
+ if (endNlPos === -1) {
180
+ chomp = '-'; // strip
181
+ }
182
+ else if (value === end || endNlPos !== end.length - 1) {
183
+ chomp = '+'; // keep
184
+ if (onChompKeep)
185
+ onChompKeep();
186
+ }
187
+ else {
188
+ chomp = ''; // clip
189
+ }
190
+ if (end) {
191
+ value = value.slice(0, -end.length);
192
+ if (end[end.length - 1] === '\n')
193
+ end = end.slice(0, -1);
194
+ end = end.replace(/\n+(?!\n|$)/g, `$&${indent}`);
195
+ }
196
+ // determine indent indicator from whitespace at value start
197
+ let startWithSpace = false;
198
+ let startEnd;
199
+ let startNlPos = -1;
200
+ for (startEnd = 0; startEnd < value.length; ++startEnd) {
201
+ const ch = value[startEnd];
202
+ if (ch === ' ')
203
+ startWithSpace = true;
204
+ else if (ch === '\n')
205
+ startNlPos = startEnd;
206
+ else
207
+ break;
208
+ }
209
+ let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
210
+ if (start) {
211
+ value = value.substring(start.length);
212
+ start = start.replace(/\n+/g, `$&${indent}`);
213
+ }
214
+ const indentSize = indent ? '2' : '1'; // root is at -1
215
+ let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
216
+ if (comment) {
217
+ header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
218
+ if (onComment)
219
+ onComment();
220
+ }
221
+ if (literal) {
222
+ value = value.replace(/\n+/g, `$&${indent}`);
223
+ return `${header}\n${indent}${start}${value}${end}`;
224
+ }
225
+ value = value
226
+ .replace(/\n+/g, '\n$&')
227
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
228
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
229
+ .replace(/\n+/g, `$&${indent}`);
230
+ const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx));
231
+ return `${header}\n${indent}${body}`;
232
+ }
233
+ function plainString(item, ctx, onComment, onChompKeep) {
234
+ const { type, value } = item;
235
+ const { actualString, implicitKey, indent, inFlow } = ctx;
236
+ if ((implicitKey && /[\n[\]{},]/.test(value)) ||
237
+ (inFlow && /[[\]{},]/.test(value))) {
238
+ return quotedString(value, ctx);
239
+ }
240
+ if (!value ||
241
+ /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
242
+ // not allowed:
243
+ // - empty string, '-' or '?'
244
+ // - start with an indicator character (except [?:-]) or /[?-] /
245
+ // - '\n ', ': ' or ' \n' anywhere
246
+ // - '#' not preceded by a non-space char
247
+ // - end with ' ' or ':'
248
+ return implicitKey || inFlow || value.indexOf('\n') === -1
249
+ ? quotedString(value, ctx)
250
+ : blockString(item, ctx, onComment, onChompKeep);
251
+ }
252
+ if (!implicitKey &&
253
+ !inFlow &&
254
+ type !== Scalar.Scalar.PLAIN &&
255
+ value.indexOf('\n') !== -1) {
256
+ // Where allowed & type not set explicitly, prefer block style for multiline strings
257
+ return blockString(item, ctx, onComment, onChompKeep);
258
+ }
259
+ if (indent === '' && containsDocumentMarker(value)) {
260
+ ctx.forceBlockIndent = true;
261
+ return blockString(item, ctx, onComment, onChompKeep);
262
+ }
263
+ const str = value.replace(/\n+/g, `$&\n${indent}`);
264
+ // Verify that output will be parsed as a string, as e.g. plain numbers and
265
+ // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
266
+ // and others in v1.1.
267
+ if (actualString) {
268
+ const test = (tag) => { var _a; return tag.default && tag.tag !== 'tag:yaml.org,2002:str' && ((_a = tag.test) === null || _a === void 0 ? void 0 : _a.test(str)); };
269
+ const { compat, tags } = ctx.doc.schema;
270
+ if (tags.some(test) || (compat === null || compat === void 0 ? void 0 : compat.some(test)))
271
+ return quotedString(value, ctx);
272
+ }
273
+ return implicitKey
274
+ ? str
275
+ : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx));
276
+ }
277
+ function stringifyString(item, ctx, onComment, onChompKeep) {
278
+ const { implicitKey, inFlow } = ctx;
279
+ const ss = typeof item.value === 'string'
280
+ ? item
281
+ : Object.assign({}, item, { value: String(item.value) });
282
+ let { type } = item;
283
+ if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
284
+ // force double quotes on control characters & unpaired surrogates
285
+ if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
286
+ type = Scalar.Scalar.QUOTE_DOUBLE;
287
+ }
288
+ const _stringify = (_type) => {
289
+ switch (_type) {
290
+ case Scalar.Scalar.BLOCK_FOLDED:
291
+ case Scalar.Scalar.BLOCK_LITERAL:
292
+ return implicitKey || inFlow
293
+ ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers
294
+ : blockString(ss, ctx, onComment, onChompKeep);
295
+ case Scalar.Scalar.QUOTE_DOUBLE:
296
+ return doubleQuotedString(ss.value, ctx);
297
+ case Scalar.Scalar.QUOTE_SINGLE:
298
+ return singleQuotedString(ss.value, ctx);
299
+ case Scalar.Scalar.PLAIN:
300
+ return plainString(ss, ctx, onComment, onChompKeep);
301
+ default:
302
+ return null;
303
+ }
304
+ };
305
+ let res = _stringify(type);
306
+ if (res === null) {
307
+ const { defaultKeyType, defaultStringType } = ctx.options;
308
+ const t = (implicitKey && defaultKeyType) || defaultStringType;
309
+ res = _stringify(t);
310
+ if (res === null)
311
+ throw new Error(`Unsupported default string type ${t}`);
312
+ }
313
+ return res;
314
+ }
315
+
316
+ exports.stringifyString = stringifyString;
@@ -0,0 +1,4 @@
1
+ export declare function testEvents(src: string): {
2
+ events: string[];
3
+ error: unknown;
4
+ };
@@ -1,162 +1,136 @@
1
1
  'use strict';
2
2
 
3
- var parseCst = require('./parse-cst.js');
4
- var Document = require('./Document-9b4560a1.js');
5
- require('./PlainValue-ec8e588e.js');
6
- require('./resolveSeq-d03cb037.js');
7
- require('./Schema-88e323a7.js');
8
- require('./warnings-1000a372.js');
9
-
10
- function testEvents(src, options) {
11
- const opt = Object.assign({
12
- keepCstNodes: true,
13
- keepNodeTypes: true,
14
- version: '1.2'
15
- }, options);
16
- const docs = parseCst.parse(src).map(cstDoc => new Document.Document(opt).parse(cstDoc));
17
- const errDoc = docs.find(doc => doc.errors.length > 0);
18
- const error = errDoc ? errDoc.errors[0].message : null;
19
- const events = ['+STR'];
20
-
21
- try {
22
- for (let i = 0; i < docs.length; ++i) {
23
- const doc = docs[i];
24
- let root = doc.contents;
25
- if (Array.isArray(root)) root = root[0];
26
- const [rootStart, rootEnd] = doc.range || [0, 0];
27
- let e = doc.errors[0] && doc.errors[0].source;
28
- if (e && e.type === 'SEQ_ITEM') e = e.node;
29
- if (e && (e.type === 'DOCUMENT' || e.range.start < rootStart)) throw new Error();
30
- let docStart = '+DOC';
31
- const pre = src.slice(0, rootStart);
32
- const explicitDoc = /---\s*$/.test(pre);
33
- if (explicitDoc) docStart += ' ---';else if (!doc.contents) continue;
34
- events.push(docStart);
35
- addEvents(events, doc, e, root);
36
- if (doc.contents && doc.contents.length > 1) throw new Error();
37
- let docEnd = '-DOC';
38
-
39
- if (rootEnd) {
40
- const post = src.slice(rootEnd);
41
- if (/^\.\.\./.test(post)) docEnd += ' ...';
42
- }
43
-
44
- events.push(docEnd);
3
+ var Node = require('./nodes/Node.js');
4
+ var publicApi = require('./public-api.js');
5
+ var visit = require('./visit.js');
6
+
7
+ const scalarChar = {
8
+ BLOCK_FOLDED: '>',
9
+ BLOCK_LITERAL: '|',
10
+ PLAIN: ':',
11
+ QUOTE_DOUBLE: '"',
12
+ QUOTE_SINGLE: "'"
13
+ };
14
+ function anchorExists(doc, anchor) {
15
+ let found = false;
16
+ visit.visit(doc, {
17
+ Value(_key, node) {
18
+ if (node.anchor === anchor) {
19
+ found = true;
20
+ return visit.visit.BREAK;
21
+ }
22
+ }
23
+ });
24
+ return found;
25
+ }
26
+ // test harness for yaml-test-suite event tests
27
+ function testEvents(src) {
28
+ var _a;
29
+ const docs = publicApi.parseAllDocuments(src);
30
+ const errDoc = docs.find(doc => doc.errors.length > 0);
31
+ const error = errDoc ? errDoc.errors[0].message : null;
32
+ const events = ['+STR'];
33
+ try {
34
+ for (let i = 0; i < docs.length; ++i) {
35
+ const doc = docs[i];
36
+ let root = doc.contents;
37
+ if (Array.isArray(root))
38
+ root = root[0];
39
+ // eslint-disable-next-line no-sparse-arrays
40
+ const [rootStart, , rootEnd] = doc.range || [0, , 0];
41
+ const error = doc.errors[0];
42
+ if (error && (!error.pos || error.pos[0] < rootStart))
43
+ throw new Error();
44
+ let docStart = '+DOC';
45
+ if (doc.directives.marker)
46
+ docStart += ' ---';
47
+ else if (doc.contents && doc.contents.range[2] === doc.contents.range[0])
48
+ continue;
49
+ events.push(docStart);
50
+ addEvents(events, doc, (_a = error === null || error === void 0 ? void 0 : error.pos[0]) !== null && _a !== void 0 ? _a : -1, root);
51
+ let docEnd = '-DOC';
52
+ if (rootEnd) {
53
+ const post = src.slice(rootStart, rootEnd);
54
+ if (/^\.\.\.($|\s)/m.test(post))
55
+ docEnd += ' ...';
56
+ }
57
+ events.push(docEnd);
58
+ }
45
59
  }
46
- } catch (e) {
47
- return {
48
- events,
49
- error: error || e
50
- };
51
- }
52
-
53
- events.push('-STR');
54
- return {
55
- events,
56
- error
57
- };
60
+ catch (e) {
61
+ return { events, error: error || e };
62
+ }
63
+ events.push('-STR');
64
+ return { events, error };
58
65
  }
59
-
60
- function addEvents(events, doc, e, node) {
61
- if (!node) {
62
- events.push('=VAL :');
63
- return;
64
- }
65
-
66
- if (e && node.cstNode === e) throw new Error();
67
- let props = '';
68
- let anchor = doc.anchors.getName(node);
69
-
70
- if (anchor) {
71
- if (/\d$/.test(anchor)) {
72
- const alt = anchor.replace(/\d$/, '');
73
- if (doc.anchors.getNode(alt)) anchor = alt;
66
+ function addEvents(events, doc, errPos, node) {
67
+ if (!node) {
68
+ events.push('=VAL :');
69
+ return;
74
70
  }
75
-
76
- props = ` &${anchor}`;
77
- }
78
-
79
- if (node.cstNode && node.cstNode.tag) {
80
- const {
81
- handle,
82
- suffix
83
- } = node.cstNode.tag;
84
- props += handle === '!' && !suffix ? ' <!>' : ` <${node.tag}>`;
85
- }
86
-
87
- let scalar = null;
88
-
89
- switch (node.type) {
90
- case 'ALIAS':
91
- {
92
- let alias = doc.anchors.getName(node.source);
93
-
94
- if (/\d$/.test(alias)) {
95
- const alt = alias.replace(/\d$/, '');
96
- if (doc.anchors.getNode(alt)) alias = alt;
71
+ if (errPos !== -1 && Node.isNode(node) && node.range[0] >= errPos)
72
+ throw new Error();
73
+ let props = '';
74
+ let anchor = Node.isScalar(node) || Node.isCollection(node) ? node.anchor : undefined;
75
+ if (anchor) {
76
+ if (/\d$/.test(anchor)) {
77
+ const alt = anchor.replace(/\d$/, '');
78
+ if (anchorExists(doc, alt))
79
+ anchor = alt;
80
+ }
81
+ props = ` &${anchor}`;
82
+ }
83
+ if (Node.isNode(node) && node.tag)
84
+ props += ` <${node.tag}>`;
85
+ if (Node.isMap(node)) {
86
+ const ev = node.flow ? '+MAP {}' : '+MAP';
87
+ events.push(`${ev}${props}`);
88
+ node.items.forEach(({ key, value }) => {
89
+ addEvents(events, doc, errPos, key);
90
+ addEvents(events, doc, errPos, value);
91
+ });
92
+ events.push('-MAP');
93
+ }
94
+ else if (Node.isSeq(node)) {
95
+ const ev = node.flow ? '+SEQ []' : '+SEQ';
96
+ events.push(`${ev}${props}`);
97
+ node.items.forEach(item => {
98
+ addEvents(events, doc, errPos, item);
99
+ });
100
+ events.push('-SEQ');
101
+ }
102
+ else if (Node.isPair(node)) {
103
+ events.push(`+MAP${props}`);
104
+ addEvents(events, doc, errPos, node.key);
105
+ addEvents(events, doc, errPos, node.value);
106
+ events.push('-MAP');
107
+ }
108
+ else if (Node.isAlias(node)) {
109
+ let alias = node.source;
110
+ if (alias && /\d$/.test(alias)) {
111
+ const alt = alias.replace(/\d$/, '');
112
+ if (anchorExists(doc, alt))
113
+ alias = alt;
97
114
  }
98
-
99
115
  events.push(`=ALI${props} *${alias}`);
100
- }
101
- break;
102
-
103
- case 'BLOCK_FOLDED':
104
- scalar = '>';
105
- break;
106
-
107
- case 'BLOCK_LITERAL':
108
- scalar = '|';
109
- break;
110
-
111
- case 'PLAIN':
112
- scalar = ':';
113
- break;
114
-
115
- case 'QUOTE_DOUBLE':
116
- scalar = '"';
117
- break;
118
-
119
- case 'QUOTE_SINGLE':
120
- scalar = "'";
121
- break;
122
-
123
- case 'PAIR':
124
- events.push(`+MAP${props}`);
125
- addEvents(events, doc, e, node.key);
126
- addEvents(events, doc, e, node.value);
127
- events.push('-MAP');
128
- break;
129
-
130
- case 'FLOW_SEQ':
131
- case 'SEQ':
132
- events.push(`+SEQ${props}`);
133
- node.items.forEach(item => {
134
- addEvents(events, doc, e, item);
135
- });
136
- events.push('-SEQ');
137
- break;
138
-
139
- case 'FLOW_MAP':
140
- case 'MAP':
141
- events.push(`+MAP${props}`);
142
- node.items.forEach(({
143
- key,
144
- value
145
- }) => {
146
- addEvents(events, doc, e, key);
147
- addEvents(events, doc, e, value);
148
- });
149
- events.push('-MAP');
150
- break;
151
-
152
- default:
153
- throw new Error(`Unexpected node type ${node.type}`);
154
- }
155
-
156
- if (scalar) {
157
- const value = node.cstNode.strValue.replace(/\\/g, '\\\\').replace(/\0/g, '\\0').replace(/\x07/g, '\\a').replace(/\x08/g, '\\b').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\v/g, '\\v').replace(/\f/g, '\\f').replace(/\r/g, '\\r').replace(/\x1b/g, '\\e');
158
- events.push(`=VAL${props} ${scalar}${value}`);
159
- }
116
+ }
117
+ else {
118
+ const scalar = scalarChar[String(node.type)];
119
+ if (!scalar)
120
+ throw new Error(`Unexpected node type ${node.type}`);
121
+ const value = node.source
122
+ .replace(/\\/g, '\\\\')
123
+ .replace(/\0/g, '\\0')
124
+ .replace(/\x07/g, '\\a')
125
+ .replace(/\x08/g, '\\b')
126
+ .replace(/\t/g, '\\t')
127
+ .replace(/\n/g, '\\n')
128
+ .replace(/\v/g, '\\v')
129
+ .replace(/\f/g, '\\f')
130
+ .replace(/\r/g, '\\r')
131
+ .replace(/\x1b/g, '\\e');
132
+ events.push(`=VAL${props} ${scalar}${value}`);
133
+ }
160
134
  }
161
135
 
162
136
  exports.testEvents = testEvents;
@@ -0,0 +1,9 @@
1
+ export { debug, LogLevelId, warn } from './log.js';
2
+ export { findPair } from './nodes/YAMLMap.js';
3
+ export { toJS, ToJSContext } from './nodes/toJS.js';
4
+ export { map as mapTag } from './schema/common/map.js';
5
+ export { seq as seqTag } from './schema/common/seq.js';
6
+ export { string as stringTag } from './schema/common/string.js';
7
+ export { foldFlowLines } from './stringify/foldFlowLines';
8
+ export { stringifyNumber } from './stringify/stringifyNumber.js';
9
+ export { stringifyString } from './stringify/stringifyString.js';
@@ -1,19 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var resolveSeq = require('./resolveSeq-d03cb037.js');
4
- var PlainValue = require('./PlainValue-ec8e588e.js');
3
+ var log = require('./log.js');
4
+ var YAMLMap = require('./nodes/YAMLMap.js');
5
+ var toJS = require('./nodes/toJS.js');
6
+ var map = require('./schema/common/map.js');
7
+ var seq = require('./schema/common/seq.js');
8
+ var string = require('./schema/common/string.js');
9
+ var foldFlowLines = require('./stringify/foldFlowLines.js');
10
+ var stringifyNumber = require('./stringify/stringifyNumber.js');
11
+ var stringifyString = require('./stringify/stringifyString.js');
5
12
 
6
13
 
7
14
 
8
- exports.findPair = resolveSeq.findPair;
9
- exports.parseMap = resolveSeq.resolveMap;
10
- exports.parseSeq = resolveSeq.resolveSeq;
11
- exports.stringifyNumber = resolveSeq.stringifyNumber;
12
- exports.stringifyString = resolveSeq.stringifyString;
13
- exports.toJSON = resolveSeq.toJSON;
14
- exports.Type = PlainValue.Type;
15
- exports.YAMLError = PlainValue.YAMLError;
16
- exports.YAMLReferenceError = PlainValue.YAMLReferenceError;
17
- exports.YAMLSemanticError = PlainValue.YAMLSemanticError;
18
- exports.YAMLSyntaxError = PlainValue.YAMLSyntaxError;
19
- exports.YAMLWarning = PlainValue.YAMLWarning;
15
+ exports.debug = log.debug;
16
+ exports.warn = log.warn;
17
+ exports.findPair = YAMLMap.findPair;
18
+ exports.toJS = toJS.toJS;
19
+ exports.mapTag = map.map;
20
+ exports.seqTag = seq.seq;
21
+ exports.stringTag = string.string;
22
+ exports.foldFlowLines = foldFlowLines.foldFlowLines;
23
+ exports.stringifyNumber = stringifyNumber.stringifyNumber;
24
+ exports.stringifyString = stringifyString.stringifyString;