@windrun-huaiin/dev-scripts 14.1.2 → 14.1.4

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 (242) hide show
  1. package/dist/commands/create-diaomao-app.d.ts.map +1 -1
  2. package/dist/commands/create-diaomao-app.js +2 -0
  3. package/dist/commands/create-diaomao-app.mjs +2 -0
  4. package/dist/commands/diaomao-update.d.ts.map +1 -1
  5. package/dist/commands/diaomao-update.js +13 -5
  6. package/dist/commands/diaomao-update.mjs +13 -5
  7. package/dist/config/schema.d.ts.map +1 -1
  8. package/dist/config/schema.js +74 -1
  9. package/dist/config/schema.mjs +74 -1
  10. package/package.json +1 -1
  11. package/dist/_virtual/_commonjsHelpers.js +0 -7
  12. package/dist/_virtual/_commonjsHelpers.mjs +0 -5
  13. package/dist/_virtual/index.js +0 -11
  14. package/dist/_virtual/index.mjs +0 -7
  15. package/dist/_virtual/re.js +0 -5
  16. package/dist/_virtual/re.mjs +0 -3
  17. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js +0 -161
  18. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.mjs +0 -159
  19. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js +0 -576
  20. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.mjs +0 -574
  21. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js +0 -350
  22. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.mjs +0 -348
  23. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js +0 -21
  24. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.mjs +0 -19
  25. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js +0 -72
  26. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.mjs +0 -70
  27. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js +0 -77
  28. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.mjs +0 -75
  29. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js +0 -22
  30. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.mjs +0 -20
  31. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js +0 -18
  32. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.mjs +0 -16
  33. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js +0 -20
  34. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.mjs +0 -18
  35. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js +0 -73
  36. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.mjs +0 -71
  37. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js +0 -18
  38. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.mjs +0 -16
  39. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js +0 -18
  40. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.mjs +0 -16
  41. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js +0 -18
  42. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.mjs +0 -16
  43. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js +0 -34
  44. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.mjs +0 -32
  45. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js +0 -18
  46. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.mjs +0 -16
  47. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js +0 -18
  48. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.mjs +0 -16
  49. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js +0 -18
  50. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.mjs +0 -16
  51. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js +0 -18
  52. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.mjs +0 -16
  53. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js +0 -18
  54. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.mjs +0 -16
  55. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js +0 -31
  56. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.mjs +0 -29
  57. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js +0 -18
  58. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.mjs +0 -16
  59. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js +0 -21
  60. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.mjs +0 -19
  61. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js +0 -18
  62. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.mjs +0 -16
  63. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js +0 -18
  64. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.mjs +0 -16
  65. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js +0 -25
  66. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.mjs +0 -23
  67. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js +0 -18
  68. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.mjs +0 -16
  69. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js +0 -21
  70. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.mjs +0 -19
  71. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js +0 -144
  72. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.mjs +0 -142
  73. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js +0 -48
  74. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.mjs +0 -46
  75. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js +0 -22
  76. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.mjs +0 -20
  77. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js +0 -40
  78. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.mjs +0 -38
  79. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js +0 -53
  80. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.mjs +0 -51
  81. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js +0 -28
  82. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.mjs +0 -26
  83. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js +0 -239
  84. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.mjs +0 -237
  85. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js +0 -19
  86. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.mjs +0 -17
  87. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js +0 -22
  88. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.mjs +0 -20
  89. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js +0 -19
  90. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.mjs +0 -17
  91. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js +0 -41
  92. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.mjs +0 -39
  93. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js +0 -40
  94. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.mjs +0 -38
  95. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js +0 -78
  96. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.mjs +0 -76
  97. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js +0 -102
  98. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.mjs +0 -100
  99. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js +0 -63
  100. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.mjs +0 -61
  101. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js +0 -265
  102. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.mjs +0 -263
  103. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js +0 -23
  104. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.mjs +0 -21
  105. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js +0 -26
  106. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.mjs +0 -24
  107. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -90
  108. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-collection.mjs +0 -88
  109. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -45
  110. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-doc.mjs +0 -43
  111. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-node.js +0 -105
  112. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-node.mjs +0 -102
  113. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -88
  114. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-scalar.mjs +0 -86
  115. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/composer.js +0 -219
  116. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/composer.mjs +0 -217
  117. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -117
  118. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-map.mjs +0 -115
  119. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -200
  120. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-scalar.mjs +0 -198
  121. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -51
  122. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-seq.mjs +0 -49
  123. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -39
  124. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-end.mjs +0 -37
  125. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -209
  126. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-collection.mjs +0 -207
  127. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -225
  128. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.mjs +0 -223
  129. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -148
  130. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-props.mjs +0 -146
  131. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -36
  132. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-contains-newline.mjs +0 -34
  133. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -28
  134. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.mjs +0 -26
  135. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -17
  136. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-flow-indent-check.mjs +0 -15
  137. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -15
  138. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-map-includes.mjs +0 -13
  139. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/Document.js +0 -337
  140. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/Document.mjs +0 -335
  141. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/anchors.js +0 -76
  142. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/anchors.mjs +0 -71
  143. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -57
  144. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/applyReviver.mjs +0 -55
  145. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/createNode.js +0 -90
  146. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/createNode.mjs +0 -88
  147. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/directives.js +0 -178
  148. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/directives.mjs +0 -176
  149. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/errors.js +0 -62
  150. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/errors.mjs +0 -57
  151. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/log.js +0 -9
  152. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/log.mjs +0 -7
  153. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Alias.js +0 -116
  154. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Alias.mjs +0 -114
  155. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Collection.js +0 -151
  156. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Collection.mjs +0 -147
  157. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Node.js +0 -40
  158. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Node.mjs +0 -38
  159. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Pair.js +0 -39
  160. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Pair.mjs +0 -36
  161. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -27
  162. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Scalar.mjs +0 -24
  163. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -147
  164. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLMap.mjs +0 -144
  165. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -115
  166. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLSeq.mjs +0 -113
  167. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -65
  168. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +0 -63
  169. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/identity.js +0 -53
  170. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/identity.mjs +0 -36
  171. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/toJS.js +0 -39
  172. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/toJS.mjs +0 -37
  173. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/cst.js +0 -79
  174. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/cst.mjs +0 -73
  175. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/lexer.js +0 -719
  176. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/lexer.mjs +0 -717
  177. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/line-counter.js +0 -41
  178. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/line-counter.mjs +0 -39
  179. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/parser.js +0 -969
  180. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/parser.mjs +0 -967
  181. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/public-api.js +0 -68
  182. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/public-api.mjs +0 -64
  183. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/Schema.js +0 -39
  184. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/Schema.mjs +0 -37
  185. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/map.js +0 -19
  186. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/map.mjs +0 -17
  187. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/null.js +0 -17
  188. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/null.mjs +0 -15
  189. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/seq.js +0 -19
  190. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/seq.mjs +0 -17
  191. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/string.js +0 -16
  192. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/string.mjs +0 -14
  193. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/bool.js +0 -21
  194. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/bool.mjs +0 -19
  195. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/float.js +0 -47
  196. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/float.mjs +0 -43
  197. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/int.js +0 -42
  198. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/int.mjs +0 -38
  199. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/schema.js +0 -25
  200. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/schema.mjs +0 -23
  201. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/json/schema.js +0 -64
  202. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/json/schema.mjs +0 -62
  203. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/tags.js +0 -99
  204. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/tags.mjs +0 -96
  205. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -60
  206. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.mjs +0 -58
  207. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -29
  208. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.mjs +0 -26
  209. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -50
  210. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/float.mjs +0 -46
  211. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -76
  212. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/int.mjs +0 -71
  213. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -68
  214. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.mjs +0 -64
  215. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -77
  216. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.mjs +0 -74
  217. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -82
  218. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.mjs +0 -78
  219. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -41
  220. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.mjs +0 -39
  221. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -96
  222. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/set.mjs +0 -93
  223. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -105
  224. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.mjs +0 -101
  225. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -151
  226. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/foldFlowLines.mjs +0 -146
  227. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringify.js +0 -131
  228. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringify.mjs +0 -128
  229. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -145
  230. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyCollection.mjs +0 -143
  231. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -24
  232. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyComment.mjs +0 -20
  233. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -87
  234. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyDocument.mjs +0 -85
  235. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -26
  236. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyNumber.mjs +0 -24
  237. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -152
  238. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyPair.mjs +0 -150
  239. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -338
  240. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyString.mjs +0 -336
  241. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/visit.js +0 -148
  242. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/visit.mjs +0 -146
@@ -1,969 +0,0 @@
1
- 'use strict';
2
-
3
- var cst = require('./cst.js');
4
- var lexer = require('./lexer.js');
5
-
6
- function includesToken(list, type) {
7
- for (let i = 0; i < list.length; ++i)
8
- if (list[i].type === type)
9
- return true;
10
- return false;
11
- }
12
- function findNonEmptyIndex(list) {
13
- for (let i = 0; i < list.length; ++i) {
14
- switch (list[i].type) {
15
- case 'space':
16
- case 'comment':
17
- case 'newline':
18
- break;
19
- default:
20
- return i;
21
- }
22
- }
23
- return -1;
24
- }
25
- function isFlowToken(token) {
26
- switch (token?.type) {
27
- case 'alias':
28
- case 'scalar':
29
- case 'single-quoted-scalar':
30
- case 'double-quoted-scalar':
31
- case 'flow-collection':
32
- return true;
33
- default:
34
- return false;
35
- }
36
- }
37
- function getPrevProps(parent) {
38
- switch (parent.type) {
39
- case 'document':
40
- return parent.start;
41
- case 'block-map': {
42
- const it = parent.items[parent.items.length - 1];
43
- return it.sep ?? it.start;
44
- }
45
- case 'block-seq':
46
- return parent.items[parent.items.length - 1].start;
47
- /* istanbul ignore next should not happen */
48
- default:
49
- return [];
50
- }
51
- }
52
- /** Note: May modify input array */
53
- function getFirstKeyStartProps(prev) {
54
- if (prev.length === 0)
55
- return [];
56
- let i = prev.length;
57
- loop: while (--i >= 0) {
58
- switch (prev[i].type) {
59
- case 'doc-start':
60
- case 'explicit-key-ind':
61
- case 'map-value-ind':
62
- case 'seq-item-ind':
63
- case 'newline':
64
- break loop;
65
- }
66
- }
67
- while (prev[++i]?.type === 'space') {
68
- /* loop */
69
- }
70
- return prev.splice(i, prev.length);
71
- }
72
- function fixFlowSeqItems(fc) {
73
- if (fc.start.type === 'flow-seq-start') {
74
- for (const it of fc.items) {
75
- if (it.sep &&
76
- !it.value &&
77
- !includesToken(it.start, 'explicit-key-ind') &&
78
- !includesToken(it.sep, 'map-value-ind')) {
79
- if (it.key)
80
- it.value = it.key;
81
- delete it.key;
82
- if (isFlowToken(it.value)) {
83
- if (it.value.end)
84
- Array.prototype.push.apply(it.value.end, it.sep);
85
- else
86
- it.value.end = it.sep;
87
- }
88
- else
89
- Array.prototype.push.apply(it.start, it.sep);
90
- delete it.sep;
91
- }
92
- }
93
- }
94
- }
95
- /**
96
- * A YAML concrete syntax tree (CST) parser
97
- *
98
- * ```ts
99
- * const src: string = ...
100
- * for (const token of new Parser().parse(src)) {
101
- * // token: Token
102
- * }
103
- * ```
104
- *
105
- * To use the parser with a user-provided lexer:
106
- *
107
- * ```ts
108
- * function* parse(source: string, lexer: Lexer) {
109
- * const parser = new Parser()
110
- * for (const lexeme of lexer.lex(source))
111
- * yield* parser.next(lexeme)
112
- * yield* parser.end()
113
- * }
114
- *
115
- * const src: string = ...
116
- * const lexer = new Lexer()
117
- * for (const token of parse(src, lexer)) {
118
- * // token: Token
119
- * }
120
- * ```
121
- */
122
- class Parser {
123
- /**
124
- * @param onNewLine - If defined, called separately with the start position of
125
- * each new line (in `parse()`, including the start of input).
126
- */
127
- constructor(onNewLine) {
128
- /** If true, space and sequence indicators count as indentation */
129
- this.atNewLine = true;
130
- /** If true, next token is a scalar value */
131
- this.atScalar = false;
132
- /** Current indentation level */
133
- this.indent = 0;
134
- /** Current offset since the start of parsing */
135
- this.offset = 0;
136
- /** On the same line with a block map key */
137
- this.onKeyLine = false;
138
- /** Top indicates the node that's currently being built */
139
- this.stack = [];
140
- /** The source of the current token, set in parse() */
141
- this.source = '';
142
- /** The type of the current token, set in parse() */
143
- this.type = '';
144
- // Must be defined after `next()`
145
- this.lexer = new lexer.Lexer();
146
- this.onNewLine = onNewLine;
147
- }
148
- /**
149
- * Parse `source` as a YAML stream.
150
- * If `incomplete`, a part of the last line may be left as a buffer for the next call.
151
- *
152
- * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.
153
- *
154
- * @returns A generator of tokens representing each directive, document, and other structure.
155
- */
156
- *parse(source, incomplete = false) {
157
- if (this.onNewLine && this.offset === 0)
158
- this.onNewLine(0);
159
- for (const lexeme of this.lexer.lex(source, incomplete))
160
- yield* this.next(lexeme);
161
- if (!incomplete)
162
- yield* this.end();
163
- }
164
- /**
165
- * Advance the parser by the `source` of one lexical token.
166
- */
167
- *next(source) {
168
- this.source = source;
169
- if (this.atScalar) {
170
- this.atScalar = false;
171
- yield* this.step();
172
- this.offset += source.length;
173
- return;
174
- }
175
- const type = cst.tokenType(source);
176
- if (!type) {
177
- const message = `Not a YAML token: ${source}`;
178
- yield* this.pop({ type: 'error', offset: this.offset, message, source });
179
- this.offset += source.length;
180
- }
181
- else if (type === 'scalar') {
182
- this.atNewLine = false;
183
- this.atScalar = true;
184
- this.type = 'scalar';
185
- }
186
- else {
187
- this.type = type;
188
- yield* this.step();
189
- switch (type) {
190
- case 'newline':
191
- this.atNewLine = true;
192
- this.indent = 0;
193
- if (this.onNewLine)
194
- this.onNewLine(this.offset + source.length);
195
- break;
196
- case 'space':
197
- if (this.atNewLine && source[0] === ' ')
198
- this.indent += source.length;
199
- break;
200
- case 'explicit-key-ind':
201
- case 'map-value-ind':
202
- case 'seq-item-ind':
203
- if (this.atNewLine)
204
- this.indent += source.length;
205
- break;
206
- case 'doc-mode':
207
- case 'flow-error-end':
208
- return;
209
- default:
210
- this.atNewLine = false;
211
- }
212
- this.offset += source.length;
213
- }
214
- }
215
- /** Call at end of input to push out any remaining constructions */
216
- *end() {
217
- while (this.stack.length > 0)
218
- yield* this.pop();
219
- }
220
- get sourceToken() {
221
- const st = {
222
- type: this.type,
223
- offset: this.offset,
224
- indent: this.indent,
225
- source: this.source
226
- };
227
- return st;
228
- }
229
- *step() {
230
- const top = this.peek(1);
231
- if (this.type === 'doc-end' && top?.type !== 'doc-end') {
232
- while (this.stack.length > 0)
233
- yield* this.pop();
234
- this.stack.push({
235
- type: 'doc-end',
236
- offset: this.offset,
237
- source: this.source
238
- });
239
- return;
240
- }
241
- if (!top)
242
- return yield* this.stream();
243
- switch (top.type) {
244
- case 'document':
245
- return yield* this.document(top);
246
- case 'alias':
247
- case 'scalar':
248
- case 'single-quoted-scalar':
249
- case 'double-quoted-scalar':
250
- return yield* this.scalar(top);
251
- case 'block-scalar':
252
- return yield* this.blockScalar(top);
253
- case 'block-map':
254
- return yield* this.blockMap(top);
255
- case 'block-seq':
256
- return yield* this.blockSequence(top);
257
- case 'flow-collection':
258
- return yield* this.flowCollection(top);
259
- case 'doc-end':
260
- return yield* this.documentEnd(top);
261
- }
262
- /* istanbul ignore next should not happen */
263
- yield* this.pop();
264
- }
265
- peek(n) {
266
- return this.stack[this.stack.length - n];
267
- }
268
- *pop(error) {
269
- const token = error ?? this.stack.pop();
270
- /* istanbul ignore if should not happen */
271
- if (!token) {
272
- const message = 'Tried to pop an empty stack';
273
- yield { type: 'error', offset: this.offset, source: '', message };
274
- }
275
- else if (this.stack.length === 0) {
276
- yield token;
277
- }
278
- else {
279
- const top = this.peek(1);
280
- if (token.type === 'block-scalar') {
281
- // Block scalars use their parent rather than header indent
282
- token.indent = 'indent' in top ? top.indent : 0;
283
- }
284
- else if (token.type === 'flow-collection' && top.type === 'document') {
285
- // Ignore all indent for top-level flow collections
286
- token.indent = 0;
287
- }
288
- if (token.type === 'flow-collection')
289
- fixFlowSeqItems(token);
290
- switch (top.type) {
291
- case 'document':
292
- top.value = token;
293
- break;
294
- case 'block-scalar':
295
- top.props.push(token); // error
296
- break;
297
- case 'block-map': {
298
- const it = top.items[top.items.length - 1];
299
- if (it.value) {
300
- top.items.push({ start: [], key: token, sep: [] });
301
- this.onKeyLine = true;
302
- return;
303
- }
304
- else if (it.sep) {
305
- it.value = token;
306
- }
307
- else {
308
- Object.assign(it, { key: token, sep: [] });
309
- this.onKeyLine = !it.explicitKey;
310
- return;
311
- }
312
- break;
313
- }
314
- case 'block-seq': {
315
- const it = top.items[top.items.length - 1];
316
- if (it.value)
317
- top.items.push({ start: [], value: token });
318
- else
319
- it.value = token;
320
- break;
321
- }
322
- case 'flow-collection': {
323
- const it = top.items[top.items.length - 1];
324
- if (!it || it.value)
325
- top.items.push({ start: [], key: token, sep: [] });
326
- else if (it.sep)
327
- it.value = token;
328
- else
329
- Object.assign(it, { key: token, sep: [] });
330
- return;
331
- }
332
- /* istanbul ignore next should not happen */
333
- default:
334
- yield* this.pop();
335
- yield* this.pop(token);
336
- }
337
- if ((top.type === 'document' ||
338
- top.type === 'block-map' ||
339
- top.type === 'block-seq') &&
340
- (token.type === 'block-map' || token.type === 'block-seq')) {
341
- const last = token.items[token.items.length - 1];
342
- if (last &&
343
- !last.sep &&
344
- !last.value &&
345
- last.start.length > 0 &&
346
- findNonEmptyIndex(last.start) === -1 &&
347
- (token.indent === 0 ||
348
- last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {
349
- if (top.type === 'document')
350
- top.end = last.start;
351
- else
352
- top.items.push({ start: last.start });
353
- token.items.splice(-1, 1);
354
- }
355
- }
356
- }
357
- }
358
- *stream() {
359
- switch (this.type) {
360
- case 'directive-line':
361
- yield { type: 'directive', offset: this.offset, source: this.source };
362
- return;
363
- case 'byte-order-mark':
364
- case 'space':
365
- case 'comment':
366
- case 'newline':
367
- yield this.sourceToken;
368
- return;
369
- case 'doc-mode':
370
- case 'doc-start': {
371
- const doc = {
372
- type: 'document',
373
- offset: this.offset,
374
- start: []
375
- };
376
- if (this.type === 'doc-start')
377
- doc.start.push(this.sourceToken);
378
- this.stack.push(doc);
379
- return;
380
- }
381
- }
382
- yield {
383
- type: 'error',
384
- offset: this.offset,
385
- message: `Unexpected ${this.type} token in YAML stream`,
386
- source: this.source
387
- };
388
- }
389
- *document(doc) {
390
- if (doc.value)
391
- return yield* this.lineEnd(doc);
392
- switch (this.type) {
393
- case 'doc-start': {
394
- if (findNonEmptyIndex(doc.start) !== -1) {
395
- yield* this.pop();
396
- yield* this.step();
397
- }
398
- else
399
- doc.start.push(this.sourceToken);
400
- return;
401
- }
402
- case 'anchor':
403
- case 'tag':
404
- case 'space':
405
- case 'comment':
406
- case 'newline':
407
- doc.start.push(this.sourceToken);
408
- return;
409
- }
410
- const bv = this.startBlockValue(doc);
411
- if (bv)
412
- this.stack.push(bv);
413
- else {
414
- yield {
415
- type: 'error',
416
- offset: this.offset,
417
- message: `Unexpected ${this.type} token in YAML document`,
418
- source: this.source
419
- };
420
- }
421
- }
422
- *scalar(scalar) {
423
- if (this.type === 'map-value-ind') {
424
- const prev = getPrevProps(this.peek(2));
425
- const start = getFirstKeyStartProps(prev);
426
- let sep;
427
- if (scalar.end) {
428
- sep = scalar.end;
429
- sep.push(this.sourceToken);
430
- delete scalar.end;
431
- }
432
- else
433
- sep = [this.sourceToken];
434
- const map = {
435
- type: 'block-map',
436
- offset: scalar.offset,
437
- indent: scalar.indent,
438
- items: [{ start, key: scalar, sep }]
439
- };
440
- this.onKeyLine = true;
441
- this.stack[this.stack.length - 1] = map;
442
- }
443
- else
444
- yield* this.lineEnd(scalar);
445
- }
446
- *blockScalar(scalar) {
447
- switch (this.type) {
448
- case 'space':
449
- case 'comment':
450
- case 'newline':
451
- scalar.props.push(this.sourceToken);
452
- return;
453
- case 'scalar':
454
- scalar.source = this.source;
455
- // block-scalar source includes trailing newline
456
- this.atNewLine = true;
457
- this.indent = 0;
458
- if (this.onNewLine) {
459
- let nl = this.source.indexOf('\n') + 1;
460
- while (nl !== 0) {
461
- this.onNewLine(this.offset + nl);
462
- nl = this.source.indexOf('\n', nl) + 1;
463
- }
464
- }
465
- yield* this.pop();
466
- break;
467
- /* istanbul ignore next should not happen */
468
- default:
469
- yield* this.pop();
470
- yield* this.step();
471
- }
472
- }
473
- *blockMap(map) {
474
- const it = map.items[map.items.length - 1];
475
- // it.sep is true-ish if pair already has key or : separator
476
- switch (this.type) {
477
- case 'newline':
478
- this.onKeyLine = false;
479
- if (it.value) {
480
- const end = 'end' in it.value ? it.value.end : undefined;
481
- const last = Array.isArray(end) ? end[end.length - 1] : undefined;
482
- if (last?.type === 'comment')
483
- end?.push(this.sourceToken);
484
- else
485
- map.items.push({ start: [this.sourceToken] });
486
- }
487
- else if (it.sep) {
488
- it.sep.push(this.sourceToken);
489
- }
490
- else {
491
- it.start.push(this.sourceToken);
492
- }
493
- return;
494
- case 'space':
495
- case 'comment':
496
- if (it.value) {
497
- map.items.push({ start: [this.sourceToken] });
498
- }
499
- else if (it.sep) {
500
- it.sep.push(this.sourceToken);
501
- }
502
- else {
503
- if (this.atIndentedComment(it.start, map.indent)) {
504
- const prev = map.items[map.items.length - 2];
505
- const end = prev?.value?.end;
506
- if (Array.isArray(end)) {
507
- Array.prototype.push.apply(end, it.start);
508
- end.push(this.sourceToken);
509
- map.items.pop();
510
- return;
511
- }
512
- }
513
- it.start.push(this.sourceToken);
514
- }
515
- return;
516
- }
517
- if (this.indent >= map.indent) {
518
- const atMapIndent = !this.onKeyLine && this.indent === map.indent;
519
- const atNextItem = atMapIndent &&
520
- (it.sep || it.explicitKey) &&
521
- this.type !== 'seq-item-ind';
522
- // For empty nodes, assign newline-separated not indented empty tokens to following node
523
- let start = [];
524
- if (atNextItem && it.sep && !it.value) {
525
- const nl = [];
526
- for (let i = 0; i < it.sep.length; ++i) {
527
- const st = it.sep[i];
528
- switch (st.type) {
529
- case 'newline':
530
- nl.push(i);
531
- break;
532
- case 'space':
533
- break;
534
- case 'comment':
535
- if (st.indent > map.indent)
536
- nl.length = 0;
537
- break;
538
- default:
539
- nl.length = 0;
540
- }
541
- }
542
- if (nl.length >= 2)
543
- start = it.sep.splice(nl[1]);
544
- }
545
- switch (this.type) {
546
- case 'anchor':
547
- case 'tag':
548
- if (atNextItem || it.value) {
549
- start.push(this.sourceToken);
550
- map.items.push({ start });
551
- this.onKeyLine = true;
552
- }
553
- else if (it.sep) {
554
- it.sep.push(this.sourceToken);
555
- }
556
- else {
557
- it.start.push(this.sourceToken);
558
- }
559
- return;
560
- case 'explicit-key-ind':
561
- if (!it.sep && !it.explicitKey) {
562
- it.start.push(this.sourceToken);
563
- it.explicitKey = true;
564
- }
565
- else if (atNextItem || it.value) {
566
- start.push(this.sourceToken);
567
- map.items.push({ start, explicitKey: true });
568
- }
569
- else {
570
- this.stack.push({
571
- type: 'block-map',
572
- offset: this.offset,
573
- indent: this.indent,
574
- items: [{ start: [this.sourceToken], explicitKey: true }]
575
- });
576
- }
577
- this.onKeyLine = true;
578
- return;
579
- case 'map-value-ind':
580
- if (it.explicitKey) {
581
- if (!it.sep) {
582
- if (includesToken(it.start, 'newline')) {
583
- Object.assign(it, { key: null, sep: [this.sourceToken] });
584
- }
585
- else {
586
- const start = getFirstKeyStartProps(it.start);
587
- this.stack.push({
588
- type: 'block-map',
589
- offset: this.offset,
590
- indent: this.indent,
591
- items: [{ start, key: null, sep: [this.sourceToken] }]
592
- });
593
- }
594
- }
595
- else if (it.value) {
596
- map.items.push({ start: [], key: null, sep: [this.sourceToken] });
597
- }
598
- else if (includesToken(it.sep, 'map-value-ind')) {
599
- this.stack.push({
600
- type: 'block-map',
601
- offset: this.offset,
602
- indent: this.indent,
603
- items: [{ start, key: null, sep: [this.sourceToken] }]
604
- });
605
- }
606
- else if (isFlowToken(it.key) &&
607
- !includesToken(it.sep, 'newline')) {
608
- const start = getFirstKeyStartProps(it.start);
609
- const key = it.key;
610
- const sep = it.sep;
611
- sep.push(this.sourceToken);
612
- // @ts-expect-error type guard is wrong here
613
- delete it.key;
614
- // @ts-expect-error type guard is wrong here
615
- delete it.sep;
616
- this.stack.push({
617
- type: 'block-map',
618
- offset: this.offset,
619
- indent: this.indent,
620
- items: [{ start, key, sep }]
621
- });
622
- }
623
- else if (start.length > 0) {
624
- // Not actually at next item
625
- it.sep = it.sep.concat(start, this.sourceToken);
626
- }
627
- else {
628
- it.sep.push(this.sourceToken);
629
- }
630
- }
631
- else {
632
- if (!it.sep) {
633
- Object.assign(it, { key: null, sep: [this.sourceToken] });
634
- }
635
- else if (it.value || atNextItem) {
636
- map.items.push({ start, key: null, sep: [this.sourceToken] });
637
- }
638
- else if (includesToken(it.sep, 'map-value-ind')) {
639
- this.stack.push({
640
- type: 'block-map',
641
- offset: this.offset,
642
- indent: this.indent,
643
- items: [{ start: [], key: null, sep: [this.sourceToken] }]
644
- });
645
- }
646
- else {
647
- it.sep.push(this.sourceToken);
648
- }
649
- }
650
- this.onKeyLine = true;
651
- return;
652
- case 'alias':
653
- case 'scalar':
654
- case 'single-quoted-scalar':
655
- case 'double-quoted-scalar': {
656
- const fs = this.flowScalar(this.type);
657
- if (atNextItem || it.value) {
658
- map.items.push({ start, key: fs, sep: [] });
659
- this.onKeyLine = true;
660
- }
661
- else if (it.sep) {
662
- this.stack.push(fs);
663
- }
664
- else {
665
- Object.assign(it, { key: fs, sep: [] });
666
- this.onKeyLine = true;
667
- }
668
- return;
669
- }
670
- default: {
671
- const bv = this.startBlockValue(map);
672
- if (bv) {
673
- if (bv.type === 'block-seq') {
674
- if (!it.explicitKey &&
675
- it.sep &&
676
- !includesToken(it.sep, 'newline')) {
677
- yield* this.pop({
678
- type: 'error',
679
- offset: this.offset,
680
- message: 'Unexpected block-seq-ind on same line with key',
681
- source: this.source
682
- });
683
- return;
684
- }
685
- }
686
- else if (atMapIndent) {
687
- map.items.push({ start });
688
- }
689
- this.stack.push(bv);
690
- return;
691
- }
692
- }
693
- }
694
- }
695
- yield* this.pop();
696
- yield* this.step();
697
- }
698
- *blockSequence(seq) {
699
- const it = seq.items[seq.items.length - 1];
700
- switch (this.type) {
701
- case 'newline':
702
- if (it.value) {
703
- const end = 'end' in it.value ? it.value.end : undefined;
704
- const last = Array.isArray(end) ? end[end.length - 1] : undefined;
705
- if (last?.type === 'comment')
706
- end?.push(this.sourceToken);
707
- else
708
- seq.items.push({ start: [this.sourceToken] });
709
- }
710
- else
711
- it.start.push(this.sourceToken);
712
- return;
713
- case 'space':
714
- case 'comment':
715
- if (it.value)
716
- seq.items.push({ start: [this.sourceToken] });
717
- else {
718
- if (this.atIndentedComment(it.start, seq.indent)) {
719
- const prev = seq.items[seq.items.length - 2];
720
- const end = prev?.value?.end;
721
- if (Array.isArray(end)) {
722
- Array.prototype.push.apply(end, it.start);
723
- end.push(this.sourceToken);
724
- seq.items.pop();
725
- return;
726
- }
727
- }
728
- it.start.push(this.sourceToken);
729
- }
730
- return;
731
- case 'anchor':
732
- case 'tag':
733
- if (it.value || this.indent <= seq.indent)
734
- break;
735
- it.start.push(this.sourceToken);
736
- return;
737
- case 'seq-item-ind':
738
- if (this.indent !== seq.indent)
739
- break;
740
- if (it.value || includesToken(it.start, 'seq-item-ind'))
741
- seq.items.push({ start: [this.sourceToken] });
742
- else
743
- it.start.push(this.sourceToken);
744
- return;
745
- }
746
- if (this.indent > seq.indent) {
747
- const bv = this.startBlockValue(seq);
748
- if (bv) {
749
- this.stack.push(bv);
750
- return;
751
- }
752
- }
753
- yield* this.pop();
754
- yield* this.step();
755
- }
756
- *flowCollection(fc) {
757
- const it = fc.items[fc.items.length - 1];
758
- if (this.type === 'flow-error-end') {
759
- let top;
760
- do {
761
- yield* this.pop();
762
- top = this.peek(1);
763
- } while (top?.type === 'flow-collection');
764
- }
765
- else if (fc.end.length === 0) {
766
- switch (this.type) {
767
- case 'comma':
768
- case 'explicit-key-ind':
769
- if (!it || it.sep)
770
- fc.items.push({ start: [this.sourceToken] });
771
- else
772
- it.start.push(this.sourceToken);
773
- return;
774
- case 'map-value-ind':
775
- if (!it || it.value)
776
- fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
777
- else if (it.sep)
778
- it.sep.push(this.sourceToken);
779
- else
780
- Object.assign(it, { key: null, sep: [this.sourceToken] });
781
- return;
782
- case 'space':
783
- case 'comment':
784
- case 'newline':
785
- case 'anchor':
786
- case 'tag':
787
- if (!it || it.value)
788
- fc.items.push({ start: [this.sourceToken] });
789
- else if (it.sep)
790
- it.sep.push(this.sourceToken);
791
- else
792
- it.start.push(this.sourceToken);
793
- return;
794
- case 'alias':
795
- case 'scalar':
796
- case 'single-quoted-scalar':
797
- case 'double-quoted-scalar': {
798
- const fs = this.flowScalar(this.type);
799
- if (!it || it.value)
800
- fc.items.push({ start: [], key: fs, sep: [] });
801
- else if (it.sep)
802
- this.stack.push(fs);
803
- else
804
- Object.assign(it, { key: fs, sep: [] });
805
- return;
806
- }
807
- case 'flow-map-end':
808
- case 'flow-seq-end':
809
- fc.end.push(this.sourceToken);
810
- return;
811
- }
812
- const bv = this.startBlockValue(fc);
813
- /* istanbul ignore else should not happen */
814
- if (bv)
815
- this.stack.push(bv);
816
- else {
817
- yield* this.pop();
818
- yield* this.step();
819
- }
820
- }
821
- else {
822
- const parent = this.peek(2);
823
- if (parent.type === 'block-map' &&
824
- ((this.type === 'map-value-ind' && parent.indent === fc.indent) ||
825
- (this.type === 'newline' &&
826
- !parent.items[parent.items.length - 1].sep))) {
827
- yield* this.pop();
828
- yield* this.step();
829
- }
830
- else if (this.type === 'map-value-ind' &&
831
- parent.type !== 'flow-collection') {
832
- const prev = getPrevProps(parent);
833
- const start = getFirstKeyStartProps(prev);
834
- fixFlowSeqItems(fc);
835
- const sep = fc.end.splice(1, fc.end.length);
836
- sep.push(this.sourceToken);
837
- const map = {
838
- type: 'block-map',
839
- offset: fc.offset,
840
- indent: fc.indent,
841
- items: [{ start, key: fc, sep }]
842
- };
843
- this.onKeyLine = true;
844
- this.stack[this.stack.length - 1] = map;
845
- }
846
- else {
847
- yield* this.lineEnd(fc);
848
- }
849
- }
850
- }
851
- flowScalar(type) {
852
- if (this.onNewLine) {
853
- let nl = this.source.indexOf('\n') + 1;
854
- while (nl !== 0) {
855
- this.onNewLine(this.offset + nl);
856
- nl = this.source.indexOf('\n', nl) + 1;
857
- }
858
- }
859
- return {
860
- type,
861
- offset: this.offset,
862
- indent: this.indent,
863
- source: this.source
864
- };
865
- }
866
- startBlockValue(parent) {
867
- switch (this.type) {
868
- case 'alias':
869
- case 'scalar':
870
- case 'single-quoted-scalar':
871
- case 'double-quoted-scalar':
872
- return this.flowScalar(this.type);
873
- case 'block-scalar-header':
874
- return {
875
- type: 'block-scalar',
876
- offset: this.offset,
877
- indent: this.indent,
878
- props: [this.sourceToken],
879
- source: ''
880
- };
881
- case 'flow-map-start':
882
- case 'flow-seq-start':
883
- return {
884
- type: 'flow-collection',
885
- offset: this.offset,
886
- indent: this.indent,
887
- start: this.sourceToken,
888
- items: [],
889
- end: []
890
- };
891
- case 'seq-item-ind':
892
- return {
893
- type: 'block-seq',
894
- offset: this.offset,
895
- indent: this.indent,
896
- items: [{ start: [this.sourceToken] }]
897
- };
898
- case 'explicit-key-ind': {
899
- this.onKeyLine = true;
900
- const prev = getPrevProps(parent);
901
- const start = getFirstKeyStartProps(prev);
902
- start.push(this.sourceToken);
903
- return {
904
- type: 'block-map',
905
- offset: this.offset,
906
- indent: this.indent,
907
- items: [{ start, explicitKey: true }]
908
- };
909
- }
910
- case 'map-value-ind': {
911
- this.onKeyLine = true;
912
- const prev = getPrevProps(parent);
913
- const start = getFirstKeyStartProps(prev);
914
- return {
915
- type: 'block-map',
916
- offset: this.offset,
917
- indent: this.indent,
918
- items: [{ start, key: null, sep: [this.sourceToken] }]
919
- };
920
- }
921
- }
922
- return null;
923
- }
924
- atIndentedComment(start, indent) {
925
- if (this.type !== 'comment')
926
- return false;
927
- if (this.indent <= indent)
928
- return false;
929
- return start.every(st => st.type === 'newline' || st.type === 'space');
930
- }
931
- *documentEnd(docEnd) {
932
- if (this.type !== 'doc-mode') {
933
- if (docEnd.end)
934
- docEnd.end.push(this.sourceToken);
935
- else
936
- docEnd.end = [this.sourceToken];
937
- if (this.type === 'newline')
938
- yield* this.pop();
939
- }
940
- }
941
- *lineEnd(token) {
942
- switch (this.type) {
943
- case 'comma':
944
- case 'doc-start':
945
- case 'doc-end':
946
- case 'flow-seq-end':
947
- case 'flow-map-end':
948
- case 'map-value-ind':
949
- yield* this.pop();
950
- yield* this.step();
951
- break;
952
- case 'newline':
953
- this.onKeyLine = false;
954
- // fallthrough
955
- case 'space':
956
- case 'comment':
957
- default:
958
- // all other values are errors
959
- if (token.end)
960
- token.end.push(this.sourceToken);
961
- else
962
- token.end = [this.sourceToken];
963
- if (this.type === 'newline')
964
- yield* this.pop();
965
- }
966
- }
967
- }
968
-
969
- exports.Parser = Parser;