@windrun-huaiin/dev-scripts 14.0.0 → 14.1.1

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 (250) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +7 -0
  2. package/dist/_virtual/_commonjsHelpers.mjs +5 -0
  3. package/dist/_virtual/index.js +11 -0
  4. package/dist/_virtual/index.mjs +7 -0
  5. package/dist/_virtual/re.js +5 -0
  6. package/dist/_virtual/re.mjs +3 -0
  7. package/dist/cli.js +33 -1
  8. package/dist/cli.mjs +33 -1
  9. package/dist/commands/diaomao-update.d.ts +3 -0
  10. package/dist/commands/diaomao-update.d.ts.map +1 -0
  11. package/dist/commands/diaomao-update.js +336 -0
  12. package/dist/commands/diaomao-update.mjs +334 -0
  13. package/dist/config/index.d.ts.map +1 -1
  14. package/dist/config/index.js +9 -0
  15. package/dist/config/index.mjs +9 -0
  16. package/dist/config/schema.d.ts +5 -0
  17. package/dist/config/schema.d.ts.map +1 -1
  18. package/dist/config/schema.js +5 -0
  19. package/dist/config/schema.mjs +5 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +2 -0
  23. package/dist/index.mjs +1 -0
  24. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js +161 -0
  25. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.mjs +159 -0
  26. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js +576 -0
  27. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.mjs +574 -0
  28. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js +350 -0
  29. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.mjs +348 -0
  30. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js +21 -0
  31. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.mjs +19 -0
  32. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js +72 -0
  33. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.mjs +70 -0
  34. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js +77 -0
  35. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.mjs +75 -0
  36. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js +22 -0
  37. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.mjs +20 -0
  38. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js +18 -0
  39. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.mjs +16 -0
  40. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js +20 -0
  41. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.mjs +18 -0
  42. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js +73 -0
  43. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.mjs +71 -0
  44. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js +18 -0
  45. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.mjs +16 -0
  46. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js +18 -0
  47. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.mjs +16 -0
  48. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js +18 -0
  49. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.mjs +16 -0
  50. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js +34 -0
  51. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.mjs +32 -0
  52. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js +18 -0
  53. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.mjs +16 -0
  54. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js +18 -0
  55. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.mjs +16 -0
  56. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js +18 -0
  57. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.mjs +16 -0
  58. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js +18 -0
  59. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.mjs +16 -0
  60. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js +18 -0
  61. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.mjs +16 -0
  62. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js +31 -0
  63. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.mjs +29 -0
  64. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js +18 -0
  65. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.mjs +16 -0
  66. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js +21 -0
  67. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.mjs +19 -0
  68. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js +18 -0
  69. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.mjs +16 -0
  70. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js +18 -0
  71. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.mjs +16 -0
  72. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js +25 -0
  73. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.mjs +23 -0
  74. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js +18 -0
  75. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.mjs +16 -0
  76. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js +21 -0
  77. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.mjs +19 -0
  78. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js +144 -0
  79. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.mjs +142 -0
  80. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js +48 -0
  81. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.mjs +46 -0
  82. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js +22 -0
  83. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.mjs +20 -0
  84. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js +40 -0
  85. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.mjs +38 -0
  86. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js +53 -0
  87. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.mjs +51 -0
  88. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js +28 -0
  89. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.mjs +26 -0
  90. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js +239 -0
  91. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.mjs +237 -0
  92. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js +19 -0
  93. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.mjs +17 -0
  94. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js +22 -0
  95. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.mjs +20 -0
  96. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js +19 -0
  97. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.mjs +17 -0
  98. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js +41 -0
  99. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.mjs +39 -0
  100. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js +40 -0
  101. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.mjs +38 -0
  102. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js +78 -0
  103. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.mjs +76 -0
  104. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js +102 -0
  105. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.mjs +100 -0
  106. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js +63 -0
  107. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.mjs +61 -0
  108. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js +265 -0
  109. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.mjs +263 -0
  110. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js +23 -0
  111. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.mjs +21 -0
  112. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js +26 -0
  113. package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.mjs +24 -0
  114. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-collection.js +90 -0
  115. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-collection.mjs +88 -0
  116. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-doc.js +45 -0
  117. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-doc.mjs +43 -0
  118. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-node.js +105 -0
  119. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-node.mjs +102 -0
  120. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-scalar.js +88 -0
  121. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-scalar.mjs +86 -0
  122. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  123. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/composer.mjs +217 -0
  124. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-map.js +117 -0
  125. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-map.mjs +115 -0
  126. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +200 -0
  127. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-scalar.mjs +198 -0
  128. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +51 -0
  129. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-seq.mjs +49 -0
  130. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-end.js +39 -0
  131. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-end.mjs +37 -0
  132. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +209 -0
  133. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-collection.mjs +207 -0
  134. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
  135. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.mjs +223 -0
  136. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-props.js +148 -0
  137. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-props.mjs +146 -0
  138. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-contains-newline.js +36 -0
  139. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-contains-newline.mjs +34 -0
  140. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +28 -0
  141. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.mjs +26 -0
  142. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +17 -0
  143. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-flow-indent-check.mjs +15 -0
  144. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-map-includes.js +15 -0
  145. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-map-includes.mjs +13 -0
  146. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/Document.js +337 -0
  147. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/Document.mjs +335 -0
  148. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/anchors.js +76 -0
  149. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/anchors.mjs +71 -0
  150. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/applyReviver.js +57 -0
  151. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/applyReviver.mjs +55 -0
  152. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/createNode.js +90 -0
  153. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/createNode.mjs +88 -0
  154. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/directives.js +178 -0
  155. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/directives.mjs +176 -0
  156. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/errors.js +62 -0
  157. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/errors.mjs +57 -0
  158. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/log.js +9 -0
  159. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/log.mjs +7 -0
  160. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
  161. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Alias.mjs +114 -0
  162. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Collection.js +151 -0
  163. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Collection.mjs +147 -0
  164. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Node.js +40 -0
  165. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Node.mjs +38 -0
  166. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Pair.js +39 -0
  167. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Pair.mjs +36 -0
  168. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Scalar.js +27 -0
  169. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Scalar.mjs +24 -0
  170. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLMap.js +147 -0
  171. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLMap.mjs +144 -0
  172. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +115 -0
  173. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLSeq.mjs +113 -0
  174. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +65 -0
  175. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +63 -0
  176. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/identity.js +53 -0
  177. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/identity.mjs +36 -0
  178. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/toJS.js +39 -0
  179. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/toJS.mjs +37 -0
  180. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/cst.js +79 -0
  181. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/cst.mjs +73 -0
  182. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/lexer.js +719 -0
  183. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/lexer.mjs +717 -0
  184. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/line-counter.js +41 -0
  185. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/line-counter.mjs +39 -0
  186. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/parser.js +969 -0
  187. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/parser.mjs +967 -0
  188. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/public-api.js +68 -0
  189. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/public-api.mjs +64 -0
  190. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/Schema.js +39 -0
  191. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/Schema.mjs +37 -0
  192. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/map.js +19 -0
  193. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/map.mjs +17 -0
  194. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/null.js +17 -0
  195. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/null.mjs +15 -0
  196. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/seq.js +19 -0
  197. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/seq.mjs +17 -0
  198. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/string.js +16 -0
  199. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/string.mjs +14 -0
  200. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/bool.js +21 -0
  201. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/bool.mjs +19 -0
  202. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/float.js +47 -0
  203. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/float.mjs +43 -0
  204. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/int.js +42 -0
  205. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/int.mjs +38 -0
  206. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/schema.js +25 -0
  207. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/schema.mjs +23 -0
  208. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/json/schema.js +64 -0
  209. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/json/schema.mjs +62 -0
  210. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/tags.js +99 -0
  211. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/tags.mjs +96 -0
  212. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +60 -0
  213. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.mjs +58 -0
  214. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +29 -0
  215. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.mjs +26 -0
  216. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +50 -0
  217. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/float.mjs +46 -0
  218. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +76 -0
  219. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/int.mjs +71 -0
  220. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +68 -0
  221. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.mjs +64 -0
  222. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +77 -0
  223. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.mjs +74 -0
  224. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +82 -0
  225. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.mjs +78 -0
  226. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +41 -0
  227. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.mjs +39 -0
  228. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +96 -0
  229. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/set.mjs +93 -0
  230. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +105 -0
  231. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.mjs +101 -0
  232. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +151 -0
  233. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/foldFlowLines.mjs +146 -0
  234. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringify.js +131 -0
  235. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringify.mjs +128 -0
  236. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +145 -0
  237. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyCollection.mjs +143 -0
  238. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyComment.js +24 -0
  239. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyComment.mjs +20 -0
  240. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +87 -0
  241. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyDocument.mjs +85 -0
  242. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +26 -0
  243. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyNumber.mjs +24 -0
  244. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyPair.js +152 -0
  245. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyPair.mjs +150 -0
  246. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyString.js +338 -0
  247. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyString.mjs +336 -0
  248. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/visit.js +148 -0
  249. package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/visit.mjs +146 -0
  250. package/package.json +6 -4
@@ -0,0 +1,71 @@
1
+ import { stringifyNumber } from '../../stringify/stringifyNumber.mjs';
2
+
3
+ const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
4
+ function intResolve(str, offset, radix, { intAsBigInt }) {
5
+ const sign = str[0];
6
+ if (sign === '-' || sign === '+')
7
+ offset += 1;
8
+ str = str.substring(offset).replace(/_/g, '');
9
+ if (intAsBigInt) {
10
+ switch (radix) {
11
+ case 2:
12
+ str = `0b${str}`;
13
+ break;
14
+ case 8:
15
+ str = `0o${str}`;
16
+ break;
17
+ case 16:
18
+ str = `0x${str}`;
19
+ break;
20
+ }
21
+ const n = BigInt(str);
22
+ return sign === '-' ? BigInt(-1) * n : n;
23
+ }
24
+ const n = parseInt(str, radix);
25
+ return sign === '-' ? -1 * n : n;
26
+ }
27
+ function intStringify(node, radix, prefix) {
28
+ const { value } = node;
29
+ if (intIdentify(value)) {
30
+ const str = value.toString(radix);
31
+ return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;
32
+ }
33
+ return stringifyNumber(node);
34
+ }
35
+ const intBin = {
36
+ identify: intIdentify,
37
+ default: true,
38
+ tag: 'tag:yaml.org,2002:int',
39
+ format: 'BIN',
40
+ test: /^[-+]?0b[0-1_]+$/,
41
+ resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),
42
+ stringify: node => intStringify(node, 2, '0b')
43
+ };
44
+ const intOct = {
45
+ identify: intIdentify,
46
+ default: true,
47
+ tag: 'tag:yaml.org,2002:int',
48
+ format: 'OCT',
49
+ test: /^[-+]?0[0-7_]+$/,
50
+ resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),
51
+ stringify: node => intStringify(node, 8, '0')
52
+ };
53
+ const int = {
54
+ identify: intIdentify,
55
+ default: true,
56
+ tag: 'tag:yaml.org,2002:int',
57
+ test: /^[-+]?[0-9][0-9_]*$/,
58
+ resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
59
+ stringify: stringifyNumber
60
+ };
61
+ const intHex = {
62
+ identify: intIdentify,
63
+ default: true,
64
+ tag: 'tag:yaml.org,2002:int',
65
+ format: 'HEX',
66
+ test: /^[-+]?0x[0-9a-fA-F_]+$/,
67
+ resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
68
+ stringify: node => intStringify(node, 16, '0x')
69
+ };
70
+
71
+ export { int, intBin, intHex, intOct };
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var identity = require('../../nodes/identity.js');
4
+ var Scalar = require('../../nodes/Scalar.js');
5
+
6
+ // If the value associated with a merge key is a single mapping node, each of
7
+ // its key/value pairs is inserted into the current mapping, unless the key
8
+ // already exists in it. If the value associated with the merge key is a
9
+ // sequence, then this sequence is expected to contain mapping nodes and each
10
+ // of these nodes is merged in turn according to its order in the sequence.
11
+ // Keys in mapping nodes earlier in the sequence override keys specified in
12
+ // later mapping nodes. -- http://yaml.org/type/merge.html
13
+ const MERGE_KEY = '<<';
14
+ const merge = {
15
+ identify: value => value === MERGE_KEY ||
16
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
17
+ default: 'key',
18
+ tag: 'tag:yaml.org,2002:merge',
19
+ test: /^<<$/,
20
+ resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
21
+ addToJSMap: addMergeToJSMap
22
+ }),
23
+ stringify: () => MERGE_KEY
24
+ };
25
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
26
+ (identity.isScalar(key) &&
27
+ (!key.type || key.type === Scalar.Scalar.PLAIN) &&
28
+ merge.identify(key.value))) &&
29
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
30
+ function addMergeToJSMap(ctx, map, value) {
31
+ value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
32
+ if (identity.isSeq(value))
33
+ for (const it of value.items)
34
+ mergeValue(ctx, map, it);
35
+ else if (Array.isArray(value))
36
+ for (const it of value)
37
+ mergeValue(ctx, map, it);
38
+ else
39
+ mergeValue(ctx, map, value);
40
+ }
41
+ function mergeValue(ctx, map, value) {
42
+ const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
43
+ if (!identity.isMap(source))
44
+ throw new Error('Merge sources must be maps or map aliases');
45
+ const srcMap = source.toJSON(null, ctx, Map);
46
+ for (const [key, value] of srcMap) {
47
+ if (map instanceof Map) {
48
+ if (!map.has(key))
49
+ map.set(key, value);
50
+ }
51
+ else if (map instanceof Set) {
52
+ map.add(key);
53
+ }
54
+ else if (!Object.prototype.hasOwnProperty.call(map, key)) {
55
+ Object.defineProperty(map, key, {
56
+ value,
57
+ writable: true,
58
+ enumerable: true,
59
+ configurable: true
60
+ });
61
+ }
62
+ }
63
+ return map;
64
+ }
65
+
66
+ exports.addMergeToJSMap = addMergeToJSMap;
67
+ exports.isMergeKey = isMergeKey;
68
+ exports.merge = merge;
@@ -0,0 +1,64 @@
1
+ import { isScalar, isAlias, isSeq, isMap } from '../../nodes/identity.mjs';
2
+ import { Scalar } from '../../nodes/Scalar.mjs';
3
+
4
+ // If the value associated with a merge key is a single mapping node, each of
5
+ // its key/value pairs is inserted into the current mapping, unless the key
6
+ // already exists in it. If the value associated with the merge key is a
7
+ // sequence, then this sequence is expected to contain mapping nodes and each
8
+ // of these nodes is merged in turn according to its order in the sequence.
9
+ // Keys in mapping nodes earlier in the sequence override keys specified in
10
+ // later mapping nodes. -- http://yaml.org/type/merge.html
11
+ const MERGE_KEY = '<<';
12
+ const merge = {
13
+ identify: value => value === MERGE_KEY ||
14
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
15
+ default: 'key',
16
+ tag: 'tag:yaml.org,2002:merge',
17
+ test: /^<<$/,
18
+ resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
19
+ addToJSMap: addMergeToJSMap
20
+ }),
21
+ stringify: () => MERGE_KEY
22
+ };
23
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
24
+ (isScalar(key) &&
25
+ (!key.type || key.type === Scalar.PLAIN) &&
26
+ merge.identify(key.value))) &&
27
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
28
+ function addMergeToJSMap(ctx, map, value) {
29
+ value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
30
+ if (isSeq(value))
31
+ for (const it of value.items)
32
+ mergeValue(ctx, map, it);
33
+ else if (Array.isArray(value))
34
+ for (const it of value)
35
+ mergeValue(ctx, map, it);
36
+ else
37
+ mergeValue(ctx, map, value);
38
+ }
39
+ function mergeValue(ctx, map, value) {
40
+ const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
41
+ if (!isMap(source))
42
+ throw new Error('Merge sources must be maps or map aliases');
43
+ const srcMap = source.toJSON(null, ctx, Map);
44
+ for (const [key, value] of srcMap) {
45
+ if (map instanceof Map) {
46
+ if (!map.has(key))
47
+ map.set(key, value);
48
+ }
49
+ else if (map instanceof Set) {
50
+ map.add(key);
51
+ }
52
+ else if (!Object.prototype.hasOwnProperty.call(map, key)) {
53
+ Object.defineProperty(map, key, {
54
+ value,
55
+ writable: true,
56
+ enumerable: true,
57
+ configurable: true
58
+ });
59
+ }
60
+ }
61
+ return map;
62
+ }
63
+
64
+ export { addMergeToJSMap, isMergeKey, merge };
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ var identity = require('../../nodes/identity.js');
4
+ var toJS = require('../../nodes/toJS.js');
5
+ var YAMLMap = require('../../nodes/YAMLMap.js');
6
+ var YAMLSeq = require('../../nodes/YAMLSeq.js');
7
+ var pairs = require('./pairs.js');
8
+
9
+ class YAMLOMap extends YAMLSeq.YAMLSeq {
10
+ constructor() {
11
+ super();
12
+ this.add = YAMLMap.YAMLMap.prototype.add.bind(this);
13
+ this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);
14
+ this.get = YAMLMap.YAMLMap.prototype.get.bind(this);
15
+ this.has = YAMLMap.YAMLMap.prototype.has.bind(this);
16
+ this.set = YAMLMap.YAMLMap.prototype.set.bind(this);
17
+ this.tag = YAMLOMap.tag;
18
+ }
19
+ /**
20
+ * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
21
+ * but TypeScript won't allow widening the signature of a child method.
22
+ */
23
+ toJSON(_, ctx) {
24
+ if (!ctx)
25
+ return super.toJSON(_);
26
+ const map = new Map();
27
+ if (ctx?.onCreate)
28
+ ctx.onCreate(map);
29
+ for (const pair of this.items) {
30
+ let key, value;
31
+ if (identity.isPair(pair)) {
32
+ key = toJS.toJS(pair.key, '', ctx);
33
+ value = toJS.toJS(pair.value, key, ctx);
34
+ }
35
+ else {
36
+ key = toJS.toJS(pair, '', ctx);
37
+ }
38
+ if (map.has(key))
39
+ throw new Error('Ordered maps must not include duplicate keys');
40
+ map.set(key, value);
41
+ }
42
+ return map;
43
+ }
44
+ static from(schema, iterable, ctx) {
45
+ const pairs$1 = pairs.createPairs(schema, iterable, ctx);
46
+ const omap = new this();
47
+ omap.items = pairs$1.items;
48
+ return omap;
49
+ }
50
+ }
51
+ YAMLOMap.tag = 'tag:yaml.org,2002:omap';
52
+ const omap = {
53
+ collection: 'seq',
54
+ identify: value => value instanceof Map,
55
+ nodeClass: YAMLOMap,
56
+ default: false,
57
+ tag: 'tag:yaml.org,2002:omap',
58
+ resolve(seq, onError) {
59
+ const pairs$1 = pairs.resolvePairs(seq, onError);
60
+ const seenKeys = [];
61
+ for (const { key } of pairs$1.items) {
62
+ if (identity.isScalar(key)) {
63
+ if (seenKeys.includes(key.value)) {
64
+ onError(`Ordered maps must not include duplicate keys: ${key.value}`);
65
+ }
66
+ else {
67
+ seenKeys.push(key.value);
68
+ }
69
+ }
70
+ }
71
+ return Object.assign(new YAMLOMap(), pairs$1);
72
+ },
73
+ createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
74
+ };
75
+
76
+ exports.YAMLOMap = YAMLOMap;
77
+ exports.omap = omap;
@@ -0,0 +1,74 @@
1
+ import { isPair, isScalar } from '../../nodes/identity.mjs';
2
+ import { toJS } from '../../nodes/toJS.mjs';
3
+ import { YAMLMap } from '../../nodes/YAMLMap.mjs';
4
+ import { YAMLSeq } from '../../nodes/YAMLSeq.mjs';
5
+ import { createPairs, resolvePairs } from './pairs.mjs';
6
+
7
+ class YAMLOMap extends YAMLSeq {
8
+ constructor() {
9
+ super();
10
+ this.add = YAMLMap.prototype.add.bind(this);
11
+ this.delete = YAMLMap.prototype.delete.bind(this);
12
+ this.get = YAMLMap.prototype.get.bind(this);
13
+ this.has = YAMLMap.prototype.has.bind(this);
14
+ this.set = YAMLMap.prototype.set.bind(this);
15
+ this.tag = YAMLOMap.tag;
16
+ }
17
+ /**
18
+ * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
19
+ * but TypeScript won't allow widening the signature of a child method.
20
+ */
21
+ toJSON(_, ctx) {
22
+ if (!ctx)
23
+ return super.toJSON(_);
24
+ const map = new Map();
25
+ if (ctx?.onCreate)
26
+ ctx.onCreate(map);
27
+ for (const pair of this.items) {
28
+ let key, value;
29
+ if (isPair(pair)) {
30
+ key = toJS(pair.key, '', ctx);
31
+ value = toJS(pair.value, key, ctx);
32
+ }
33
+ else {
34
+ key = toJS(pair, '', ctx);
35
+ }
36
+ if (map.has(key))
37
+ throw new Error('Ordered maps must not include duplicate keys');
38
+ map.set(key, value);
39
+ }
40
+ return map;
41
+ }
42
+ static from(schema, iterable, ctx) {
43
+ const pairs = createPairs(schema, iterable, ctx);
44
+ const omap = new this();
45
+ omap.items = pairs.items;
46
+ return omap;
47
+ }
48
+ }
49
+ YAMLOMap.tag = 'tag:yaml.org,2002:omap';
50
+ const omap = {
51
+ collection: 'seq',
52
+ identify: value => value instanceof Map,
53
+ nodeClass: YAMLOMap,
54
+ default: false,
55
+ tag: 'tag:yaml.org,2002:omap',
56
+ resolve(seq, onError) {
57
+ const pairs = resolvePairs(seq, onError);
58
+ const seenKeys = [];
59
+ for (const { key } of pairs.items) {
60
+ if (isScalar(key)) {
61
+ if (seenKeys.includes(key.value)) {
62
+ onError(`Ordered maps must not include duplicate keys: ${key.value}`);
63
+ }
64
+ else {
65
+ seenKeys.push(key.value);
66
+ }
67
+ }
68
+ }
69
+ return Object.assign(new YAMLOMap(), pairs);
70
+ },
71
+ createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
72
+ };
73
+
74
+ export { YAMLOMap, omap };
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+
3
+ var identity = require('../../nodes/identity.js');
4
+ var Pair = require('../../nodes/Pair.js');
5
+ var Scalar = require('../../nodes/Scalar.js');
6
+ var YAMLSeq = require('../../nodes/YAMLSeq.js');
7
+
8
+ function resolvePairs(seq, onError) {
9
+ if (identity.isSeq(seq)) {
10
+ for (let i = 0; i < seq.items.length; ++i) {
11
+ let item = seq.items[i];
12
+ if (identity.isPair(item))
13
+ continue;
14
+ else if (identity.isMap(item)) {
15
+ if (item.items.length > 1)
16
+ onError('Each pair must have its own sequence indicator');
17
+ const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
18
+ if (item.commentBefore)
19
+ pair.key.commentBefore = pair.key.commentBefore
20
+ ? `${item.commentBefore}\n${pair.key.commentBefore}`
21
+ : item.commentBefore;
22
+ if (item.comment) {
23
+ const cn = pair.value ?? pair.key;
24
+ cn.comment = cn.comment
25
+ ? `${item.comment}\n${cn.comment}`
26
+ : item.comment;
27
+ }
28
+ item = pair;
29
+ }
30
+ seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);
31
+ }
32
+ }
33
+ else
34
+ onError('Expected a sequence for this tag');
35
+ return seq;
36
+ }
37
+ function createPairs(schema, iterable, ctx) {
38
+ const { replacer } = ctx;
39
+ const pairs = new YAMLSeq.YAMLSeq(schema);
40
+ pairs.tag = 'tag:yaml.org,2002:pairs';
41
+ let i = 0;
42
+ if (iterable && Symbol.iterator in Object(iterable))
43
+ for (let it of iterable) {
44
+ if (typeof replacer === 'function')
45
+ it = replacer.call(iterable, String(i++), it);
46
+ let key, value;
47
+ if (Array.isArray(it)) {
48
+ if (it.length === 2) {
49
+ key = it[0];
50
+ value = it[1];
51
+ }
52
+ else
53
+ throw new TypeError(`Expected [key, value] tuple: ${it}`);
54
+ }
55
+ else if (it && it instanceof Object) {
56
+ const keys = Object.keys(it);
57
+ if (keys.length === 1) {
58
+ key = keys[0];
59
+ value = it[key];
60
+ }
61
+ else {
62
+ throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
63
+ }
64
+ }
65
+ else {
66
+ key = it;
67
+ }
68
+ pairs.items.push(Pair.createPair(key, value, ctx));
69
+ }
70
+ return pairs;
71
+ }
72
+ const pairs = {
73
+ collection: 'seq',
74
+ default: false,
75
+ tag: 'tag:yaml.org,2002:pairs',
76
+ resolve: resolvePairs,
77
+ createNode: createPairs
78
+ };
79
+
80
+ exports.createPairs = createPairs;
81
+ exports.pairs = pairs;
82
+ exports.resolvePairs = resolvePairs;
@@ -0,0 +1,78 @@
1
+ import { isSeq, isPair, isMap } from '../../nodes/identity.mjs';
2
+ import { createPair, Pair } from '../../nodes/Pair.mjs';
3
+ import { Scalar } from '../../nodes/Scalar.mjs';
4
+ import { YAMLSeq } from '../../nodes/YAMLSeq.mjs';
5
+
6
+ function resolvePairs(seq, onError) {
7
+ if (isSeq(seq)) {
8
+ for (let i = 0; i < seq.items.length; ++i) {
9
+ let item = seq.items[i];
10
+ if (isPair(item))
11
+ continue;
12
+ else if (isMap(item)) {
13
+ if (item.items.length > 1)
14
+ onError('Each pair must have its own sequence indicator');
15
+ const pair = item.items[0] || new Pair(new Scalar(null));
16
+ if (item.commentBefore)
17
+ pair.key.commentBefore = pair.key.commentBefore
18
+ ? `${item.commentBefore}\n${pair.key.commentBefore}`
19
+ : item.commentBefore;
20
+ if (item.comment) {
21
+ const cn = pair.value ?? pair.key;
22
+ cn.comment = cn.comment
23
+ ? `${item.comment}\n${cn.comment}`
24
+ : item.comment;
25
+ }
26
+ item = pair;
27
+ }
28
+ seq.items[i] = isPair(item) ? item : new Pair(item);
29
+ }
30
+ }
31
+ else
32
+ onError('Expected a sequence for this tag');
33
+ return seq;
34
+ }
35
+ function createPairs(schema, iterable, ctx) {
36
+ const { replacer } = ctx;
37
+ const pairs = new YAMLSeq(schema);
38
+ pairs.tag = 'tag:yaml.org,2002:pairs';
39
+ let i = 0;
40
+ if (iterable && Symbol.iterator in Object(iterable))
41
+ for (let it of iterable) {
42
+ if (typeof replacer === 'function')
43
+ it = replacer.call(iterable, String(i++), it);
44
+ let key, value;
45
+ if (Array.isArray(it)) {
46
+ if (it.length === 2) {
47
+ key = it[0];
48
+ value = it[1];
49
+ }
50
+ else
51
+ throw new TypeError(`Expected [key, value] tuple: ${it}`);
52
+ }
53
+ else if (it && it instanceof Object) {
54
+ const keys = Object.keys(it);
55
+ if (keys.length === 1) {
56
+ key = keys[0];
57
+ value = it[key];
58
+ }
59
+ else {
60
+ throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
61
+ }
62
+ }
63
+ else {
64
+ key = it;
65
+ }
66
+ pairs.items.push(createPair(key, value, ctx));
67
+ }
68
+ return pairs;
69
+ }
70
+ const pairs = {
71
+ collection: 'seq',
72
+ default: false,
73
+ tag: 'tag:yaml.org,2002:pairs',
74
+ resolve: resolvePairs,
75
+ createNode: createPairs
76
+ };
77
+
78
+ export { createPairs, pairs, resolvePairs };
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var map = require('../common/map.js');
4
+ var _null = require('../common/null.js');
5
+ var seq = require('../common/seq.js');
6
+ var string = require('../common/string.js');
7
+ var binary = require('./binary.js');
8
+ var bool = require('./bool.js');
9
+ var float = require('./float.js');
10
+ var int = require('./int.js');
11
+ var merge = require('./merge.js');
12
+ var omap = require('./omap.js');
13
+ var pairs = require('./pairs.js');
14
+ var set = require('./set.js');
15
+ var timestamp = require('./timestamp.js');
16
+
17
+ const schema = [
18
+ map.map,
19
+ seq.seq,
20
+ string.string,
21
+ _null.nullTag,
22
+ bool.trueTag,
23
+ bool.falseTag,
24
+ int.intBin,
25
+ int.intOct,
26
+ int.int,
27
+ int.intHex,
28
+ float.floatNaN,
29
+ float.floatExp,
30
+ float.float,
31
+ binary.binary,
32
+ merge.merge,
33
+ omap.omap,
34
+ pairs.pairs,
35
+ set.set,
36
+ timestamp.intTime,
37
+ timestamp.floatTime,
38
+ timestamp.timestamp
39
+ ];
40
+
41
+ exports.schema = schema;
@@ -0,0 +1,39 @@
1
+ import { map } from '../common/map.mjs';
2
+ import { nullTag } from '../common/null.mjs';
3
+ import { seq } from '../common/seq.mjs';
4
+ import { string } from '../common/string.mjs';
5
+ import { binary } from './binary.mjs';
6
+ import { trueTag, falseTag } from './bool.mjs';
7
+ import { floatNaN, floatExp, float } from './float.mjs';
8
+ import { intBin, intOct, int, intHex } from './int.mjs';
9
+ import { merge } from './merge.mjs';
10
+ import { omap } from './omap.mjs';
11
+ import { pairs } from './pairs.mjs';
12
+ import { set } from './set.mjs';
13
+ import { intTime, floatTime, timestamp } from './timestamp.mjs';
14
+
15
+ const schema = [
16
+ map,
17
+ seq,
18
+ string,
19
+ nullTag,
20
+ trueTag,
21
+ falseTag,
22
+ intBin,
23
+ intOct,
24
+ int,
25
+ intHex,
26
+ floatNaN,
27
+ floatExp,
28
+ float,
29
+ binary,
30
+ merge,
31
+ omap,
32
+ pairs,
33
+ set,
34
+ intTime,
35
+ floatTime,
36
+ timestamp
37
+ ];
38
+
39
+ export { schema };