@windrun-huaiin/dev-scripts 14.1.3 → 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.
- package/dist/commands/create-diaomao-app.d.ts.map +1 -1
- package/dist/commands/create-diaomao-app.js +2 -0
- package/dist/commands/create-diaomao-app.mjs +2 -0
- package/package.json +1 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -7
- package/dist/_virtual/_commonjsHelpers.mjs +0 -5
- package/dist/_virtual/index.js +0 -11
- package/dist/_virtual/index.mjs +0 -7
- package/dist/_virtual/re.js +0 -5
- package/dist/_virtual/re.mjs +0 -3
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js +0 -161
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.mjs +0 -159
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js +0 -576
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.mjs +0 -574
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js +0 -350
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.mjs +0 -348
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js +0 -21
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.mjs +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js +0 -72
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.mjs +0 -70
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js +0 -77
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.mjs +0 -75
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.mjs +0 -20
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js +0 -20
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.mjs +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js +0 -73
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.mjs +0 -71
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js +0 -34
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.mjs +0 -32
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js +0 -31
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.mjs +0 -29
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js +0 -21
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.mjs +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js +0 -25
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.mjs +0 -23
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.mjs +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js +0 -21
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.mjs +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js +0 -144
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.mjs +0 -142
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js +0 -48
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.mjs +0 -46
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.mjs +0 -20
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js +0 -40
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.mjs +0 -38
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js +0 -53
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.mjs +0 -51
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js +0 -28
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.mjs +0 -26
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js +0 -239
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.mjs +0 -237
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.mjs +0 -17
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.mjs +0 -20
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.mjs +0 -17
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js +0 -41
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.mjs +0 -39
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js +0 -40
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.mjs +0 -38
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js +0 -78
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.mjs +0 -76
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js +0 -102
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.mjs +0 -100
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js +0 -63
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.mjs +0 -61
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js +0 -265
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.mjs +0 -263
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js +0 -23
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.mjs +0 -21
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js +0 -26
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.mjs +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -90
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-collection.mjs +0 -88
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -45
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-doc.mjs +0 -43
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-node.js +0 -105
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-node.mjs +0 -102
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -88
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/compose-scalar.mjs +0 -86
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/composer.js +0 -219
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/composer.mjs +0 -217
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -117
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-map.mjs +0 -115
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -200
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-scalar.mjs +0 -198
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -51
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-block-seq.mjs +0 -49
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-end.mjs +0 -37
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -209
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-collection.mjs +0 -207
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -225
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.mjs +0 -223
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -148
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/resolve-props.mjs +0 -146
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -36
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-contains-newline.mjs +0 -34
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -28
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.mjs +0 -26
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -17
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-flow-indent-check.mjs +0 -15
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -15
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/compose/util-map-includes.mjs +0 -13
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/Document.js +0 -337
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/Document.mjs +0 -335
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/anchors.js +0 -76
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/anchors.mjs +0 -71
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -57
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/applyReviver.mjs +0 -55
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/createNode.js +0 -90
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/createNode.mjs +0 -88
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/directives.js +0 -178
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/doc/directives.mjs +0 -176
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/errors.js +0 -62
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/errors.mjs +0 -57
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/log.js +0 -9
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/log.mjs +0 -7
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Alias.js +0 -116
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Alias.mjs +0 -114
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Collection.js +0 -151
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Collection.mjs +0 -147
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Node.js +0 -40
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Node.mjs +0 -38
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Pair.js +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Pair.mjs +0 -36
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -27
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/Scalar.mjs +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -147
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLMap.mjs +0 -144
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -115
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/YAMLSeq.mjs +0 -113
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -65
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +0 -63
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/identity.js +0 -53
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/identity.mjs +0 -36
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/toJS.js +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/nodes/toJS.mjs +0 -37
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/cst.js +0 -79
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/cst.mjs +0 -73
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/lexer.js +0 -719
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/lexer.mjs +0 -717
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/line-counter.js +0 -41
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/line-counter.mjs +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/parser.js +0 -969
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/parse/parser.mjs +0 -967
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/public-api.js +0 -68
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/public-api.mjs +0 -64
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/Schema.js +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/Schema.mjs +0 -37
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/map.js +0 -19
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/map.mjs +0 -17
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/null.js +0 -17
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/null.mjs +0 -15
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/seq.js +0 -19
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/seq.mjs +0 -17
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/string.js +0 -16
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/common/string.mjs +0 -14
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/bool.js +0 -21
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/bool.mjs +0 -19
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/float.js +0 -47
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/float.mjs +0 -43
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/int.js +0 -42
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/int.mjs +0 -38
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/schema.js +0 -25
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/core/schema.mjs +0 -23
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/json/schema.js +0 -64
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/json/schema.mjs +0 -62
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/tags.js +0 -99
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/tags.mjs +0 -96
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -60
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.mjs +0 -58
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -29
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.mjs +0 -26
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -50
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/float.mjs +0 -46
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -76
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/int.mjs +0 -71
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -68
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.mjs +0 -64
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -77
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.mjs +0 -74
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -82
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.mjs +0 -78
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -41
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.mjs +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -96
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/set.mjs +0 -93
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -105
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.mjs +0 -101
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -151
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/foldFlowLines.mjs +0 -146
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringify.js +0 -131
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringify.mjs +0 -128
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -145
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyCollection.mjs +0 -143
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyComment.mjs +0 -20
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -87
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyDocument.mjs +0 -85
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -26
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyNumber.mjs +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -152
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyPair.mjs +0 -150
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -338
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/stringify/stringifyString.mjs +0 -336
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/visit.js +0 -148
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/browser/dist/visit.mjs +0 -146
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var Scalar = require('../nodes/Scalar.js');
|
|
4
|
-
var foldFlowLines = require('./foldFlowLines.js');
|
|
5
|
-
|
|
6
|
-
const getFoldOptions = (ctx, isBlock) => ({
|
|
7
|
-
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
8
|
-
lineWidth: ctx.options.lineWidth,
|
|
9
|
-
minContentWidth: ctx.options.minContentWidth
|
|
10
|
-
});
|
|
11
|
-
// Also checks for lines starting with %, as parsing the output as YAML 1.1 will
|
|
12
|
-
// presume that's starting a new document.
|
|
13
|
-
const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
|
|
14
|
-
function lineLengthOverLimit(str, lineWidth, indentLength) {
|
|
15
|
-
if (!lineWidth || lineWidth < 0)
|
|
16
|
-
return false;
|
|
17
|
-
const limit = lineWidth - indentLength;
|
|
18
|
-
const strLen = str.length;
|
|
19
|
-
if (strLen <= limit)
|
|
20
|
-
return false;
|
|
21
|
-
for (let i = 0, start = 0; i < strLen; ++i) {
|
|
22
|
-
if (str[i] === '\n') {
|
|
23
|
-
if (i - start > limit)
|
|
24
|
-
return true;
|
|
25
|
-
start = i + 1;
|
|
26
|
-
if (strLen - start <= limit)
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
function doubleQuotedString(value, ctx) {
|
|
33
|
-
const json = JSON.stringify(value);
|
|
34
|
-
if (ctx.options.doubleQuotedAsJSON)
|
|
35
|
-
return json;
|
|
36
|
-
const { implicitKey } = ctx;
|
|
37
|
-
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
38
|
-
const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
|
|
39
|
-
let str = '';
|
|
40
|
-
let start = 0;
|
|
41
|
-
for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
|
|
42
|
-
if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') {
|
|
43
|
-
// space before newline needs to be escaped to not be folded
|
|
44
|
-
str += json.slice(start, i) + '\\ ';
|
|
45
|
-
i += 1;
|
|
46
|
-
start = i;
|
|
47
|
-
ch = '\\';
|
|
48
|
-
}
|
|
49
|
-
if (ch === '\\')
|
|
50
|
-
switch (json[i + 1]) {
|
|
51
|
-
case 'u':
|
|
52
|
-
{
|
|
53
|
-
str += json.slice(start, i);
|
|
54
|
-
const code = json.substr(i + 2, 4);
|
|
55
|
-
switch (code) {
|
|
56
|
-
case '0000':
|
|
57
|
-
str += '\\0';
|
|
58
|
-
break;
|
|
59
|
-
case '0007':
|
|
60
|
-
str += '\\a';
|
|
61
|
-
break;
|
|
62
|
-
case '000b':
|
|
63
|
-
str += '\\v';
|
|
64
|
-
break;
|
|
65
|
-
case '001b':
|
|
66
|
-
str += '\\e';
|
|
67
|
-
break;
|
|
68
|
-
case '0085':
|
|
69
|
-
str += '\\N';
|
|
70
|
-
break;
|
|
71
|
-
case '00a0':
|
|
72
|
-
str += '\\_';
|
|
73
|
-
break;
|
|
74
|
-
case '2028':
|
|
75
|
-
str += '\\L';
|
|
76
|
-
break;
|
|
77
|
-
case '2029':
|
|
78
|
-
str += '\\P';
|
|
79
|
-
break;
|
|
80
|
-
default:
|
|
81
|
-
if (code.substr(0, 2) === '00')
|
|
82
|
-
str += '\\x' + code.substr(2);
|
|
83
|
-
else
|
|
84
|
-
str += json.substr(i, 6);
|
|
85
|
-
}
|
|
86
|
-
i += 5;
|
|
87
|
-
start = i + 1;
|
|
88
|
-
}
|
|
89
|
-
break;
|
|
90
|
-
case 'n':
|
|
91
|
-
if (implicitKey ||
|
|
92
|
-
json[i + 2] === '"' ||
|
|
93
|
-
json.length < minMultiLineLength) {
|
|
94
|
-
i += 1;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
// folding will eat first newline
|
|
98
|
-
str += json.slice(start, i) + '\n\n';
|
|
99
|
-
while (json[i + 2] === '\\' &&
|
|
100
|
-
json[i + 3] === 'n' &&
|
|
101
|
-
json[i + 4] !== '"') {
|
|
102
|
-
str += '\n';
|
|
103
|
-
i += 2;
|
|
104
|
-
}
|
|
105
|
-
str += indent;
|
|
106
|
-
// space after newline needs to be escaped to not be folded
|
|
107
|
-
if (json[i + 2] === ' ')
|
|
108
|
-
str += '\\';
|
|
109
|
-
i += 1;
|
|
110
|
-
start = i + 1;
|
|
111
|
-
}
|
|
112
|
-
break;
|
|
113
|
-
default:
|
|
114
|
-
i += 1;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
str = start ? str + json.slice(start) : json;
|
|
118
|
-
return implicitKey
|
|
119
|
-
? str
|
|
120
|
-
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
121
|
-
}
|
|
122
|
-
function singleQuotedString(value, ctx) {
|
|
123
|
-
if (ctx.options.singleQuote === false ||
|
|
124
|
-
(ctx.implicitKey && value.includes('\n')) ||
|
|
125
|
-
/[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline
|
|
126
|
-
)
|
|
127
|
-
return doubleQuotedString(value, ctx);
|
|
128
|
-
const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
|
|
129
|
-
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
|
|
130
|
-
return ctx.implicitKey
|
|
131
|
-
? res
|
|
132
|
-
: foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
133
|
-
}
|
|
134
|
-
function quotedString(value, ctx) {
|
|
135
|
-
const { singleQuote } = ctx.options;
|
|
136
|
-
let qs;
|
|
137
|
-
if (singleQuote === false)
|
|
138
|
-
qs = doubleQuotedString;
|
|
139
|
-
else {
|
|
140
|
-
const hasDouble = value.includes('"');
|
|
141
|
-
const hasSingle = value.includes("'");
|
|
142
|
-
if (hasDouble && !hasSingle)
|
|
143
|
-
qs = singleQuotedString;
|
|
144
|
-
else if (hasSingle && !hasDouble)
|
|
145
|
-
qs = doubleQuotedString;
|
|
146
|
-
else
|
|
147
|
-
qs = singleQuote ? singleQuotedString : doubleQuotedString;
|
|
148
|
-
}
|
|
149
|
-
return qs(value, ctx);
|
|
150
|
-
}
|
|
151
|
-
// The negative lookbehind avoids a polynomial search,
|
|
152
|
-
// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind
|
|
153
|
-
let blockEndNewlines;
|
|
154
|
-
try {
|
|
155
|
-
blockEndNewlines = new RegExp('(^|(?<!\n))\n+(?!\n|$)', 'g');
|
|
156
|
-
}
|
|
157
|
-
catch {
|
|
158
|
-
blockEndNewlines = /\n+(?!\n|$)/g;
|
|
159
|
-
}
|
|
160
|
-
function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
161
|
-
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
162
|
-
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
163
|
-
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
164
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
165
|
-
return quotedString(value, ctx);
|
|
166
|
-
}
|
|
167
|
-
const indent = ctx.indent ||
|
|
168
|
-
(ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');
|
|
169
|
-
const literal = blockQuote === 'literal'
|
|
170
|
-
? true
|
|
171
|
-
: blockQuote === 'folded' || type === Scalar.Scalar.BLOCK_FOLDED
|
|
172
|
-
? false
|
|
173
|
-
: type === Scalar.Scalar.BLOCK_LITERAL
|
|
174
|
-
? true
|
|
175
|
-
: !lineLengthOverLimit(value, lineWidth, indent.length);
|
|
176
|
-
if (!value)
|
|
177
|
-
return literal ? '|\n' : '>\n';
|
|
178
|
-
// determine chomping from whitespace at value end
|
|
179
|
-
let chomp;
|
|
180
|
-
let endStart;
|
|
181
|
-
for (endStart = value.length; endStart > 0; --endStart) {
|
|
182
|
-
const ch = value[endStart - 1];
|
|
183
|
-
if (ch !== '\n' && ch !== '\t' && ch !== ' ')
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
let end = value.substring(endStart);
|
|
187
|
-
const endNlPos = end.indexOf('\n');
|
|
188
|
-
if (endNlPos === -1) {
|
|
189
|
-
chomp = '-'; // strip
|
|
190
|
-
}
|
|
191
|
-
else if (value === end || endNlPos !== end.length - 1) {
|
|
192
|
-
chomp = '+'; // keep
|
|
193
|
-
if (onChompKeep)
|
|
194
|
-
onChompKeep();
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
chomp = ''; // clip
|
|
198
|
-
}
|
|
199
|
-
if (end) {
|
|
200
|
-
value = value.slice(0, -end.length);
|
|
201
|
-
if (end[end.length - 1] === '\n')
|
|
202
|
-
end = end.slice(0, -1);
|
|
203
|
-
end = end.replace(blockEndNewlines, `$&${indent}`);
|
|
204
|
-
}
|
|
205
|
-
// determine indent indicator from whitespace at value start
|
|
206
|
-
let startWithSpace = false;
|
|
207
|
-
let startEnd;
|
|
208
|
-
let startNlPos = -1;
|
|
209
|
-
for (startEnd = 0; startEnd < value.length; ++startEnd) {
|
|
210
|
-
const ch = value[startEnd];
|
|
211
|
-
if (ch === ' ')
|
|
212
|
-
startWithSpace = true;
|
|
213
|
-
else if (ch === '\n')
|
|
214
|
-
startNlPos = startEnd;
|
|
215
|
-
else
|
|
216
|
-
break;
|
|
217
|
-
}
|
|
218
|
-
let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
|
|
219
|
-
if (start) {
|
|
220
|
-
value = value.substring(start.length);
|
|
221
|
-
start = start.replace(/\n+/g, `$&${indent}`);
|
|
222
|
-
}
|
|
223
|
-
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
224
|
-
// Leading | or > is added later
|
|
225
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
226
|
-
if (comment) {
|
|
227
|
-
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
228
|
-
if (onComment)
|
|
229
|
-
onComment();
|
|
230
|
-
}
|
|
231
|
-
if (!literal) {
|
|
232
|
-
const foldedValue = value
|
|
233
|
-
.replace(/\n+/g, '\n$&')
|
|
234
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
235
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
236
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
237
|
-
let literalFallback = false;
|
|
238
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
239
|
-
if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {
|
|
240
|
-
foldOptions.onOverflow = () => {
|
|
241
|
-
literalFallback = true;
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
|
|
245
|
-
if (!literalFallback)
|
|
246
|
-
return `>${header}\n${indent}${body}`;
|
|
247
|
-
}
|
|
248
|
-
value = value.replace(/\n+/g, `$&${indent}`);
|
|
249
|
-
return `|${header}\n${indent}${start}${value}${end}`;
|
|
250
|
-
}
|
|
251
|
-
function plainString(item, ctx, onComment, onChompKeep) {
|
|
252
|
-
const { type, value } = item;
|
|
253
|
-
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
|
|
254
|
-
if ((implicitKey && value.includes('\n')) ||
|
|
255
|
-
(inFlow && /[[\]{},]/.test(value))) {
|
|
256
|
-
return quotedString(value, ctx);
|
|
257
|
-
}
|
|
258
|
-
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
259
|
-
// not allowed:
|
|
260
|
-
// - '-' or '?'
|
|
261
|
-
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
262
|
-
// - '\n ', ': ' or ' \n' anywhere
|
|
263
|
-
// - '#' not preceded by a non-space char
|
|
264
|
-
// - end with ' ' or ':'
|
|
265
|
-
return implicitKey || inFlow || !value.includes('\n')
|
|
266
|
-
? quotedString(value, ctx)
|
|
267
|
-
: blockString(item, ctx, onComment, onChompKeep);
|
|
268
|
-
}
|
|
269
|
-
if (!implicitKey &&
|
|
270
|
-
!inFlow &&
|
|
271
|
-
type !== Scalar.Scalar.PLAIN &&
|
|
272
|
-
value.includes('\n')) {
|
|
273
|
-
// Where allowed & type not set explicitly, prefer block style for multiline strings
|
|
274
|
-
return blockString(item, ctx, onComment, onChompKeep);
|
|
275
|
-
}
|
|
276
|
-
if (containsDocumentMarker(value)) {
|
|
277
|
-
if (indent === '') {
|
|
278
|
-
ctx.forceBlockIndent = true;
|
|
279
|
-
return blockString(item, ctx, onComment, onChompKeep);
|
|
280
|
-
}
|
|
281
|
-
else if (implicitKey && indent === indentStep) {
|
|
282
|
-
return quotedString(value, ctx);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
const str = value.replace(/\n+/g, `$&\n${indent}`);
|
|
286
|
-
// Verify that output will be parsed as a string, as e.g. plain numbers and
|
|
287
|
-
// booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
|
|
288
|
-
// and others in v1.1.
|
|
289
|
-
if (actualString) {
|
|
290
|
-
const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);
|
|
291
|
-
const { compat, tags } = ctx.doc.schema;
|
|
292
|
-
if (tags.some(test) || compat?.some(test))
|
|
293
|
-
return quotedString(value, ctx);
|
|
294
|
-
}
|
|
295
|
-
return implicitKey
|
|
296
|
-
? str
|
|
297
|
-
: foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
298
|
-
}
|
|
299
|
-
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
300
|
-
const { implicitKey, inFlow } = ctx;
|
|
301
|
-
const ss = typeof item.value === 'string'
|
|
302
|
-
? item
|
|
303
|
-
: Object.assign({}, item, { value: String(item.value) });
|
|
304
|
-
let { type } = item;
|
|
305
|
-
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
|
|
306
|
-
// force double quotes on control characters & unpaired surrogates
|
|
307
|
-
if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
|
|
308
|
-
type = Scalar.Scalar.QUOTE_DOUBLE;
|
|
309
|
-
}
|
|
310
|
-
const _stringify = (_type) => {
|
|
311
|
-
switch (_type) {
|
|
312
|
-
case Scalar.Scalar.BLOCK_FOLDED:
|
|
313
|
-
case Scalar.Scalar.BLOCK_LITERAL:
|
|
314
|
-
return implicitKey || inFlow
|
|
315
|
-
? quotedString(ss.value, ctx) // blocks are not valid inside flow containers
|
|
316
|
-
: blockString(ss, ctx, onComment, onChompKeep);
|
|
317
|
-
case Scalar.Scalar.QUOTE_DOUBLE:
|
|
318
|
-
return doubleQuotedString(ss.value, ctx);
|
|
319
|
-
case Scalar.Scalar.QUOTE_SINGLE:
|
|
320
|
-
return singleQuotedString(ss.value, ctx);
|
|
321
|
-
case Scalar.Scalar.PLAIN:
|
|
322
|
-
return plainString(ss, ctx, onComment, onChompKeep);
|
|
323
|
-
default:
|
|
324
|
-
return null;
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
let res = _stringify(type);
|
|
328
|
-
if (res === null) {
|
|
329
|
-
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
330
|
-
const t = (implicitKey && defaultKeyType) || defaultStringType;
|
|
331
|
-
res = _stringify(t);
|
|
332
|
-
if (res === null)
|
|
333
|
-
throw new Error(`Unsupported default string type ${t}`);
|
|
334
|
-
}
|
|
335
|
-
return res;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
exports.stringifyString = stringifyString;
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import { Scalar } from '../nodes/Scalar.mjs';
|
|
2
|
-
import { foldFlowLines, FOLD_FLOW, FOLD_QUOTED, FOLD_BLOCK } from './foldFlowLines.mjs';
|
|
3
|
-
|
|
4
|
-
const getFoldOptions = (ctx, isBlock) => ({
|
|
5
|
-
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
6
|
-
lineWidth: ctx.options.lineWidth,
|
|
7
|
-
minContentWidth: ctx.options.minContentWidth
|
|
8
|
-
});
|
|
9
|
-
// Also checks for lines starting with %, as parsing the output as YAML 1.1 will
|
|
10
|
-
// presume that's starting a new document.
|
|
11
|
-
const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
|
|
12
|
-
function lineLengthOverLimit(str, lineWidth, indentLength) {
|
|
13
|
-
if (!lineWidth || lineWidth < 0)
|
|
14
|
-
return false;
|
|
15
|
-
const limit = lineWidth - indentLength;
|
|
16
|
-
const strLen = str.length;
|
|
17
|
-
if (strLen <= limit)
|
|
18
|
-
return false;
|
|
19
|
-
for (let i = 0, start = 0; i < strLen; ++i) {
|
|
20
|
-
if (str[i] === '\n') {
|
|
21
|
-
if (i - start > limit)
|
|
22
|
-
return true;
|
|
23
|
-
start = i + 1;
|
|
24
|
-
if (strLen - start <= limit)
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
function doubleQuotedString(value, ctx) {
|
|
31
|
-
const json = JSON.stringify(value);
|
|
32
|
-
if (ctx.options.doubleQuotedAsJSON)
|
|
33
|
-
return json;
|
|
34
|
-
const { implicitKey } = ctx;
|
|
35
|
-
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
36
|
-
const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
|
|
37
|
-
let str = '';
|
|
38
|
-
let start = 0;
|
|
39
|
-
for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
|
|
40
|
-
if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') {
|
|
41
|
-
// space before newline needs to be escaped to not be folded
|
|
42
|
-
str += json.slice(start, i) + '\\ ';
|
|
43
|
-
i += 1;
|
|
44
|
-
start = i;
|
|
45
|
-
ch = '\\';
|
|
46
|
-
}
|
|
47
|
-
if (ch === '\\')
|
|
48
|
-
switch (json[i + 1]) {
|
|
49
|
-
case 'u':
|
|
50
|
-
{
|
|
51
|
-
str += json.slice(start, i);
|
|
52
|
-
const code = json.substr(i + 2, 4);
|
|
53
|
-
switch (code) {
|
|
54
|
-
case '0000':
|
|
55
|
-
str += '\\0';
|
|
56
|
-
break;
|
|
57
|
-
case '0007':
|
|
58
|
-
str += '\\a';
|
|
59
|
-
break;
|
|
60
|
-
case '000b':
|
|
61
|
-
str += '\\v';
|
|
62
|
-
break;
|
|
63
|
-
case '001b':
|
|
64
|
-
str += '\\e';
|
|
65
|
-
break;
|
|
66
|
-
case '0085':
|
|
67
|
-
str += '\\N';
|
|
68
|
-
break;
|
|
69
|
-
case '00a0':
|
|
70
|
-
str += '\\_';
|
|
71
|
-
break;
|
|
72
|
-
case '2028':
|
|
73
|
-
str += '\\L';
|
|
74
|
-
break;
|
|
75
|
-
case '2029':
|
|
76
|
-
str += '\\P';
|
|
77
|
-
break;
|
|
78
|
-
default:
|
|
79
|
-
if (code.substr(0, 2) === '00')
|
|
80
|
-
str += '\\x' + code.substr(2);
|
|
81
|
-
else
|
|
82
|
-
str += json.substr(i, 6);
|
|
83
|
-
}
|
|
84
|
-
i += 5;
|
|
85
|
-
start = i + 1;
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
case 'n':
|
|
89
|
-
if (implicitKey ||
|
|
90
|
-
json[i + 2] === '"' ||
|
|
91
|
-
json.length < minMultiLineLength) {
|
|
92
|
-
i += 1;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
// folding will eat first newline
|
|
96
|
-
str += json.slice(start, i) + '\n\n';
|
|
97
|
-
while (json[i + 2] === '\\' &&
|
|
98
|
-
json[i + 3] === 'n' &&
|
|
99
|
-
json[i + 4] !== '"') {
|
|
100
|
-
str += '\n';
|
|
101
|
-
i += 2;
|
|
102
|
-
}
|
|
103
|
-
str += indent;
|
|
104
|
-
// space after newline needs to be escaped to not be folded
|
|
105
|
-
if (json[i + 2] === ' ')
|
|
106
|
-
str += '\\';
|
|
107
|
-
i += 1;
|
|
108
|
-
start = i + 1;
|
|
109
|
-
}
|
|
110
|
-
break;
|
|
111
|
-
default:
|
|
112
|
-
i += 1;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
str = start ? str + json.slice(start) : json;
|
|
116
|
-
return implicitKey
|
|
117
|
-
? str
|
|
118
|
-
: foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
119
|
-
}
|
|
120
|
-
function singleQuotedString(value, ctx) {
|
|
121
|
-
if (ctx.options.singleQuote === false ||
|
|
122
|
-
(ctx.implicitKey && value.includes('\n')) ||
|
|
123
|
-
/[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline
|
|
124
|
-
)
|
|
125
|
-
return doubleQuotedString(value, ctx);
|
|
126
|
-
const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');
|
|
127
|
-
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
|
|
128
|
-
return ctx.implicitKey
|
|
129
|
-
? res
|
|
130
|
-
: foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));
|
|
131
|
-
}
|
|
132
|
-
function quotedString(value, ctx) {
|
|
133
|
-
const { singleQuote } = ctx.options;
|
|
134
|
-
let qs;
|
|
135
|
-
if (singleQuote === false)
|
|
136
|
-
qs = doubleQuotedString;
|
|
137
|
-
else {
|
|
138
|
-
const hasDouble = value.includes('"');
|
|
139
|
-
const hasSingle = value.includes("'");
|
|
140
|
-
if (hasDouble && !hasSingle)
|
|
141
|
-
qs = singleQuotedString;
|
|
142
|
-
else if (hasSingle && !hasDouble)
|
|
143
|
-
qs = doubleQuotedString;
|
|
144
|
-
else
|
|
145
|
-
qs = singleQuote ? singleQuotedString : doubleQuotedString;
|
|
146
|
-
}
|
|
147
|
-
return qs(value, ctx);
|
|
148
|
-
}
|
|
149
|
-
// The negative lookbehind avoids a polynomial search,
|
|
150
|
-
// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind
|
|
151
|
-
let blockEndNewlines;
|
|
152
|
-
try {
|
|
153
|
-
blockEndNewlines = new RegExp('(^|(?<!\n))\n+(?!\n|$)', 'g');
|
|
154
|
-
}
|
|
155
|
-
catch {
|
|
156
|
-
blockEndNewlines = /\n+(?!\n|$)/g;
|
|
157
|
-
}
|
|
158
|
-
function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
159
|
-
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
160
|
-
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
161
|
-
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
162
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
163
|
-
return quotedString(value, ctx);
|
|
164
|
-
}
|
|
165
|
-
const indent = ctx.indent ||
|
|
166
|
-
(ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');
|
|
167
|
-
const literal = blockQuote === 'literal'
|
|
168
|
-
? true
|
|
169
|
-
: blockQuote === 'folded' || type === Scalar.BLOCK_FOLDED
|
|
170
|
-
? false
|
|
171
|
-
: type === Scalar.BLOCK_LITERAL
|
|
172
|
-
? true
|
|
173
|
-
: !lineLengthOverLimit(value, lineWidth, indent.length);
|
|
174
|
-
if (!value)
|
|
175
|
-
return literal ? '|\n' : '>\n';
|
|
176
|
-
// determine chomping from whitespace at value end
|
|
177
|
-
let chomp;
|
|
178
|
-
let endStart;
|
|
179
|
-
for (endStart = value.length; endStart > 0; --endStart) {
|
|
180
|
-
const ch = value[endStart - 1];
|
|
181
|
-
if (ch !== '\n' && ch !== '\t' && ch !== ' ')
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
let end = value.substring(endStart);
|
|
185
|
-
const endNlPos = end.indexOf('\n');
|
|
186
|
-
if (endNlPos === -1) {
|
|
187
|
-
chomp = '-'; // strip
|
|
188
|
-
}
|
|
189
|
-
else if (value === end || endNlPos !== end.length - 1) {
|
|
190
|
-
chomp = '+'; // keep
|
|
191
|
-
if (onChompKeep)
|
|
192
|
-
onChompKeep();
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
chomp = ''; // clip
|
|
196
|
-
}
|
|
197
|
-
if (end) {
|
|
198
|
-
value = value.slice(0, -end.length);
|
|
199
|
-
if (end[end.length - 1] === '\n')
|
|
200
|
-
end = end.slice(0, -1);
|
|
201
|
-
end = end.replace(blockEndNewlines, `$&${indent}`);
|
|
202
|
-
}
|
|
203
|
-
// determine indent indicator from whitespace at value start
|
|
204
|
-
let startWithSpace = false;
|
|
205
|
-
let startEnd;
|
|
206
|
-
let startNlPos = -1;
|
|
207
|
-
for (startEnd = 0; startEnd < value.length; ++startEnd) {
|
|
208
|
-
const ch = value[startEnd];
|
|
209
|
-
if (ch === ' ')
|
|
210
|
-
startWithSpace = true;
|
|
211
|
-
else if (ch === '\n')
|
|
212
|
-
startNlPos = startEnd;
|
|
213
|
-
else
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
|
|
217
|
-
if (start) {
|
|
218
|
-
value = value.substring(start.length);
|
|
219
|
-
start = start.replace(/\n+/g, `$&${indent}`);
|
|
220
|
-
}
|
|
221
|
-
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
222
|
-
// Leading | or > is added later
|
|
223
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
224
|
-
if (comment) {
|
|
225
|
-
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
226
|
-
if (onComment)
|
|
227
|
-
onComment();
|
|
228
|
-
}
|
|
229
|
-
if (!literal) {
|
|
230
|
-
const foldedValue = value
|
|
231
|
-
.replace(/\n+/g, '\n$&')
|
|
232
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
233
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
234
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
235
|
-
let literalFallback = false;
|
|
236
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
237
|
-
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
238
|
-
foldOptions.onOverflow = () => {
|
|
239
|
-
literalFallback = true;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
243
|
-
if (!literalFallback)
|
|
244
|
-
return `>${header}\n${indent}${body}`;
|
|
245
|
-
}
|
|
246
|
-
value = value.replace(/\n+/g, `$&${indent}`);
|
|
247
|
-
return `|${header}\n${indent}${start}${value}${end}`;
|
|
248
|
-
}
|
|
249
|
-
function plainString(item, ctx, onComment, onChompKeep) {
|
|
250
|
-
const { type, value } = item;
|
|
251
|
-
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
|
|
252
|
-
if ((implicitKey && value.includes('\n')) ||
|
|
253
|
-
(inFlow && /[[\]{},]/.test(value))) {
|
|
254
|
-
return quotedString(value, ctx);
|
|
255
|
-
}
|
|
256
|
-
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
257
|
-
// not allowed:
|
|
258
|
-
// - '-' or '?'
|
|
259
|
-
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
260
|
-
// - '\n ', ': ' or ' \n' anywhere
|
|
261
|
-
// - '#' not preceded by a non-space char
|
|
262
|
-
// - end with ' ' or ':'
|
|
263
|
-
return implicitKey || inFlow || !value.includes('\n')
|
|
264
|
-
? quotedString(value, ctx)
|
|
265
|
-
: blockString(item, ctx, onComment, onChompKeep);
|
|
266
|
-
}
|
|
267
|
-
if (!implicitKey &&
|
|
268
|
-
!inFlow &&
|
|
269
|
-
type !== Scalar.PLAIN &&
|
|
270
|
-
value.includes('\n')) {
|
|
271
|
-
// Where allowed & type not set explicitly, prefer block style for multiline strings
|
|
272
|
-
return blockString(item, ctx, onComment, onChompKeep);
|
|
273
|
-
}
|
|
274
|
-
if (containsDocumentMarker(value)) {
|
|
275
|
-
if (indent === '') {
|
|
276
|
-
ctx.forceBlockIndent = true;
|
|
277
|
-
return blockString(item, ctx, onComment, onChompKeep);
|
|
278
|
-
}
|
|
279
|
-
else if (implicitKey && indent === indentStep) {
|
|
280
|
-
return quotedString(value, ctx);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
const str = value.replace(/\n+/g, `$&\n${indent}`);
|
|
284
|
-
// Verify that output will be parsed as a string, as e.g. plain numbers and
|
|
285
|
-
// booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
|
|
286
|
-
// and others in v1.1.
|
|
287
|
-
if (actualString) {
|
|
288
|
-
const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);
|
|
289
|
-
const { compat, tags } = ctx.doc.schema;
|
|
290
|
-
if (tags.some(test) || compat?.some(test))
|
|
291
|
-
return quotedString(value, ctx);
|
|
292
|
-
}
|
|
293
|
-
return implicitKey
|
|
294
|
-
? str
|
|
295
|
-
: foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));
|
|
296
|
-
}
|
|
297
|
-
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
298
|
-
const { implicitKey, inFlow } = ctx;
|
|
299
|
-
const ss = typeof item.value === 'string'
|
|
300
|
-
? item
|
|
301
|
-
: Object.assign({}, item, { value: String(item.value) });
|
|
302
|
-
let { type } = item;
|
|
303
|
-
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
304
|
-
// force double quotes on control characters & unpaired surrogates
|
|
305
|
-
if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
|
|
306
|
-
type = Scalar.QUOTE_DOUBLE;
|
|
307
|
-
}
|
|
308
|
-
const _stringify = (_type) => {
|
|
309
|
-
switch (_type) {
|
|
310
|
-
case Scalar.BLOCK_FOLDED:
|
|
311
|
-
case Scalar.BLOCK_LITERAL:
|
|
312
|
-
return implicitKey || inFlow
|
|
313
|
-
? quotedString(ss.value, ctx) // blocks are not valid inside flow containers
|
|
314
|
-
: blockString(ss, ctx, onComment, onChompKeep);
|
|
315
|
-
case Scalar.QUOTE_DOUBLE:
|
|
316
|
-
return doubleQuotedString(ss.value, ctx);
|
|
317
|
-
case Scalar.QUOTE_SINGLE:
|
|
318
|
-
return singleQuotedString(ss.value, ctx);
|
|
319
|
-
case Scalar.PLAIN:
|
|
320
|
-
return plainString(ss, ctx, onComment, onChompKeep);
|
|
321
|
-
default:
|
|
322
|
-
return null;
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
let res = _stringify(type);
|
|
326
|
-
if (res === null) {
|
|
327
|
-
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
328
|
-
const t = (implicitKey && defaultKeyType) || defaultStringType;
|
|
329
|
-
res = _stringify(t);
|
|
330
|
-
if (res === null)
|
|
331
|
-
throw new Error(`Unsupported default string type ${t}`);
|
|
332
|
-
}
|
|
333
|
-
return res;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export { stringifyString };
|