@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,90 +0,0 @@
1
- 'use strict';
2
-
3
- var identity = require('../nodes/identity.js');
4
- var Scalar = require('../nodes/Scalar.js');
5
- var YAMLMap = require('../nodes/YAMLMap.js');
6
- var YAMLSeq = require('../nodes/YAMLSeq.js');
7
- var resolveBlockMap = require('./resolve-block-map.js');
8
- var resolveBlockSeq = require('./resolve-block-seq.js');
9
- var resolveFlowCollection = require('./resolve-flow-collection.js');
10
-
11
- function resolveCollection(CN, ctx, token, onError, tagName, tag) {
12
- const coll = token.type === 'block-map'
13
- ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag)
14
- : token.type === 'block-seq'
15
- ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag)
16
- : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);
17
- const Coll = coll.constructor;
18
- // If we got a tagName matching the class, or the tag name is '!',
19
- // then use the tagName from the node class used to create it.
20
- if (tagName === '!' || tagName === Coll.tagName) {
21
- coll.tag = Coll.tagName;
22
- return coll;
23
- }
24
- if (tagName)
25
- coll.tag = tagName;
26
- return coll;
27
- }
28
- function composeCollection(CN, ctx, token, props, onError) {
29
- const tagToken = props.tag;
30
- const tagName = !tagToken
31
- ? null
32
- : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
33
- if (token.type === 'block-seq') {
34
- const { anchor, newlineAfterProp: nl } = props;
35
- const lastProp = anchor && tagToken
36
- ? anchor.offset > tagToken.offset
37
- ? anchor
38
- : tagToken
39
- : (anchor ?? tagToken);
40
- if (lastProp && (!nl || nl.offset < lastProp.offset)) {
41
- const message = 'Missing newline after block sequence props';
42
- onError(lastProp, 'MISSING_CHAR', message);
43
- }
44
- }
45
- const expType = token.type === 'block-map'
46
- ? 'map'
47
- : token.type === 'block-seq'
48
- ? 'seq'
49
- : token.start.source === '{'
50
- ? 'map'
51
- : 'seq';
52
- // shortcut: check if it's a generic YAMLMap or YAMLSeq
53
- // before jumping into the custom tag logic.
54
- if (!tagToken ||
55
- !tagName ||
56
- tagName === '!' ||
57
- (tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||
58
- (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {
59
- return resolveCollection(CN, ctx, token, onError, tagName);
60
- }
61
- let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
62
- if (!tag) {
63
- const kt = ctx.schema.knownTags[tagName];
64
- if (kt?.collection === expType) {
65
- ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
66
- tag = kt;
67
- }
68
- else {
69
- if (kt) {
70
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
71
- }
72
- else {
73
- onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
74
- }
75
- return resolveCollection(CN, ctx, token, onError, tagName);
76
- }
77
- }
78
- const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
79
- const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
80
- const node = identity.isNode(res)
81
- ? res
82
- : new Scalar.Scalar(res);
83
- node.range = coll.range;
84
- node.tag = tagName;
85
- if (tag?.format)
86
- node.format = tag.format;
87
- return node;
88
- }
89
-
90
- exports.composeCollection = composeCollection;
@@ -1,88 +0,0 @@
1
- import { isNode } from '../nodes/identity.mjs';
2
- import { Scalar } from '../nodes/Scalar.mjs';
3
- import { YAMLMap } from '../nodes/YAMLMap.mjs';
4
- import { YAMLSeq } from '../nodes/YAMLSeq.mjs';
5
- import { resolveBlockMap } from './resolve-block-map.mjs';
6
- import { resolveBlockSeq } from './resolve-block-seq.mjs';
7
- import { resolveFlowCollection } from './resolve-flow-collection.mjs';
8
-
9
- function resolveCollection(CN, ctx, token, onError, tagName, tag) {
10
- const coll = token.type === 'block-map'
11
- ? resolveBlockMap(CN, ctx, token, onError, tag)
12
- : token.type === 'block-seq'
13
- ? resolveBlockSeq(CN, ctx, token, onError, tag)
14
- : resolveFlowCollection(CN, ctx, token, onError, tag);
15
- const Coll = coll.constructor;
16
- // If we got a tagName matching the class, or the tag name is '!',
17
- // then use the tagName from the node class used to create it.
18
- if (tagName === '!' || tagName === Coll.tagName) {
19
- coll.tag = Coll.tagName;
20
- return coll;
21
- }
22
- if (tagName)
23
- coll.tag = tagName;
24
- return coll;
25
- }
26
- function composeCollection(CN, ctx, token, props, onError) {
27
- const tagToken = props.tag;
28
- const tagName = !tagToken
29
- ? null
30
- : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
31
- if (token.type === 'block-seq') {
32
- const { anchor, newlineAfterProp: nl } = props;
33
- const lastProp = anchor && tagToken
34
- ? anchor.offset > tagToken.offset
35
- ? anchor
36
- : tagToken
37
- : (anchor ?? tagToken);
38
- if (lastProp && (!nl || nl.offset < lastProp.offset)) {
39
- const message = 'Missing newline after block sequence props';
40
- onError(lastProp, 'MISSING_CHAR', message);
41
- }
42
- }
43
- const expType = token.type === 'block-map'
44
- ? 'map'
45
- : token.type === 'block-seq'
46
- ? 'seq'
47
- : token.start.source === '{'
48
- ? 'map'
49
- : 'seq';
50
- // shortcut: check if it's a generic YAMLMap or YAMLSeq
51
- // before jumping into the custom tag logic.
52
- if (!tagToken ||
53
- !tagName ||
54
- tagName === '!' ||
55
- (tagName === YAMLMap.tagName && expType === 'map') ||
56
- (tagName === YAMLSeq.tagName && expType === 'seq')) {
57
- return resolveCollection(CN, ctx, token, onError, tagName);
58
- }
59
- let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
60
- if (!tag) {
61
- const kt = ctx.schema.knownTags[tagName];
62
- if (kt?.collection === expType) {
63
- ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
64
- tag = kt;
65
- }
66
- else {
67
- if (kt) {
68
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
69
- }
70
- else {
71
- onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
72
- }
73
- return resolveCollection(CN, ctx, token, onError, tagName);
74
- }
75
- }
76
- const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
77
- const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
78
- const node = isNode(res)
79
- ? res
80
- : new Scalar(res);
81
- node.range = coll.range;
82
- node.tag = tagName;
83
- if (tag?.format)
84
- node.format = tag.format;
85
- return node;
86
- }
87
-
88
- export { composeCollection };
@@ -1,45 +0,0 @@
1
- 'use strict';
2
-
3
- var Document = require('../doc/Document.js');
4
- var composeNode = require('./compose-node.js');
5
- var resolveEnd = require('./resolve-end.js');
6
- var resolveProps = require('./resolve-props.js');
7
-
8
- function composeDoc(options, directives, { offset, start, value, end }, onError) {
9
- const opts = Object.assign({ _directives: directives }, options);
10
- const doc = new Document.Document(undefined, opts);
11
- const ctx = {
12
- atKey: false,
13
- atRoot: true,
14
- directives: doc.directives,
15
- options: doc.options,
16
- schema: doc.schema
17
- };
18
- const props = resolveProps.resolveProps(start, {
19
- indicator: 'doc-start',
20
- next: value ?? end?.[0],
21
- offset,
22
- onError,
23
- parentIndent: 0,
24
- startOnNewline: true
25
- });
26
- if (props.found) {
27
- doc.directives.docStart = true;
28
- if (value &&
29
- (value.type === 'block-map' || value.type === 'block-seq') &&
30
- !props.hasNewline)
31
- onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');
32
- }
33
- // @ts-expect-error If Contents is set, let's trust the user
34
- doc.contents = value
35
- ? composeNode.composeNode(ctx, value, props, onError)
36
- : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
37
- const contentEnd = doc.contents.range[2];
38
- const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
39
- if (re.comment)
40
- doc.comment = re.comment;
41
- doc.range = [offset, contentEnd, re.offset];
42
- return doc;
43
- }
44
-
45
- exports.composeDoc = composeDoc;
@@ -1,43 +0,0 @@
1
- import { Document } from '../doc/Document.mjs';
2
- import { composeNode, composeEmptyNode } from './compose-node.mjs';
3
- import { resolveEnd } from './resolve-end.mjs';
4
- import { resolveProps } from './resolve-props.mjs';
5
-
6
- function composeDoc(options, directives, { offset, start, value, end }, onError) {
7
- const opts = Object.assign({ _directives: directives }, options);
8
- const doc = new Document(undefined, opts);
9
- const ctx = {
10
- atKey: false,
11
- atRoot: true,
12
- directives: doc.directives,
13
- options: doc.options,
14
- schema: doc.schema
15
- };
16
- const props = resolveProps(start, {
17
- indicator: 'doc-start',
18
- next: value ?? end?.[0],
19
- offset,
20
- onError,
21
- parentIndent: 0,
22
- startOnNewline: true
23
- });
24
- if (props.found) {
25
- doc.directives.docStart = true;
26
- if (value &&
27
- (value.type === 'block-map' || value.type === 'block-seq') &&
28
- !props.hasNewline)
29
- onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');
30
- }
31
- // @ts-expect-error If Contents is set, let's trust the user
32
- doc.contents = value
33
- ? composeNode(ctx, value, props, onError)
34
- : composeEmptyNode(ctx, props.end, start, null, props, onError);
35
- const contentEnd = doc.contents.range[2];
36
- const re = resolveEnd(end, contentEnd, false, onError);
37
- if (re.comment)
38
- doc.comment = re.comment;
39
- doc.range = [offset, contentEnd, re.offset];
40
- return doc;
41
- }
42
-
43
- export { composeDoc };
@@ -1,105 +0,0 @@
1
- 'use strict';
2
-
3
- var Alias = require('../nodes/Alias.js');
4
- var identity = require('../nodes/identity.js');
5
- var composeCollection = require('./compose-collection.js');
6
- var composeScalar = require('./compose-scalar.js');
7
- var resolveEnd = require('./resolve-end.js');
8
- var utilEmptyScalarPosition = require('./util-empty-scalar-position.js');
9
-
10
- const CN = { composeNode, composeEmptyNode };
11
- function composeNode(ctx, token, props, onError) {
12
- const atKey = ctx.atKey;
13
- const { spaceBefore, comment, anchor, tag } = props;
14
- let node;
15
- let isSrcToken = true;
16
- switch (token.type) {
17
- case 'alias':
18
- node = composeAlias(ctx, token, onError);
19
- if (anchor || tag)
20
- onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
21
- break;
22
- case 'scalar':
23
- case 'single-quoted-scalar':
24
- case 'double-quoted-scalar':
25
- case 'block-scalar':
26
- node = composeScalar.composeScalar(ctx, token, tag, onError);
27
- if (anchor)
28
- node.anchor = anchor.source.substring(1);
29
- break;
30
- case 'block-map':
31
- case 'block-seq':
32
- case 'flow-collection':
33
- node = composeCollection.composeCollection(CN, ctx, token, props, onError);
34
- if (anchor)
35
- node.anchor = anchor.source.substring(1);
36
- break;
37
- default: {
38
- const message = token.type === 'error'
39
- ? token.message
40
- : `Unsupported token (type: ${token.type})`;
41
- onError(token, 'UNEXPECTED_TOKEN', message);
42
- node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
43
- isSrcToken = false;
44
- }
45
- }
46
- if (anchor && node.anchor === '')
47
- onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
48
- if (atKey &&
49
- ctx.options.stringKeys &&
50
- (!identity.isScalar(node) ||
51
- typeof node.value !== 'string' ||
52
- (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
53
- const msg = 'With stringKeys, all keys must be strings';
54
- onError(tag ?? token, 'NON_STRING_KEY', msg);
55
- }
56
- if (spaceBefore)
57
- node.spaceBefore = true;
58
- if (comment) {
59
- if (token.type === 'scalar' && token.source === '')
60
- node.comment = comment;
61
- else
62
- node.commentBefore = comment;
63
- }
64
- // @ts-expect-error Type checking misses meaning of isSrcToken
65
- if (ctx.options.keepSourceTokens && isSrcToken)
66
- node.srcToken = token;
67
- return node;
68
- }
69
- function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
70
- const token = {
71
- type: 'scalar',
72
- offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
73
- indent: -1,
74
- source: ''
75
- };
76
- const node = composeScalar.composeScalar(ctx, token, tag, onError);
77
- if (anchor) {
78
- node.anchor = anchor.source.substring(1);
79
- if (node.anchor === '')
80
- onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
81
- }
82
- if (spaceBefore)
83
- node.spaceBefore = true;
84
- if (comment) {
85
- node.comment = comment;
86
- node.range[2] = end;
87
- }
88
- return node;
89
- }
90
- function composeAlias({ options }, { offset, source, end }, onError) {
91
- const alias = new Alias.Alias(source.substring(1));
92
- if (alias.source === '')
93
- onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
94
- if (alias.source.endsWith(':'))
95
- onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
96
- const valueEnd = offset + source.length;
97
- const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
98
- alias.range = [offset, valueEnd, re.offset];
99
- if (re.comment)
100
- alias.comment = re.comment;
101
- return alias;
102
- }
103
-
104
- exports.composeEmptyNode = composeEmptyNode;
105
- exports.composeNode = composeNode;
@@ -1,102 +0,0 @@
1
- import { Alias } from '../nodes/Alias.mjs';
2
- import { isScalar } from '../nodes/identity.mjs';
3
- import { composeCollection } from './compose-collection.mjs';
4
- import { composeScalar } from './compose-scalar.mjs';
5
- import { resolveEnd } from './resolve-end.mjs';
6
- import { emptyScalarPosition } from './util-empty-scalar-position.mjs';
7
-
8
- const CN = { composeNode, composeEmptyNode };
9
- function composeNode(ctx, token, props, onError) {
10
- const atKey = ctx.atKey;
11
- const { spaceBefore, comment, anchor, tag } = props;
12
- let node;
13
- let isSrcToken = true;
14
- switch (token.type) {
15
- case 'alias':
16
- node = composeAlias(ctx, token, onError);
17
- if (anchor || tag)
18
- onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
19
- break;
20
- case 'scalar':
21
- case 'single-quoted-scalar':
22
- case 'double-quoted-scalar':
23
- case 'block-scalar':
24
- node = composeScalar(ctx, token, tag, onError);
25
- if (anchor)
26
- node.anchor = anchor.source.substring(1);
27
- break;
28
- case 'block-map':
29
- case 'block-seq':
30
- case 'flow-collection':
31
- node = composeCollection(CN, ctx, token, props, onError);
32
- if (anchor)
33
- node.anchor = anchor.source.substring(1);
34
- break;
35
- default: {
36
- const message = token.type === 'error'
37
- ? token.message
38
- : `Unsupported token (type: ${token.type})`;
39
- onError(token, 'UNEXPECTED_TOKEN', message);
40
- node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
41
- isSrcToken = false;
42
- }
43
- }
44
- if (anchor && node.anchor === '')
45
- onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
46
- if (atKey &&
47
- ctx.options.stringKeys &&
48
- (!isScalar(node) ||
49
- typeof node.value !== 'string' ||
50
- (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
51
- const msg = 'With stringKeys, all keys must be strings';
52
- onError(tag ?? token, 'NON_STRING_KEY', msg);
53
- }
54
- if (spaceBefore)
55
- node.spaceBefore = true;
56
- if (comment) {
57
- if (token.type === 'scalar' && token.source === '')
58
- node.comment = comment;
59
- else
60
- node.commentBefore = comment;
61
- }
62
- // @ts-expect-error Type checking misses meaning of isSrcToken
63
- if (ctx.options.keepSourceTokens && isSrcToken)
64
- node.srcToken = token;
65
- return node;
66
- }
67
- function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
68
- const token = {
69
- type: 'scalar',
70
- offset: emptyScalarPosition(offset, before, pos),
71
- indent: -1,
72
- source: ''
73
- };
74
- const node = composeScalar(ctx, token, tag, onError);
75
- if (anchor) {
76
- node.anchor = anchor.source.substring(1);
77
- if (node.anchor === '')
78
- onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
79
- }
80
- if (spaceBefore)
81
- node.spaceBefore = true;
82
- if (comment) {
83
- node.comment = comment;
84
- node.range[2] = end;
85
- }
86
- return node;
87
- }
88
- function composeAlias({ options }, { offset, source, end }, onError) {
89
- const alias = new Alias(source.substring(1));
90
- if (alias.source === '')
91
- onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
92
- if (alias.source.endsWith(':'))
93
- onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
94
- const valueEnd = offset + source.length;
95
- const re = resolveEnd(end, valueEnd, options.strict, onError);
96
- alias.range = [offset, valueEnd, re.offset];
97
- if (re.comment)
98
- alias.comment = re.comment;
99
- return alias;
100
- }
101
-
102
- export { composeEmptyNode, composeNode };
@@ -1,88 +0,0 @@
1
- 'use strict';
2
-
3
- var identity = require('../nodes/identity.js');
4
- var Scalar = require('../nodes/Scalar.js');
5
- var resolveBlockScalar = require('./resolve-block-scalar.js');
6
- var resolveFlowScalar = require('./resolve-flow-scalar.js');
7
-
8
- function composeScalar(ctx, token, tagToken, onError) {
9
- const { value, type, comment, range } = token.type === 'block-scalar'
10
- ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError)
11
- : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
12
- const tagName = tagToken
13
- ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
14
- : null;
15
- let tag;
16
- if (ctx.options.stringKeys && ctx.atKey) {
17
- tag = ctx.schema[identity.SCALAR];
18
- }
19
- else if (tagName)
20
- tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
21
- else if (token.type === 'scalar')
22
- tag = findScalarTagByTest(ctx, value, token, onError);
23
- else
24
- tag = ctx.schema[identity.SCALAR];
25
- let scalar;
26
- try {
27
- const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
28
- scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
29
- }
30
- catch (error) {
31
- const msg = error instanceof Error ? error.message : String(error);
32
- onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);
33
- scalar = new Scalar.Scalar(value);
34
- }
35
- scalar.range = range;
36
- scalar.source = value;
37
- if (type)
38
- scalar.type = type;
39
- if (tagName)
40
- scalar.tag = tagName;
41
- if (tag.format)
42
- scalar.format = tag.format;
43
- if (comment)
44
- scalar.comment = comment;
45
- return scalar;
46
- }
47
- function findScalarTagByName(schema, value, tagName, tagToken, onError) {
48
- if (tagName === '!')
49
- return schema[identity.SCALAR]; // non-specific tag
50
- const matchWithTest = [];
51
- for (const tag of schema.tags) {
52
- if (!tag.collection && tag.tag === tagName) {
53
- if (tag.default && tag.test)
54
- matchWithTest.push(tag);
55
- else
56
- return tag;
57
- }
58
- }
59
- for (const tag of matchWithTest)
60
- if (tag.test?.test(value))
61
- return tag;
62
- const kt = schema.knownTags[tagName];
63
- if (kt && !kt.collection) {
64
- // Ensure that the known tag is available for stringifying,
65
- // but does not get used by default.
66
- schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
67
- return kt;
68
- }
69
- onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
70
- return schema[identity.SCALAR];
71
- }
72
- function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
73
- const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
74
- tag.test?.test(value)) || schema[identity.SCALAR];
75
- if (schema.compat) {
76
- const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
77
- schema[identity.SCALAR];
78
- if (tag.tag !== compat.tag) {
79
- const ts = directives.tagString(tag.tag);
80
- const cs = directives.tagString(compat.tag);
81
- const msg = `Value may be parsed as either ${ts} or ${cs}`;
82
- onError(token, 'TAG_RESOLVE_FAILED', msg, true);
83
- }
84
- }
85
- return tag;
86
- }
87
-
88
- exports.composeScalar = composeScalar;
@@ -1,86 +0,0 @@
1
- import { SCALAR, isScalar } from '../nodes/identity.mjs';
2
- import { Scalar } from '../nodes/Scalar.mjs';
3
- import { resolveBlockScalar } from './resolve-block-scalar.mjs';
4
- import { resolveFlowScalar } from './resolve-flow-scalar.mjs';
5
-
6
- function composeScalar(ctx, token, tagToken, onError) {
7
- const { value, type, comment, range } = token.type === 'block-scalar'
8
- ? resolveBlockScalar(ctx, token, onError)
9
- : resolveFlowScalar(token, ctx.options.strict, onError);
10
- const tagName = tagToken
11
- ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
12
- : null;
13
- let tag;
14
- if (ctx.options.stringKeys && ctx.atKey) {
15
- tag = ctx.schema[SCALAR];
16
- }
17
- else if (tagName)
18
- tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
19
- else if (token.type === 'scalar')
20
- tag = findScalarTagByTest(ctx, value, token, onError);
21
- else
22
- tag = ctx.schema[SCALAR];
23
- let scalar;
24
- try {
25
- const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
26
- scalar = isScalar(res) ? res : new Scalar(res);
27
- }
28
- catch (error) {
29
- const msg = error instanceof Error ? error.message : String(error);
30
- onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);
31
- scalar = new Scalar(value);
32
- }
33
- scalar.range = range;
34
- scalar.source = value;
35
- if (type)
36
- scalar.type = type;
37
- if (tagName)
38
- scalar.tag = tagName;
39
- if (tag.format)
40
- scalar.format = tag.format;
41
- if (comment)
42
- scalar.comment = comment;
43
- return scalar;
44
- }
45
- function findScalarTagByName(schema, value, tagName, tagToken, onError) {
46
- if (tagName === '!')
47
- return schema[SCALAR]; // non-specific tag
48
- const matchWithTest = [];
49
- for (const tag of schema.tags) {
50
- if (!tag.collection && tag.tag === tagName) {
51
- if (tag.default && tag.test)
52
- matchWithTest.push(tag);
53
- else
54
- return tag;
55
- }
56
- }
57
- for (const tag of matchWithTest)
58
- if (tag.test?.test(value))
59
- return tag;
60
- const kt = schema.knownTags[tagName];
61
- if (kt && !kt.collection) {
62
- // Ensure that the known tag is available for stringifying,
63
- // but does not get used by default.
64
- schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
65
- return kt;
66
- }
67
- onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
68
- return schema[SCALAR];
69
- }
70
- function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
71
- const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
72
- tag.test?.test(value)) || schema[SCALAR];
73
- if (schema.compat) {
74
- const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
75
- schema[SCALAR];
76
- if (tag.tag !== compat.tag) {
77
- const ts = directives.tagString(tag.tag);
78
- const cs = directives.tagString(compat.tag);
79
- const msg = `Value may be parsed as either ${ts} or ${cs}`;
80
- onError(token, 'TAG_RESOLVE_FAILED', msg, true);
81
- }
82
- }
83
- return tag;
84
- }
85
-
86
- export { composeScalar };