@windrun-huaiin/dev-scripts 13.1.0 → 14.1.0

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 +304 -0
  12. package/dist/commands/diaomao-update.mjs +302 -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,64 @@
1
+ 'use strict';
2
+
3
+ var Scalar = require('../../nodes/Scalar.js');
4
+ var map = require('../common/map.js');
5
+ var seq = require('../common/seq.js');
6
+
7
+ function intIdentify(value) {
8
+ return typeof value === 'bigint' || Number.isInteger(value);
9
+ }
10
+ const stringifyJSON = ({ value }) => JSON.stringify(value);
11
+ const jsonScalars = [
12
+ {
13
+ identify: value => typeof value === 'string',
14
+ default: true,
15
+ tag: 'tag:yaml.org,2002:str',
16
+ resolve: str => str,
17
+ stringify: stringifyJSON
18
+ },
19
+ {
20
+ identify: value => value == null,
21
+ createNode: () => new Scalar.Scalar(null),
22
+ default: true,
23
+ tag: 'tag:yaml.org,2002:null',
24
+ test: /^null$/,
25
+ resolve: () => null,
26
+ stringify: stringifyJSON
27
+ },
28
+ {
29
+ identify: value => typeof value === 'boolean',
30
+ default: true,
31
+ tag: 'tag:yaml.org,2002:bool',
32
+ test: /^true$|^false$/,
33
+ resolve: str => str === 'true',
34
+ stringify: stringifyJSON
35
+ },
36
+ {
37
+ identify: intIdentify,
38
+ default: true,
39
+ tag: 'tag:yaml.org,2002:int',
40
+ test: /^-?(?:0|[1-9][0-9]*)$/,
41
+ resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
42
+ stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
43
+ },
44
+ {
45
+ identify: value => typeof value === 'number',
46
+ default: true,
47
+ tag: 'tag:yaml.org,2002:float',
48
+ test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
49
+ resolve: str => parseFloat(str),
50
+ stringify: stringifyJSON
51
+ }
52
+ ];
53
+ const jsonError = {
54
+ default: true,
55
+ tag: '',
56
+ test: /^/,
57
+ resolve(str, onError) {
58
+ onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
59
+ return str;
60
+ }
61
+ };
62
+ const schema = [map.map, seq.seq].concat(jsonScalars, jsonError);
63
+
64
+ exports.schema = schema;
@@ -0,0 +1,62 @@
1
+ import { Scalar } from '../../nodes/Scalar.mjs';
2
+ import { map } from '../common/map.mjs';
3
+ import { seq } from '../common/seq.mjs';
4
+
5
+ function intIdentify(value) {
6
+ return typeof value === 'bigint' || Number.isInteger(value);
7
+ }
8
+ const stringifyJSON = ({ value }) => JSON.stringify(value);
9
+ const jsonScalars = [
10
+ {
11
+ identify: value => typeof value === 'string',
12
+ default: true,
13
+ tag: 'tag:yaml.org,2002:str',
14
+ resolve: str => str,
15
+ stringify: stringifyJSON
16
+ },
17
+ {
18
+ identify: value => value == null,
19
+ createNode: () => new Scalar(null),
20
+ default: true,
21
+ tag: 'tag:yaml.org,2002:null',
22
+ test: /^null$/,
23
+ resolve: () => null,
24
+ stringify: stringifyJSON
25
+ },
26
+ {
27
+ identify: value => typeof value === 'boolean',
28
+ default: true,
29
+ tag: 'tag:yaml.org,2002:bool',
30
+ test: /^true$|^false$/,
31
+ resolve: str => str === 'true',
32
+ stringify: stringifyJSON
33
+ },
34
+ {
35
+ identify: intIdentify,
36
+ default: true,
37
+ tag: 'tag:yaml.org,2002:int',
38
+ test: /^-?(?:0|[1-9][0-9]*)$/,
39
+ resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
40
+ stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
41
+ },
42
+ {
43
+ identify: value => typeof value === 'number',
44
+ default: true,
45
+ tag: 'tag:yaml.org,2002:float',
46
+ test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
47
+ resolve: str => parseFloat(str),
48
+ stringify: stringifyJSON
49
+ }
50
+ ];
51
+ const jsonError = {
52
+ default: true,
53
+ tag: '',
54
+ test: /^/,
55
+ resolve(str, onError) {
56
+ onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
57
+ return str;
58
+ }
59
+ };
60
+ const schema = [map, seq].concat(jsonScalars, jsonError);
61
+
62
+ export { schema };
@@ -0,0 +1,99 @@
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 bool = require('./core/bool.js');
8
+ var float = require('./core/float.js');
9
+ var int = require('./core/int.js');
10
+ var schema = require('./core/schema.js');
11
+ var schema$1 = require('./json/schema.js');
12
+ var binary = require('./yaml-1.1/binary.js');
13
+ var merge = require('./yaml-1.1/merge.js');
14
+ var omap = require('./yaml-1.1/omap.js');
15
+ var pairs = require('./yaml-1.1/pairs.js');
16
+ var schema$2 = require('./yaml-1.1/schema.js');
17
+ var set = require('./yaml-1.1/set.js');
18
+ var timestamp = require('./yaml-1.1/timestamp.js');
19
+
20
+ const schemas = new Map([
21
+ ['core', schema.schema],
22
+ ['failsafe', [map.map, seq.seq, string.string]],
23
+ ['json', schema$1.schema],
24
+ ['yaml11', schema$2.schema],
25
+ ['yaml-1.1', schema$2.schema]
26
+ ]);
27
+ const tagsByName = {
28
+ binary: binary.binary,
29
+ bool: bool.boolTag,
30
+ float: float.float,
31
+ floatExp: float.floatExp,
32
+ floatNaN: float.floatNaN,
33
+ floatTime: timestamp.floatTime,
34
+ int: int.int,
35
+ intHex: int.intHex,
36
+ intOct: int.intOct,
37
+ intTime: timestamp.intTime,
38
+ map: map.map,
39
+ merge: merge.merge,
40
+ null: _null.nullTag,
41
+ omap: omap.omap,
42
+ pairs: pairs.pairs,
43
+ seq: seq.seq,
44
+ set: set.set,
45
+ timestamp: timestamp.timestamp
46
+ };
47
+ const coreKnownTags = {
48
+ 'tag:yaml.org,2002:binary': binary.binary,
49
+ 'tag:yaml.org,2002:merge': merge.merge,
50
+ 'tag:yaml.org,2002:omap': omap.omap,
51
+ 'tag:yaml.org,2002:pairs': pairs.pairs,
52
+ 'tag:yaml.org,2002:set': set.set,
53
+ 'tag:yaml.org,2002:timestamp': timestamp.timestamp
54
+ };
55
+ function getTags(customTags, schemaName, addMergeTag) {
56
+ const schemaTags = schemas.get(schemaName);
57
+ if (schemaTags && !customTags) {
58
+ return addMergeTag && !schemaTags.includes(merge.merge)
59
+ ? schemaTags.concat(merge.merge)
60
+ : schemaTags.slice();
61
+ }
62
+ let tags = schemaTags;
63
+ if (!tags) {
64
+ if (Array.isArray(customTags))
65
+ tags = [];
66
+ else {
67
+ const keys = Array.from(schemas.keys())
68
+ .filter(key => key !== 'yaml11')
69
+ .map(key => JSON.stringify(key))
70
+ .join(', ');
71
+ throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
72
+ }
73
+ }
74
+ if (Array.isArray(customTags)) {
75
+ for (const tag of customTags)
76
+ tags = tags.concat(tag);
77
+ }
78
+ else if (typeof customTags === 'function') {
79
+ tags = customTags(tags.slice());
80
+ }
81
+ if (addMergeTag)
82
+ tags = tags.concat(merge.merge);
83
+ return tags.reduce((tags, tag) => {
84
+ const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
85
+ if (!tagObj) {
86
+ const tagName = JSON.stringify(tag);
87
+ const keys = Object.keys(tagsByName)
88
+ .map(key => JSON.stringify(key))
89
+ .join(', ');
90
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
91
+ }
92
+ if (!tags.includes(tagObj))
93
+ tags.push(tagObj);
94
+ return tags;
95
+ }, []);
96
+ }
97
+
98
+ exports.coreKnownTags = coreKnownTags;
99
+ exports.getTags = getTags;
@@ -0,0 +1,96 @@
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 { boolTag } from './core/bool.mjs';
6
+ import { floatNaN, floatExp, float } from './core/float.mjs';
7
+ import { intOct, intHex, int } from './core/int.mjs';
8
+ import { schema } from './core/schema.mjs';
9
+ import { schema as schema$1 } from './json/schema.mjs';
10
+ import { binary } from './yaml-1.1/binary.mjs';
11
+ import { merge } from './yaml-1.1/merge.mjs';
12
+ import { omap } from './yaml-1.1/omap.mjs';
13
+ import { pairs } from './yaml-1.1/pairs.mjs';
14
+ import { schema as schema$2 } from './yaml-1.1/schema.mjs';
15
+ import { set } from './yaml-1.1/set.mjs';
16
+ import { timestamp, intTime, floatTime } from './yaml-1.1/timestamp.mjs';
17
+
18
+ const schemas = new Map([
19
+ ['core', schema],
20
+ ['failsafe', [map, seq, string]],
21
+ ['json', schema$1],
22
+ ['yaml11', schema$2],
23
+ ['yaml-1.1', schema$2]
24
+ ]);
25
+ const tagsByName = {
26
+ binary,
27
+ bool: boolTag,
28
+ float,
29
+ floatExp,
30
+ floatNaN,
31
+ floatTime,
32
+ int,
33
+ intHex,
34
+ intOct,
35
+ intTime,
36
+ map,
37
+ merge,
38
+ null: nullTag,
39
+ omap,
40
+ pairs,
41
+ seq,
42
+ set,
43
+ timestamp
44
+ };
45
+ const coreKnownTags = {
46
+ 'tag:yaml.org,2002:binary': binary,
47
+ 'tag:yaml.org,2002:merge': merge,
48
+ 'tag:yaml.org,2002:omap': omap,
49
+ 'tag:yaml.org,2002:pairs': pairs,
50
+ 'tag:yaml.org,2002:set': set,
51
+ 'tag:yaml.org,2002:timestamp': timestamp
52
+ };
53
+ function getTags(customTags, schemaName, addMergeTag) {
54
+ const schemaTags = schemas.get(schemaName);
55
+ if (schemaTags && !customTags) {
56
+ return addMergeTag && !schemaTags.includes(merge)
57
+ ? schemaTags.concat(merge)
58
+ : schemaTags.slice();
59
+ }
60
+ let tags = schemaTags;
61
+ if (!tags) {
62
+ if (Array.isArray(customTags))
63
+ tags = [];
64
+ else {
65
+ const keys = Array.from(schemas.keys())
66
+ .filter(key => key !== 'yaml11')
67
+ .map(key => JSON.stringify(key))
68
+ .join(', ');
69
+ throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
70
+ }
71
+ }
72
+ if (Array.isArray(customTags)) {
73
+ for (const tag of customTags)
74
+ tags = tags.concat(tag);
75
+ }
76
+ else if (typeof customTags === 'function') {
77
+ tags = customTags(tags.slice());
78
+ }
79
+ if (addMergeTag)
80
+ tags = tags.concat(merge);
81
+ return tags.reduce((tags, tag) => {
82
+ const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
83
+ if (!tagObj) {
84
+ const tagName = JSON.stringify(tag);
85
+ const keys = Object.keys(tagsByName)
86
+ .map(key => JSON.stringify(key))
87
+ .join(', ');
88
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
89
+ }
90
+ if (!tags.includes(tagObj))
91
+ tags.push(tagObj);
92
+ return tags;
93
+ }, []);
94
+ }
95
+
96
+ export { coreKnownTags, getTags };
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ var Scalar = require('../../nodes/Scalar.js');
4
+ var stringifyString = require('../../stringify/stringifyString.js');
5
+
6
+ const binary = {
7
+ identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array
8
+ default: false,
9
+ tag: 'tag:yaml.org,2002:binary',
10
+ /**
11
+ * Returns a Buffer in node and an Uint8Array in browsers
12
+ *
13
+ * To use the resulting buffer as an image, you'll want to do something like:
14
+ *
15
+ * const blob = new Blob([buffer], { type: 'image/jpeg' })
16
+ * document.querySelector('#photo').src = URL.createObjectURL(blob)
17
+ */
18
+ resolve(src, onError) {
19
+ if (typeof atob === 'function') {
20
+ // On IE 11, atob() can't handle newlines
21
+ const str = atob(src.replace(/[\n\r]/g, ''));
22
+ const buffer = new Uint8Array(str.length);
23
+ for (let i = 0; i < str.length; ++i)
24
+ buffer[i] = str.charCodeAt(i);
25
+ return buffer;
26
+ }
27
+ else {
28
+ onError('This environment does not support reading binary tags; either Buffer or atob is required');
29
+ return src;
30
+ }
31
+ },
32
+ stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
33
+ if (!value)
34
+ return '';
35
+ const buf = value; // checked earlier by binary.identify()
36
+ let str;
37
+ if (typeof btoa === 'function') {
38
+ let s = '';
39
+ for (let i = 0; i < buf.length; ++i)
40
+ s += String.fromCharCode(buf[i]);
41
+ str = btoa(s);
42
+ }
43
+ else {
44
+ throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
45
+ }
46
+ type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
47
+ if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
48
+ const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
49
+ const n = Math.ceil(str.length / lineWidth);
50
+ const lines = new Array(n);
51
+ for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
52
+ lines[i] = str.substr(o, lineWidth);
53
+ }
54
+ str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? '\n' : ' ');
55
+ }
56
+ return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
57
+ }
58
+ };
59
+
60
+ exports.binary = binary;
@@ -0,0 +1,58 @@
1
+ import { Scalar } from '../../nodes/Scalar.mjs';
2
+ import { stringifyString } from '../../stringify/stringifyString.mjs';
3
+
4
+ const binary = {
5
+ identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array
6
+ default: false,
7
+ tag: 'tag:yaml.org,2002:binary',
8
+ /**
9
+ * Returns a Buffer in node and an Uint8Array in browsers
10
+ *
11
+ * To use the resulting buffer as an image, you'll want to do something like:
12
+ *
13
+ * const blob = new Blob([buffer], { type: 'image/jpeg' })
14
+ * document.querySelector('#photo').src = URL.createObjectURL(blob)
15
+ */
16
+ resolve(src, onError) {
17
+ if (typeof atob === 'function') {
18
+ // On IE 11, atob() can't handle newlines
19
+ const str = atob(src.replace(/[\n\r]/g, ''));
20
+ const buffer = new Uint8Array(str.length);
21
+ for (let i = 0; i < str.length; ++i)
22
+ buffer[i] = str.charCodeAt(i);
23
+ return buffer;
24
+ }
25
+ else {
26
+ onError('This environment does not support reading binary tags; either Buffer or atob is required');
27
+ return src;
28
+ }
29
+ },
30
+ stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
31
+ if (!value)
32
+ return '';
33
+ const buf = value; // checked earlier by binary.identify()
34
+ let str;
35
+ if (typeof btoa === 'function') {
36
+ let s = '';
37
+ for (let i = 0; i < buf.length; ++i)
38
+ s += String.fromCharCode(buf[i]);
39
+ str = btoa(s);
40
+ }
41
+ else {
42
+ throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
43
+ }
44
+ type ?? (type = Scalar.BLOCK_LITERAL);
45
+ if (type !== Scalar.QUOTE_DOUBLE) {
46
+ const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
47
+ const n = Math.ceil(str.length / lineWidth);
48
+ const lines = new Array(n);
49
+ for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
50
+ lines[i] = str.substr(o, lineWidth);
51
+ }
52
+ str = lines.join(type === Scalar.BLOCK_LITERAL ? '\n' : ' ');
53
+ }
54
+ return stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
55
+ }
56
+ };
57
+
58
+ export { binary };
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var Scalar = require('../../nodes/Scalar.js');
4
+
5
+ function boolStringify({ value, source }, ctx) {
6
+ const boolObj = value ? trueTag : falseTag;
7
+ if (source && boolObj.test.test(source))
8
+ return source;
9
+ return value ? ctx.options.trueStr : ctx.options.falseStr;
10
+ }
11
+ const trueTag = {
12
+ identify: value => value === true,
13
+ default: true,
14
+ tag: 'tag:yaml.org,2002:bool',
15
+ test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
16
+ resolve: () => new Scalar.Scalar(true),
17
+ stringify: boolStringify
18
+ };
19
+ const falseTag = {
20
+ identify: value => value === false,
21
+ default: true,
22
+ tag: 'tag:yaml.org,2002:bool',
23
+ test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
24
+ resolve: () => new Scalar.Scalar(false),
25
+ stringify: boolStringify
26
+ };
27
+
28
+ exports.falseTag = falseTag;
29
+ exports.trueTag = trueTag;
@@ -0,0 +1,26 @@
1
+ import { Scalar } from '../../nodes/Scalar.mjs';
2
+
3
+ function boolStringify({ value, source }, ctx) {
4
+ const boolObj = value ? trueTag : falseTag;
5
+ if (source && boolObj.test.test(source))
6
+ return source;
7
+ return value ? ctx.options.trueStr : ctx.options.falseStr;
8
+ }
9
+ const trueTag = {
10
+ identify: value => value === true,
11
+ default: true,
12
+ tag: 'tag:yaml.org,2002:bool',
13
+ test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
14
+ resolve: () => new Scalar(true),
15
+ stringify: boolStringify
16
+ };
17
+ const falseTag = {
18
+ identify: value => value === false,
19
+ default: true,
20
+ tag: 'tag:yaml.org,2002:bool',
21
+ test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
22
+ resolve: () => new Scalar(false),
23
+ stringify: boolStringify
24
+ };
25
+
26
+ export { falseTag, trueTag };
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var Scalar = require('../../nodes/Scalar.js');
4
+ var stringifyNumber = require('../../stringify/stringifyNumber.js');
5
+
6
+ const floatNaN = {
7
+ identify: value => typeof value === 'number',
8
+ default: true,
9
+ tag: 'tag:yaml.org,2002:float',
10
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
11
+ resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
12
+ ? NaN
13
+ : str[0] === '-'
14
+ ? Number.NEGATIVE_INFINITY
15
+ : Number.POSITIVE_INFINITY,
16
+ stringify: stringifyNumber.stringifyNumber
17
+ };
18
+ const floatExp = {
19
+ identify: value => typeof value === 'number',
20
+ default: true,
21
+ tag: 'tag:yaml.org,2002:float',
22
+ format: 'EXP',
23
+ test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
24
+ resolve: (str) => parseFloat(str.replace(/_/g, '')),
25
+ stringify(node) {
26
+ const num = Number(node.value);
27
+ return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
28
+ }
29
+ };
30
+ const float = {
31
+ identify: value => typeof value === 'number',
32
+ default: true,
33
+ tag: 'tag:yaml.org,2002:float',
34
+ test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
35
+ resolve(str) {
36
+ const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, '')));
37
+ const dot = str.indexOf('.');
38
+ if (dot !== -1) {
39
+ const f = str.substring(dot + 1).replace(/_/g, '');
40
+ if (f[f.length - 1] === '0')
41
+ node.minFractionDigits = f.length;
42
+ }
43
+ return node;
44
+ },
45
+ stringify: stringifyNumber.stringifyNumber
46
+ };
47
+
48
+ exports.float = float;
49
+ exports.floatExp = floatExp;
50
+ exports.floatNaN = floatNaN;
@@ -0,0 +1,46 @@
1
+ import { Scalar } from '../../nodes/Scalar.mjs';
2
+ import { stringifyNumber } from '../../stringify/stringifyNumber.mjs';
3
+
4
+ const floatNaN = {
5
+ identify: value => typeof value === 'number',
6
+ default: true,
7
+ tag: 'tag:yaml.org,2002:float',
8
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
9
+ resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
10
+ ? NaN
11
+ : str[0] === '-'
12
+ ? Number.NEGATIVE_INFINITY
13
+ : Number.POSITIVE_INFINITY,
14
+ stringify: stringifyNumber
15
+ };
16
+ const floatExp = {
17
+ identify: value => typeof value === 'number',
18
+ default: true,
19
+ tag: 'tag:yaml.org,2002:float',
20
+ format: 'EXP',
21
+ test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
22
+ resolve: (str) => parseFloat(str.replace(/_/g, '')),
23
+ stringify(node) {
24
+ const num = Number(node.value);
25
+ return isFinite(num) ? num.toExponential() : stringifyNumber(node);
26
+ }
27
+ };
28
+ const float = {
29
+ identify: value => typeof value === 'number',
30
+ default: true,
31
+ tag: 'tag:yaml.org,2002:float',
32
+ test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
33
+ resolve(str) {
34
+ const node = new Scalar(parseFloat(str.replace(/_/g, '')));
35
+ const dot = str.indexOf('.');
36
+ if (dot !== -1) {
37
+ const f = str.substring(dot + 1).replace(/_/g, '');
38
+ if (f[f.length - 1] === '0')
39
+ node.minFractionDigits = f.length;
40
+ }
41
+ return node;
42
+ },
43
+ stringify: stringifyNumber
44
+ };
45
+
46
+ export { float, floatExp, floatNaN };
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ var stringifyNumber = require('../../stringify/stringifyNumber.js');
4
+
5
+ const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
6
+ function intResolve(str, offset, radix, { intAsBigInt }) {
7
+ const sign = str[0];
8
+ if (sign === '-' || sign === '+')
9
+ offset += 1;
10
+ str = str.substring(offset).replace(/_/g, '');
11
+ if (intAsBigInt) {
12
+ switch (radix) {
13
+ case 2:
14
+ str = `0b${str}`;
15
+ break;
16
+ case 8:
17
+ str = `0o${str}`;
18
+ break;
19
+ case 16:
20
+ str = `0x${str}`;
21
+ break;
22
+ }
23
+ const n = BigInt(str);
24
+ return sign === '-' ? BigInt(-1) * n : n;
25
+ }
26
+ const n = parseInt(str, radix);
27
+ return sign === '-' ? -1 * n : n;
28
+ }
29
+ function intStringify(node, radix, prefix) {
30
+ const { value } = node;
31
+ if (intIdentify(value)) {
32
+ const str = value.toString(radix);
33
+ return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;
34
+ }
35
+ return stringifyNumber.stringifyNumber(node);
36
+ }
37
+ const intBin = {
38
+ identify: intIdentify,
39
+ default: true,
40
+ tag: 'tag:yaml.org,2002:int',
41
+ format: 'BIN',
42
+ test: /^[-+]?0b[0-1_]+$/,
43
+ resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),
44
+ stringify: node => intStringify(node, 2, '0b')
45
+ };
46
+ const intOct = {
47
+ identify: intIdentify,
48
+ default: true,
49
+ tag: 'tag:yaml.org,2002:int',
50
+ format: 'OCT',
51
+ test: /^[-+]?0[0-7_]+$/,
52
+ resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),
53
+ stringify: node => intStringify(node, 8, '0')
54
+ };
55
+ const int = {
56
+ identify: intIdentify,
57
+ default: true,
58
+ tag: 'tag:yaml.org,2002:int',
59
+ test: /^[-+]?[0-9][0-9_]*$/,
60
+ resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
61
+ stringify: stringifyNumber.stringifyNumber
62
+ };
63
+ const intHex = {
64
+ identify: intIdentify,
65
+ default: true,
66
+ tag: 'tag:yaml.org,2002:int',
67
+ format: 'HEX',
68
+ test: /^[-+]?0x[0-9a-fA-F_]+$/,
69
+ resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
70
+ stringify: node => intStringify(node, 16, '0x')
71
+ };
72
+
73
+ exports.int = int;
74
+ exports.intBin = intBin;
75
+ exports.intHex = intHex;
76
+ exports.intOct = intOct;