projen 0.51.4 → 0.51.8
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/.jsii +69 -9
- package/API.md +12 -1
- package/changelog.md +1 -1
- package/lib/awscdk/auto-discover.js +1 -1
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +9 -2
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose.js +2 -2
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale-util.js +12 -7
- package/lib/github/stale.d.ts +10 -1
- package/lib/github/stale.js +10 -2
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +1 -1
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +3 -3
- package/lib/version.js +1 -1
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.d.ts +13 -0
- package/lib/yaml.js +8 -3
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/LICENSE +0 -0
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/README.md +0 -0
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/index.js +0 -0
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/package.json +0 -0
- package/node_modules/yaml/LICENSE +1 -1
- package/node_modules/yaml/README.md +57 -41
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +59 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +40 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +81 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +81 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +107 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +185 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +45 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +200 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +128 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +17 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +321 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +72 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +54 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +84 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +166 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +18 -1002
- package/node_modules/yaml/browser/dist/log.js +14 -0
- package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +164 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +94 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +146 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +48 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +23 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +105 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +104 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +35 -0
- package/node_modules/yaml/browser/dist/options.js +18 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +215 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +692 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +882 -0
- package/node_modules/yaml/browser/dist/public-api.js +99 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +34 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +42 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +13 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +33 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +83 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +66 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +73 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +77 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +87 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +135 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +124 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +152 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +18 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +68 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +122 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +314 -0
- package/node_modules/yaml/browser/dist/util.js +9 -2
- package/node_modules/yaml/browser/dist/visit.js +146 -0
- package/node_modules/yaml/browser/index.js +5 -1
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +61 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +42 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +26 -0
- package/node_modules/yaml/dist/compose/compose-node.js +84 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +83 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +62 -0
- package/node_modules/yaml/dist/compose/composer.js +223 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +109 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +187 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +47 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +202 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +21 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +130 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +29 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +19 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +139 -0
- package/node_modules/yaml/dist/doc/Document.js +323 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +77 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +56 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +86 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +47 -0
- package/node_modules/yaml/dist/doc/directives.js +168 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +19 -0
- package/node_modules/yaml/dist/index.js +49 -77
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +17 -0
- package/node_modules/yaml/dist/node_modules/tslib/tslib.es6.js +76 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +28 -0
- package/node_modules/yaml/dist/nodes/Alias.js +96 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +150 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +66 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +21 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +42 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +26 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +41 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +119 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +55 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +107 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +106 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +30 -0
- package/node_modules/yaml/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/dist/options.d.ts +338 -0
- package/node_modules/yaml/dist/options.js +20 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +219 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +106 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +694 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +886 -0
- package/node_modules/yaml/dist/public-api.d.ts +43 -0
- package/node_modules/yaml/dist/public-api.js +104 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +18 -0
- package/node_modules/yaml/dist/schema/Schema.js +36 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +44 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +35 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +40 -0
- package/node_modules/yaml/dist/schema/tags.js +86 -0
- package/node_modules/yaml/dist/schema/types.d.ts +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +21 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +81 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +90 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +140 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +20 -0
- package/node_modules/yaml/dist/stringify/stringify.js +127 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +154 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +22 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +70 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +124 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +316 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +126 -152
- package/node_modules/yaml/dist/util.d.ts +9 -0
- package/node_modules/yaml/dist/util.js +19 -14
- package/node_modules/yaml/dist/visit.d.ts +63 -0
- package/node_modules/yaml/dist/visit.js +148 -0
- package/node_modules/yaml/package.json +43 -55
- package/node_modules/yaml/util.d.ts +3 -86
- package/node_modules/yaml/util.js +2 -16
- package/package.json +3 -3
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
- package/node_modules/jsonfile/node_modules/universalify/LICENSE +0 -20
- package/node_modules/jsonfile/node_modules/universalify/README.md +0 -76
- package/node_modules/jsonfile/node_modules/universalify/index.js +0 -24
- package/node_modules/jsonfile/node_modules/universalify/package.json +0 -34
- package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +0 -1275
- package/node_modules/yaml/browser/dist/Schema-e94716c8.js +0 -682
- package/node_modules/yaml/browser/dist/legacy-exports.js +0 -3
- package/node_modules/yaml/browser/dist/package.json +0 -1
- package/node_modules/yaml/browser/dist/parse-cst.js +0 -1904
- package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +0 -2419
- package/node_modules/yaml/browser/dist/types.js +0 -4
- package/node_modules/yaml/browser/dist/warnings-df54cb69.js +0 -499
- package/node_modules/yaml/browser/map.js +0 -2
- package/node_modules/yaml/browser/pair.js +0 -2
- package/node_modules/yaml/browser/parse-cst.js +0 -1
- package/node_modules/yaml/browser/scalar.js +0 -2
- package/node_modules/yaml/browser/schema.js +0 -9
- package/node_modules/yaml/browser/seq.js +0 -2
- package/node_modules/yaml/browser/types/binary.js +0 -8
- package/node_modules/yaml/browser/types/omap.js +0 -3
- package/node_modules/yaml/browser/types/pairs.js +0 -3
- package/node_modules/yaml/browser/types/set.js +0 -3
- package/node_modules/yaml/browser/types/timestamp.js +0 -10
- package/node_modules/yaml/browser/types.js +0 -1
- package/node_modules/yaml/browser/util.js +0 -1
- package/node_modules/yaml/dist/Document-9b4560a1.js +0 -757
- package/node_modules/yaml/dist/PlainValue-ec8e588e.js +0 -876
- package/node_modules/yaml/dist/Schema-88e323a7.js +0 -525
- package/node_modules/yaml/dist/legacy-exports.js +0 -16
- package/node_modules/yaml/dist/parse-cst.js +0 -1753
- package/node_modules/yaml/dist/resolveSeq-d03cb037.js +0 -2161
- package/node_modules/yaml/dist/types.js +0 -23
- package/node_modules/yaml/dist/warnings-1000a372.js +0 -416
- package/node_modules/yaml/index.d.ts +0 -372
- package/node_modules/yaml/index.js +0 -1
- package/node_modules/yaml/map.js +0 -2
- package/node_modules/yaml/pair.js +0 -2
- package/node_modules/yaml/parse-cst.d.ts +0 -191
- package/node_modules/yaml/parse-cst.js +0 -1
- package/node_modules/yaml/scalar.js +0 -2
- package/node_modules/yaml/schema.js +0 -9
- package/node_modules/yaml/seq.js +0 -2
- package/node_modules/yaml/types/binary.js +0 -8
- package/node_modules/yaml/types/omap.js +0 -3
- package/node_modules/yaml/types/pairs.js +0 -3
- package/node_modules/yaml/types/set.js +0 -3
- package/node_modules/yaml/types/timestamp.js +0 -10
- package/node_modules/yaml/types.d.ts +0 -407
- package/node_modules/yaml/types.js +0 -17
- package/node_modules/yaml/types.mjs +0 -17
- package/node_modules/yaml/util.mjs +0 -18
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Scalar = require('../nodes/Scalar.js');
|
|
4
|
+
var resolveEnd = require('./resolve-end.js');
|
|
5
|
+
|
|
6
|
+
function resolveFlowScalar(scalar, strict, onError) {
|
|
7
|
+
const { offset, type, source, end } = scalar;
|
|
8
|
+
let _type;
|
|
9
|
+
let value;
|
|
10
|
+
const _onError = (rel, code, msg) => onError(offset + rel, code, msg);
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 'scalar':
|
|
13
|
+
_type = Scalar.Scalar.PLAIN;
|
|
14
|
+
value = plainValue(source, _onError);
|
|
15
|
+
break;
|
|
16
|
+
case 'single-quoted-scalar':
|
|
17
|
+
_type = Scalar.Scalar.QUOTE_SINGLE;
|
|
18
|
+
value = singleQuotedValue(source, _onError);
|
|
19
|
+
break;
|
|
20
|
+
case 'double-quoted-scalar':
|
|
21
|
+
_type = Scalar.Scalar.QUOTE_DOUBLE;
|
|
22
|
+
value = doubleQuotedValue(source, _onError);
|
|
23
|
+
break;
|
|
24
|
+
/* istanbul ignore next should not happen */
|
|
25
|
+
default:
|
|
26
|
+
onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);
|
|
27
|
+
return {
|
|
28
|
+
value: '',
|
|
29
|
+
type: null,
|
|
30
|
+
comment: '',
|
|
31
|
+
range: [offset, offset + source.length, offset + source.length]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const valueEnd = offset + source.length;
|
|
35
|
+
const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
|
|
36
|
+
return {
|
|
37
|
+
value,
|
|
38
|
+
type: _type,
|
|
39
|
+
comment: re.comment,
|
|
40
|
+
range: [offset, valueEnd, re.offset]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function plainValue(source, onError) {
|
|
44
|
+
let badChar = '';
|
|
45
|
+
switch (source[0]) {
|
|
46
|
+
/* istanbul ignore next should not happen */
|
|
47
|
+
case '\t':
|
|
48
|
+
badChar = 'a tab character';
|
|
49
|
+
break;
|
|
50
|
+
case ',':
|
|
51
|
+
badChar = 'flow indicator character ,';
|
|
52
|
+
break;
|
|
53
|
+
case '%':
|
|
54
|
+
badChar = 'directive indicator character %';
|
|
55
|
+
break;
|
|
56
|
+
case '|':
|
|
57
|
+
case '>': {
|
|
58
|
+
badChar = `block scalar indicator ${source[0]}`;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case '@':
|
|
62
|
+
case '`': {
|
|
63
|
+
badChar = `reserved character ${source[0]}`;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (badChar)
|
|
68
|
+
onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
|
|
69
|
+
return foldLines(source);
|
|
70
|
+
}
|
|
71
|
+
function singleQuotedValue(source, onError) {
|
|
72
|
+
if (source[source.length - 1] !== "'" || source.length === 1)
|
|
73
|
+
onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
|
|
74
|
+
return foldLines(source.slice(1, -1)).replace(/''/g, "'");
|
|
75
|
+
}
|
|
76
|
+
function foldLines(source) {
|
|
77
|
+
/**
|
|
78
|
+
* The negative lookbehind here and in the `re` RegExp is to
|
|
79
|
+
* prevent causing a polynomial search time in certain cases.
|
|
80
|
+
*
|
|
81
|
+
* The try-catch is for Safari, which doesn't support this yet:
|
|
82
|
+
* https://caniuse.com/js-regexp-lookbehind
|
|
83
|
+
*/
|
|
84
|
+
let first, line;
|
|
85
|
+
try {
|
|
86
|
+
first = new RegExp('(.*?)(?<![ \t])[ \t]*\r?\n', 'sy');
|
|
87
|
+
line = new RegExp('[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n', 'sy');
|
|
88
|
+
}
|
|
89
|
+
catch (_) {
|
|
90
|
+
first = /(.*?)[ \t]*\r?\n/sy;
|
|
91
|
+
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
92
|
+
}
|
|
93
|
+
let match = first.exec(source);
|
|
94
|
+
if (!match)
|
|
95
|
+
return source;
|
|
96
|
+
let res = match[1];
|
|
97
|
+
let sep = ' ';
|
|
98
|
+
let pos = first.lastIndex;
|
|
99
|
+
line.lastIndex = pos;
|
|
100
|
+
while ((match = line.exec(source))) {
|
|
101
|
+
if (match[1] === '') {
|
|
102
|
+
if (sep === '\n')
|
|
103
|
+
res += sep;
|
|
104
|
+
else
|
|
105
|
+
sep = '\n';
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
res += sep + match[1];
|
|
109
|
+
sep = ' ';
|
|
110
|
+
}
|
|
111
|
+
pos = line.lastIndex;
|
|
112
|
+
}
|
|
113
|
+
const last = /[ \t]*(.*)/sy;
|
|
114
|
+
last.lastIndex = pos;
|
|
115
|
+
match = last.exec(source);
|
|
116
|
+
return res + sep + ((match && match[1]) || '');
|
|
117
|
+
}
|
|
118
|
+
function doubleQuotedValue(source, onError) {
|
|
119
|
+
let res = '';
|
|
120
|
+
for (let i = 1; i < source.length - 1; ++i) {
|
|
121
|
+
const ch = source[i];
|
|
122
|
+
if (ch === '\r' && source[i + 1] === '\n')
|
|
123
|
+
continue;
|
|
124
|
+
if (ch === '\n') {
|
|
125
|
+
const { fold, offset } = foldNewline(source, i);
|
|
126
|
+
res += fold;
|
|
127
|
+
i = offset;
|
|
128
|
+
}
|
|
129
|
+
else if (ch === '\\') {
|
|
130
|
+
let next = source[++i];
|
|
131
|
+
const cc = escapeCodes[next];
|
|
132
|
+
if (cc)
|
|
133
|
+
res += cc;
|
|
134
|
+
else if (next === '\n') {
|
|
135
|
+
// skip escaped newlines, but still trim the following line
|
|
136
|
+
next = source[i + 1];
|
|
137
|
+
while (next === ' ' || next === '\t')
|
|
138
|
+
next = source[++i + 1];
|
|
139
|
+
}
|
|
140
|
+
else if (next === '\r' && source[i + 1] === '\n') {
|
|
141
|
+
// skip escaped CRLF newlines, but still trim the following line
|
|
142
|
+
next = source[++i + 1];
|
|
143
|
+
while (next === ' ' || next === '\t')
|
|
144
|
+
next = source[++i + 1];
|
|
145
|
+
}
|
|
146
|
+
else if (next === 'x' || next === 'u' || next === 'U') {
|
|
147
|
+
const length = { x: 2, u: 4, U: 8 }[next];
|
|
148
|
+
res += parseCharCode(source, i + 1, length, onError);
|
|
149
|
+
i += length;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const raw = source.substr(i - 1, 2);
|
|
153
|
+
onError(i - 1, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
|
|
154
|
+
res += raw;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else if (ch === ' ' || ch === '\t') {
|
|
158
|
+
// trim trailing whitespace
|
|
159
|
+
const wsStart = i;
|
|
160
|
+
let next = source[i + 1];
|
|
161
|
+
while (next === ' ' || next === '\t')
|
|
162
|
+
next = source[++i + 1];
|
|
163
|
+
if (next !== '\n' && !(next === '\r' && source[i + 2] === '\n'))
|
|
164
|
+
res += i > wsStart ? source.slice(wsStart, i + 1) : ch;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
res += ch;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (source[source.length - 1] !== '"' || source.length === 1)
|
|
171
|
+
onError(source.length, 'MISSING_CHAR', 'Missing closing "quote');
|
|
172
|
+
return res;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Fold a single newline into a space, multiple newlines to N - 1 newlines.
|
|
176
|
+
* Presumes `source[offset] === '\n'`
|
|
177
|
+
*/
|
|
178
|
+
function foldNewline(source, offset) {
|
|
179
|
+
let fold = '';
|
|
180
|
+
let ch = source[offset + 1];
|
|
181
|
+
while (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') {
|
|
182
|
+
if (ch === '\r' && source[offset + 2] !== '\n')
|
|
183
|
+
break;
|
|
184
|
+
if (ch === '\n')
|
|
185
|
+
fold += '\n';
|
|
186
|
+
offset += 1;
|
|
187
|
+
ch = source[offset + 1];
|
|
188
|
+
}
|
|
189
|
+
if (!fold)
|
|
190
|
+
fold = ' ';
|
|
191
|
+
return { fold, offset };
|
|
192
|
+
}
|
|
193
|
+
const escapeCodes = {
|
|
194
|
+
'0': '\0',
|
|
195
|
+
a: '\x07',
|
|
196
|
+
b: '\b',
|
|
197
|
+
e: '\x1b',
|
|
198
|
+
f: '\f',
|
|
199
|
+
n: '\n',
|
|
200
|
+
r: '\r',
|
|
201
|
+
t: '\t',
|
|
202
|
+
v: '\v',
|
|
203
|
+
N: '\u0085',
|
|
204
|
+
_: '\u00a0',
|
|
205
|
+
L: '\u2028',
|
|
206
|
+
P: '\u2029',
|
|
207
|
+
' ': ' ',
|
|
208
|
+
'"': '"',
|
|
209
|
+
'/': '/',
|
|
210
|
+
'\\': '\\',
|
|
211
|
+
'\t': '\t'
|
|
212
|
+
};
|
|
213
|
+
function parseCharCode(source, offset, length, onError) {
|
|
214
|
+
const cc = source.substr(offset, length);
|
|
215
|
+
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
|
|
216
|
+
const code = ok ? parseInt(cc, 16) : NaN;
|
|
217
|
+
if (isNaN(code)) {
|
|
218
|
+
const raw = source.substr(offset - 2, length + 2);
|
|
219
|
+
onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
|
|
220
|
+
return raw;
|
|
221
|
+
}
|
|
222
|
+
return String.fromCodePoint(code);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
exports.resolveFlowScalar = resolveFlowScalar;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SourceToken, Token } from '../parse/cst.js';
|
|
2
|
+
import type { ComposeErrorHandler } from './composer.js';
|
|
3
|
+
export interface ResolvePropsArg {
|
|
4
|
+
flow?: string;
|
|
5
|
+
indicator: 'doc-start' | 'explicit-key-ind' | 'map-value-ind' | 'seq-item-ind';
|
|
6
|
+
next: Token | null | undefined;
|
|
7
|
+
offset: number;
|
|
8
|
+
onError: ComposeErrorHandler;
|
|
9
|
+
startOnNewline: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveProps(tokens: SourceToken[], { flow, indicator, next, offset, onError, startOnNewline }: ResolvePropsArg): {
|
|
12
|
+
comma: SourceToken | null;
|
|
13
|
+
found: SourceToken | null;
|
|
14
|
+
spaceBefore: boolean;
|
|
15
|
+
comment: string;
|
|
16
|
+
hasNewline: boolean;
|
|
17
|
+
anchor: SourceToken | null;
|
|
18
|
+
tag: SourceToken | null;
|
|
19
|
+
end: number;
|
|
20
|
+
start: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) {
|
|
4
|
+
let spaceBefore = false;
|
|
5
|
+
let atNewline = startOnNewline;
|
|
6
|
+
let hasSpace = startOnNewline;
|
|
7
|
+
let comment = '';
|
|
8
|
+
let commentSep = '';
|
|
9
|
+
let hasNewline = false;
|
|
10
|
+
let reqSpace = false;
|
|
11
|
+
let anchor = null;
|
|
12
|
+
let tag = null;
|
|
13
|
+
let comma = null;
|
|
14
|
+
let found = null;
|
|
15
|
+
let start = null;
|
|
16
|
+
for (const token of tokens) {
|
|
17
|
+
if (reqSpace) {
|
|
18
|
+
if (token.type !== 'space' &&
|
|
19
|
+
token.type !== 'newline' &&
|
|
20
|
+
token.type !== 'comma')
|
|
21
|
+
onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
|
|
22
|
+
reqSpace = false;
|
|
23
|
+
}
|
|
24
|
+
switch (token.type) {
|
|
25
|
+
case 'space':
|
|
26
|
+
// At the doc level, tabs at line start may be parsed
|
|
27
|
+
// as leading white space rather than indentation.
|
|
28
|
+
// In a flow collection, only the parser handles indent.
|
|
29
|
+
if (!flow &&
|
|
30
|
+
atNewline &&
|
|
31
|
+
indicator !== 'doc-start' &&
|
|
32
|
+
token.source[0] === '\t')
|
|
33
|
+
onError(token, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
|
|
34
|
+
hasSpace = true;
|
|
35
|
+
break;
|
|
36
|
+
case 'comment': {
|
|
37
|
+
if (!hasSpace)
|
|
38
|
+
onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
|
|
39
|
+
const cb = token.source.substring(1) || ' ';
|
|
40
|
+
if (!comment)
|
|
41
|
+
comment = cb;
|
|
42
|
+
else
|
|
43
|
+
comment += commentSep + cb;
|
|
44
|
+
commentSep = '';
|
|
45
|
+
atNewline = false;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case 'newline':
|
|
49
|
+
if (atNewline) {
|
|
50
|
+
if (comment)
|
|
51
|
+
comment += token.source;
|
|
52
|
+
else
|
|
53
|
+
spaceBefore = true;
|
|
54
|
+
}
|
|
55
|
+
else
|
|
56
|
+
commentSep += token.source;
|
|
57
|
+
atNewline = true;
|
|
58
|
+
hasNewline = true;
|
|
59
|
+
hasSpace = true;
|
|
60
|
+
break;
|
|
61
|
+
case 'anchor':
|
|
62
|
+
if (anchor)
|
|
63
|
+
onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');
|
|
64
|
+
anchor = token;
|
|
65
|
+
if (start === null)
|
|
66
|
+
start = token.offset;
|
|
67
|
+
atNewline = false;
|
|
68
|
+
hasSpace = false;
|
|
69
|
+
reqSpace = true;
|
|
70
|
+
break;
|
|
71
|
+
case 'tag': {
|
|
72
|
+
if (tag)
|
|
73
|
+
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
74
|
+
tag = token;
|
|
75
|
+
if (start === null)
|
|
76
|
+
start = token.offset;
|
|
77
|
+
atNewline = false;
|
|
78
|
+
hasSpace = false;
|
|
79
|
+
reqSpace = true;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case indicator:
|
|
83
|
+
// Could here handle preceding comments differently
|
|
84
|
+
if (anchor || tag)
|
|
85
|
+
onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);
|
|
86
|
+
if (found)
|
|
87
|
+
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow || 'collection'}`);
|
|
88
|
+
found = token;
|
|
89
|
+
atNewline = false;
|
|
90
|
+
hasSpace = false;
|
|
91
|
+
break;
|
|
92
|
+
case 'comma':
|
|
93
|
+
if (flow) {
|
|
94
|
+
if (comma)
|
|
95
|
+
onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);
|
|
96
|
+
comma = token;
|
|
97
|
+
atNewline = false;
|
|
98
|
+
hasSpace = false;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
// else fallthrough
|
|
102
|
+
default:
|
|
103
|
+
onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);
|
|
104
|
+
atNewline = false;
|
|
105
|
+
hasSpace = false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const last = tokens[tokens.length - 1];
|
|
109
|
+
const end = last ? last.offset + last.source.length : offset;
|
|
110
|
+
if (reqSpace &&
|
|
111
|
+
next &&
|
|
112
|
+
next.type !== 'space' &&
|
|
113
|
+
next.type !== 'newline' &&
|
|
114
|
+
next.type !== 'comma' &&
|
|
115
|
+
(next.type !== 'scalar' || next.source !== ''))
|
|
116
|
+
onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
|
|
117
|
+
return {
|
|
118
|
+
comma,
|
|
119
|
+
found,
|
|
120
|
+
spaceBefore,
|
|
121
|
+
comment,
|
|
122
|
+
hasNewline,
|
|
123
|
+
anchor,
|
|
124
|
+
tag,
|
|
125
|
+
end,
|
|
126
|
+
start: start !== null && start !== void 0 ? start : end
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
exports.resolveProps = resolveProps;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function containsNewline(key) {
|
|
4
|
+
if (!key)
|
|
5
|
+
return null;
|
|
6
|
+
switch (key.type) {
|
|
7
|
+
case 'alias':
|
|
8
|
+
case 'scalar':
|
|
9
|
+
case 'double-quoted-scalar':
|
|
10
|
+
case 'single-quoted-scalar':
|
|
11
|
+
if (key.source.includes('\n'))
|
|
12
|
+
return true;
|
|
13
|
+
if (key.end)
|
|
14
|
+
for (const st of key.end)
|
|
15
|
+
if (st.type === 'newline')
|
|
16
|
+
return true;
|
|
17
|
+
return false;
|
|
18
|
+
case 'flow-collection':
|
|
19
|
+
for (const it of key.items) {
|
|
20
|
+
for (const st of it.start)
|
|
21
|
+
if (st.type === 'newline')
|
|
22
|
+
return true;
|
|
23
|
+
if (it.sep)
|
|
24
|
+
for (const st of it.sep)
|
|
25
|
+
if (st.type === 'newline')
|
|
26
|
+
return true;
|
|
27
|
+
if (containsNewline(it.key) || containsNewline(it.value))
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
default:
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.containsNewline = containsNewline;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function emptyScalarPosition(offset, before, pos) {
|
|
4
|
+
if (before) {
|
|
5
|
+
if (pos === null)
|
|
6
|
+
pos = before.length;
|
|
7
|
+
for (let i = pos - 1; i >= 0; --i) {
|
|
8
|
+
let st = before[i];
|
|
9
|
+
switch (st.type) {
|
|
10
|
+
case 'space':
|
|
11
|
+
case 'comment':
|
|
12
|
+
case 'newline':
|
|
13
|
+
offset -= st.source.length;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
// Technically, an empty scalar is immediately after the last non-empty
|
|
17
|
+
// node, but it's more useful to place it after any whitespace.
|
|
18
|
+
st = before[++i];
|
|
19
|
+
while ((st === null || st === void 0 ? void 0 : st.type) === 'space') {
|
|
20
|
+
offset += st.source.length;
|
|
21
|
+
st = before[++i];
|
|
22
|
+
}
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return offset;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.emptyScalarPosition = emptyScalarPosition;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utilContainsNewline = require('./util-contains-newline.js');
|
|
4
|
+
|
|
5
|
+
function flowIndentCheck(indent, fc, onError) {
|
|
6
|
+
if ((fc === null || fc === void 0 ? void 0 : fc.type) === 'flow-collection') {
|
|
7
|
+
const end = fc.end[0];
|
|
8
|
+
if (end.indent === indent &&
|
|
9
|
+
(end.source === ']' || end.source === '}') &&
|
|
10
|
+
utilContainsNewline.containsNewline(fc)) {
|
|
11
|
+
const msg = 'Flow end indicator should be more indented than parent';
|
|
12
|
+
onError(end, 'BAD_INDENT', msg, true);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.flowIndentCheck = flowIndentCheck;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Node = require('../nodes/Node.js');
|
|
4
|
+
|
|
5
|
+
function mapIncludes(ctx, items, search) {
|
|
6
|
+
const { uniqueKeys } = ctx.options;
|
|
7
|
+
if (uniqueKeys === false)
|
|
8
|
+
return false;
|
|
9
|
+
const isEqual = typeof uniqueKeys === 'function'
|
|
10
|
+
? uniqueKeys
|
|
11
|
+
: (a, b) => a === b ||
|
|
12
|
+
(Node.isScalar(a) &&
|
|
13
|
+
Node.isScalar(b) &&
|
|
14
|
+
a.value === b.value &&
|
|
15
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
16
|
+
return items.some(pair => isEqual(pair.key, search));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.mapIncludes = mapIncludes;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { YAMLError, YAMLWarning } from '../errors.js';
|
|
2
|
+
import { Alias } from '../nodes/Alias.js';
|
|
3
|
+
import { Node, NODE_TYPE, ParsedNode, Range } from '../nodes/Node.js';
|
|
4
|
+
import { Pair } from '../nodes/Pair.js';
|
|
5
|
+
import type { Scalar } from '../nodes/Scalar.js';
|
|
6
|
+
import type { YAMLMap } from '../nodes/YAMLMap.js';
|
|
7
|
+
import type { YAMLSeq } from '../nodes/YAMLSeq.js';
|
|
8
|
+
import { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, ToStringOptions } from '../options.js';
|
|
9
|
+
import { Schema } from '../schema/Schema.js';
|
|
10
|
+
import { Directives } from './directives.js';
|
|
11
|
+
export declare type Replacer = any[] | ((key: any, value: any) => unknown);
|
|
12
|
+
export declare namespace Document {
|
|
13
|
+
interface Parsed<T extends ParsedNode = ParsedNode> extends Document<T> {
|
|
14
|
+
directives: Directives;
|
|
15
|
+
range: Range;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare class Document<T = unknown> {
|
|
19
|
+
readonly [NODE_TYPE]: symbol;
|
|
20
|
+
/** A comment before this Document */
|
|
21
|
+
commentBefore: string | null;
|
|
22
|
+
/** A comment immediately after this Document */
|
|
23
|
+
comment: string | null;
|
|
24
|
+
/** The document contents. */
|
|
25
|
+
contents: T | null;
|
|
26
|
+
directives?: Directives;
|
|
27
|
+
/** Errors encountered during parsing. */
|
|
28
|
+
errors: YAMLError[];
|
|
29
|
+
options: Required<Omit<ParseOptions & DocumentOptions, 'lineCounter' | 'directives' | 'version'>>;
|
|
30
|
+
/**
|
|
31
|
+
* The `[start, value-end, node-end]` character offsets for the part of the
|
|
32
|
+
* source parsed into this document (undefined if not parsed). The `value-end`
|
|
33
|
+
* and `node-end` positions are themselves not included in their respective
|
|
34
|
+
* ranges.
|
|
35
|
+
*/
|
|
36
|
+
range?: Range;
|
|
37
|
+
/** The schema used with the document. Use `setSchema()` to change. */
|
|
38
|
+
schema: Schema;
|
|
39
|
+
/** Warnings encountered during parsing. */
|
|
40
|
+
warnings: YAMLWarning[];
|
|
41
|
+
/**
|
|
42
|
+
* @param value - The initial value for the document, which will be wrapped
|
|
43
|
+
* in a Node container.
|
|
44
|
+
*/
|
|
45
|
+
constructor(value?: any, options?: DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions);
|
|
46
|
+
constructor(value: any, replacer: null | Replacer, options?: DocumentOptions & SchemaOptions & ParseOptions & CreateNodeOptions);
|
|
47
|
+
/**
|
|
48
|
+
* Create a deep copy of this Document and its contents.
|
|
49
|
+
*
|
|
50
|
+
* Custom Node values that inherit from `Object` still refer to their original instances.
|
|
51
|
+
*/
|
|
52
|
+
clone(): Document<T>;
|
|
53
|
+
/** Adds a value to the document. */
|
|
54
|
+
add(value: any): void;
|
|
55
|
+
/** Adds a value to the document. */
|
|
56
|
+
addIn(path: Iterable<unknown>, value: unknown): void;
|
|
57
|
+
/**
|
|
58
|
+
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
59
|
+
*
|
|
60
|
+
* If `node` already has an anchor, `name` is ignored.
|
|
61
|
+
* Otherwise, the `node.anchor` value will be set to `name`,
|
|
62
|
+
* or if an anchor with that name is already present in the document,
|
|
63
|
+
* `name` will be used as a prefix for a new unique anchor.
|
|
64
|
+
* If `name` is undefined, the generated anchor will use 'a' as a prefix.
|
|
65
|
+
*/
|
|
66
|
+
createAlias(node: Scalar | YAMLMap | YAMLSeq, name?: string): Alias;
|
|
67
|
+
/**
|
|
68
|
+
* Convert any value into a `Node` using the current schema, recursively
|
|
69
|
+
* turning objects into collections.
|
|
70
|
+
*/
|
|
71
|
+
createNode(value: unknown, options?: CreateNodeOptions): Node;
|
|
72
|
+
createNode(value: unknown, replacer: Replacer | CreateNodeOptions | null, options?: CreateNodeOptions): Node;
|
|
73
|
+
/**
|
|
74
|
+
* Convert a key and a value into a `Pair` using the current schema,
|
|
75
|
+
* recursively wrapping all values as `Scalar` or `Collection` nodes.
|
|
76
|
+
*/
|
|
77
|
+
createPair<K extends Node = Node, V extends Node = Node>(key: unknown, value: unknown, options?: CreateNodeOptions): Pair<K, V>;
|
|
78
|
+
/**
|
|
79
|
+
* Removes a value from the document.
|
|
80
|
+
* @returns `true` if the item was found and removed.
|
|
81
|
+
*/
|
|
82
|
+
delete(key: any): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Removes a value from the document.
|
|
85
|
+
* @returns `true` if the item was found and removed.
|
|
86
|
+
*/
|
|
87
|
+
deleteIn(path: Iterable<unknown>): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
90
|
+
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
91
|
+
* `true` (collections are always returned intact).
|
|
92
|
+
*/
|
|
93
|
+
get(key: unknown, keepScalar?: boolean): unknown;
|
|
94
|
+
/**
|
|
95
|
+
* Returns item at `path`, or `undefined` if not found. By default unwraps
|
|
96
|
+
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
97
|
+
* `true` (collections are always returned intact).
|
|
98
|
+
*/
|
|
99
|
+
getIn(path: Iterable<unknown>, keepScalar?: boolean): unknown;
|
|
100
|
+
/**
|
|
101
|
+
* Checks if the document includes a value with the key `key`.
|
|
102
|
+
*/
|
|
103
|
+
has(key: unknown): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Checks if the document includes a value at `path`.
|
|
106
|
+
*/
|
|
107
|
+
hasIn(path: Iterable<unknown>): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
110
|
+
* boolean to add/remove the item from the set.
|
|
111
|
+
*/
|
|
112
|
+
set(key: any, value: unknown): void;
|
|
113
|
+
/**
|
|
114
|
+
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
115
|
+
* boolean to add/remove the item from the set.
|
|
116
|
+
*/
|
|
117
|
+
setIn(path: Iterable<unknown>, value: unknown): void;
|
|
118
|
+
/**
|
|
119
|
+
* Change the YAML version and schema used by the document.
|
|
120
|
+
* A `null` version disables support for directives, explicit tags, anchors, and aliases.
|
|
121
|
+
* It also requires the `schema` option to be given as a `Schema` instance value.
|
|
122
|
+
*
|
|
123
|
+
* Overrides all previously set schema options.
|
|
124
|
+
*/
|
|
125
|
+
setSchema(version: '1.1' | '1.2' | null, options?: SchemaOptions): void;
|
|
126
|
+
/** A plain JavaScript representation of the document `contents`. */
|
|
127
|
+
toJS(opt?: ToJSOptions & {
|
|
128
|
+
[ignored: string]: unknown;
|
|
129
|
+
}): any;
|
|
130
|
+
/**
|
|
131
|
+
* A JSON representation of the document `contents`.
|
|
132
|
+
*
|
|
133
|
+
* @param jsonArg Used by `JSON.stringify` to indicate the array index or
|
|
134
|
+
* property name.
|
|
135
|
+
*/
|
|
136
|
+
toJSON(jsonArg?: string | null, onAnchor?: ToJSOptions['onAnchor']): any;
|
|
137
|
+
/** A YAML representation of the document. */
|
|
138
|
+
toString(options?: ToStringOptions): string;
|
|
139
|
+
}
|