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,63 @@
|
|
|
1
|
+
import type { Document } from './doc/Document.js';
|
|
2
|
+
import type { Alias } from './nodes/Alias.js';
|
|
3
|
+
import { Node } from './nodes/Node.js';
|
|
4
|
+
import type { 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
|
+
export declare type visitorFn<T> = (key: number | 'key' | 'value' | null, node: T, path: readonly (Document | Node | Pair)[]) => void | symbol | number | Node | Pair;
|
|
9
|
+
export declare type visitor = visitorFn<unknown> | {
|
|
10
|
+
Alias?: visitorFn<Alias>;
|
|
11
|
+
Collection?: visitorFn<YAMLMap | YAMLSeq>;
|
|
12
|
+
Map?: visitorFn<YAMLMap>;
|
|
13
|
+
Node?: visitorFn<Alias | Scalar | YAMLMap | YAMLSeq>;
|
|
14
|
+
Pair?: visitorFn<Pair>;
|
|
15
|
+
Scalar?: visitorFn<Scalar>;
|
|
16
|
+
Seq?: visitorFn<YAMLSeq>;
|
|
17
|
+
Value?: visitorFn<Scalar | YAMLMap | YAMLSeq>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Apply a visitor to an AST node or document.
|
|
21
|
+
*
|
|
22
|
+
* Walks through the tree (depth-first) starting from `node`, calling a
|
|
23
|
+
* `visitor` function with three arguments:
|
|
24
|
+
* - `key`: For sequence values and map `Pair`, the node's index in the
|
|
25
|
+
* collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
|
|
26
|
+
* `null` for the root node.
|
|
27
|
+
* - `node`: The current node.
|
|
28
|
+
* - `path`: The ancestry of the current node.
|
|
29
|
+
*
|
|
30
|
+
* The return value of the visitor may be used to control the traversal:
|
|
31
|
+
* - `undefined` (default): Do nothing and continue
|
|
32
|
+
* - `visit.SKIP`: Do not visit the children of this node, continue with next
|
|
33
|
+
* sibling
|
|
34
|
+
* - `visit.BREAK`: Terminate traversal completely
|
|
35
|
+
* - `visit.REMOVE`: Remove the current node, then continue with the next one
|
|
36
|
+
* - `Node`: Replace the current node, then continue by visiting it
|
|
37
|
+
* - `number`: While iterating the items of a sequence or map, set the index
|
|
38
|
+
* of the next step. This is useful especially if the index of the current
|
|
39
|
+
* node has changed.
|
|
40
|
+
*
|
|
41
|
+
* If `visitor` is a single function, it will be called with all values
|
|
42
|
+
* encountered in the tree, including e.g. `null` values. Alternatively,
|
|
43
|
+
* separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
|
|
44
|
+
* `Alias` and `Scalar` node. To define the same visitor function for more than
|
|
45
|
+
* one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
|
|
46
|
+
* and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
|
|
47
|
+
* specific defined one will be used for each node.
|
|
48
|
+
*/
|
|
49
|
+
export declare function visit(node: Node | Document | null, visitor: visitorFn<unknown> | {
|
|
50
|
+
Alias?: visitorFn<Alias>;
|
|
51
|
+
Collection?: visitorFn<YAMLMap | YAMLSeq>;
|
|
52
|
+
Map?: visitorFn<YAMLMap>;
|
|
53
|
+
Node?: visitorFn<Alias | Scalar | YAMLMap | YAMLSeq>;
|
|
54
|
+
Pair?: visitorFn<Pair>;
|
|
55
|
+
Scalar?: visitorFn<Scalar>;
|
|
56
|
+
Seq?: visitorFn<YAMLSeq>;
|
|
57
|
+
Value?: visitorFn<Scalar | YAMLMap | YAMLSeq>;
|
|
58
|
+
}): void;
|
|
59
|
+
export declare namespace visit {
|
|
60
|
+
var BREAK: symbol;
|
|
61
|
+
var SKIP: symbol;
|
|
62
|
+
var REMOVE: symbol;
|
|
63
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Node = require('./nodes/Node.js');
|
|
4
|
+
|
|
5
|
+
const BREAK = Symbol('break visit');
|
|
6
|
+
const SKIP = Symbol('skip children');
|
|
7
|
+
const REMOVE = Symbol('remove node');
|
|
8
|
+
/**
|
|
9
|
+
* Apply a visitor to an AST node or document.
|
|
10
|
+
*
|
|
11
|
+
* Walks through the tree (depth-first) starting from `node`, calling a
|
|
12
|
+
* `visitor` function with three arguments:
|
|
13
|
+
* - `key`: For sequence values and map `Pair`, the node's index in the
|
|
14
|
+
* collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
|
|
15
|
+
* `null` for the root node.
|
|
16
|
+
* - `node`: The current node.
|
|
17
|
+
* - `path`: The ancestry of the current node.
|
|
18
|
+
*
|
|
19
|
+
* The return value of the visitor may be used to control the traversal:
|
|
20
|
+
* - `undefined` (default): Do nothing and continue
|
|
21
|
+
* - `visit.SKIP`: Do not visit the children of this node, continue with next
|
|
22
|
+
* sibling
|
|
23
|
+
* - `visit.BREAK`: Terminate traversal completely
|
|
24
|
+
* - `visit.REMOVE`: Remove the current node, then continue with the next one
|
|
25
|
+
* - `Node`: Replace the current node, then continue by visiting it
|
|
26
|
+
* - `number`: While iterating the items of a sequence or map, set the index
|
|
27
|
+
* of the next step. This is useful especially if the index of the current
|
|
28
|
+
* node has changed.
|
|
29
|
+
*
|
|
30
|
+
* If `visitor` is a single function, it will be called with all values
|
|
31
|
+
* encountered in the tree, including e.g. `null` values. Alternatively,
|
|
32
|
+
* separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
|
|
33
|
+
* `Alias` and `Scalar` node. To define the same visitor function for more than
|
|
34
|
+
* one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
|
|
35
|
+
* and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
|
|
36
|
+
* specific defined one will be used for each node.
|
|
37
|
+
*/
|
|
38
|
+
function visit(node, visitor) {
|
|
39
|
+
if (typeof visitor === 'object' &&
|
|
40
|
+
(visitor.Collection || visitor.Node || visitor.Value)) {
|
|
41
|
+
visitor = Object.assign({
|
|
42
|
+
Alias: visitor.Node,
|
|
43
|
+
Map: visitor.Node,
|
|
44
|
+
Scalar: visitor.Node,
|
|
45
|
+
Seq: visitor.Node
|
|
46
|
+
}, visitor.Value && {
|
|
47
|
+
Map: visitor.Value,
|
|
48
|
+
Scalar: visitor.Value,
|
|
49
|
+
Seq: visitor.Value
|
|
50
|
+
}, visitor.Collection && {
|
|
51
|
+
Map: visitor.Collection,
|
|
52
|
+
Seq: visitor.Collection
|
|
53
|
+
}, visitor);
|
|
54
|
+
}
|
|
55
|
+
if (Node.isDocument(node)) {
|
|
56
|
+
const cd = _visit(null, node.contents, visitor, Object.freeze([node]));
|
|
57
|
+
if (cd === REMOVE)
|
|
58
|
+
node.contents = null;
|
|
59
|
+
}
|
|
60
|
+
else
|
|
61
|
+
_visit(null, node, visitor, Object.freeze([]));
|
|
62
|
+
}
|
|
63
|
+
// Without the `as symbol` casts, TS declares these in the `visit`
|
|
64
|
+
// namespace using `var`, but then complains about that because
|
|
65
|
+
// `unique symbol` must be `const`.
|
|
66
|
+
/** Terminate visit traversal completely */
|
|
67
|
+
visit.BREAK = BREAK;
|
|
68
|
+
/** Do not visit the children of the current node */
|
|
69
|
+
visit.SKIP = SKIP;
|
|
70
|
+
/** Remove the current node */
|
|
71
|
+
visit.REMOVE = REMOVE;
|
|
72
|
+
function _visit(key, node, visitor, path) {
|
|
73
|
+
let ctrl = undefined;
|
|
74
|
+
if (typeof visitor === 'function')
|
|
75
|
+
ctrl = visitor(key, node, path);
|
|
76
|
+
else if (Node.isMap(node)) {
|
|
77
|
+
if (visitor.Map)
|
|
78
|
+
ctrl = visitor.Map(key, node, path);
|
|
79
|
+
}
|
|
80
|
+
else if (Node.isSeq(node)) {
|
|
81
|
+
if (visitor.Seq)
|
|
82
|
+
ctrl = visitor.Seq(key, node, path);
|
|
83
|
+
}
|
|
84
|
+
else if (Node.isPair(node)) {
|
|
85
|
+
if (visitor.Pair)
|
|
86
|
+
ctrl = visitor.Pair(key, node, path);
|
|
87
|
+
}
|
|
88
|
+
else if (Node.isScalar(node)) {
|
|
89
|
+
if (visitor.Scalar)
|
|
90
|
+
ctrl = visitor.Scalar(key, node, path);
|
|
91
|
+
}
|
|
92
|
+
else if (Node.isAlias(node)) {
|
|
93
|
+
if (visitor.Alias)
|
|
94
|
+
ctrl = visitor.Alias(key, node, path);
|
|
95
|
+
}
|
|
96
|
+
if (Node.isNode(ctrl) || Node.isPair(ctrl)) {
|
|
97
|
+
const parent = path[path.length - 1];
|
|
98
|
+
if (Node.isCollection(parent)) {
|
|
99
|
+
parent.items[key] = ctrl;
|
|
100
|
+
}
|
|
101
|
+
else if (Node.isPair(parent)) {
|
|
102
|
+
if (key === 'key')
|
|
103
|
+
parent.key = ctrl;
|
|
104
|
+
else
|
|
105
|
+
parent.value = ctrl;
|
|
106
|
+
}
|
|
107
|
+
else if (Node.isDocument(parent)) {
|
|
108
|
+
parent.contents = ctrl;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const pt = Node.isAlias(parent) ? 'alias' : 'scalar';
|
|
112
|
+
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
113
|
+
}
|
|
114
|
+
return _visit(key, ctrl, visitor, path);
|
|
115
|
+
}
|
|
116
|
+
if (typeof ctrl !== 'symbol') {
|
|
117
|
+
if (Node.isCollection(node)) {
|
|
118
|
+
path = Object.freeze(path.concat(node));
|
|
119
|
+
for (let i = 0; i < node.items.length; ++i) {
|
|
120
|
+
const ci = _visit(i, node.items[i], visitor, path);
|
|
121
|
+
if (typeof ci === 'number')
|
|
122
|
+
i = ci - 1;
|
|
123
|
+
else if (ci === BREAK)
|
|
124
|
+
return BREAK;
|
|
125
|
+
else if (ci === REMOVE) {
|
|
126
|
+
node.items.splice(i, 1);
|
|
127
|
+
i -= 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (Node.isPair(node)) {
|
|
132
|
+
path = Object.freeze(path.concat(node));
|
|
133
|
+
const ck = _visit('key', node.key, visitor, path);
|
|
134
|
+
if (ck === BREAK)
|
|
135
|
+
return BREAK;
|
|
136
|
+
else if (ck === REMOVE)
|
|
137
|
+
node.key = null;
|
|
138
|
+
const cv = _visit('value', node.value, visitor, path);
|
|
139
|
+
if (cv === BREAK)
|
|
140
|
+
return BREAK;
|
|
141
|
+
else if (cv === REMOVE)
|
|
142
|
+
node.value = null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return ctrl;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
exports.visit = visit;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaml",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-10",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Eemeli Aro <eemeli@gmail.com>",
|
|
6
6
|
"repository": "github:eemeli/yaml",
|
|
@@ -10,72 +10,53 @@
|
|
|
10
10
|
"parser",
|
|
11
11
|
"stringifier"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://eemeli.org/yaml/
|
|
13
|
+
"homepage": "https://eemeli.org/yaml/",
|
|
14
14
|
"files": [
|
|
15
15
|
"browser/",
|
|
16
16
|
"dist/",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"*.js",
|
|
20
|
-
"*.mjs",
|
|
21
|
-
"!*config.js"
|
|
17
|
+
"util.d.ts",
|
|
18
|
+
"util.js"
|
|
22
19
|
],
|
|
23
20
|
"type": "commonjs",
|
|
24
|
-
"main": "./index.js",
|
|
21
|
+
"main": "./dist/index.js",
|
|
25
22
|
"browser": {
|
|
26
|
-
"./index.js": "./browser/index.js",
|
|
27
|
-
"./
|
|
28
|
-
"./
|
|
29
|
-
"./parse-cst.js": "./browser/parse-cst.js",
|
|
30
|
-
"./scalar.js": "./browser/scalar.js",
|
|
31
|
-
"./schema.js": "./browser/schema.js",
|
|
32
|
-
"./seq.js": "./browser/seq.js",
|
|
33
|
-
"./types.js": "./browser/types.js",
|
|
34
|
-
"./types.mjs": "./browser/types.js",
|
|
35
|
-
"./types/binary.js": "./browser/types/binary.js",
|
|
36
|
-
"./types/omap.js": "./browser/types/omap.js",
|
|
37
|
-
"./types/pairs.js": "./browser/types/pairs.js",
|
|
38
|
-
"./types/set.js": "./browser/types/set.js",
|
|
39
|
-
"./types/timestamp.js": "./browser/types/timestamp.js",
|
|
40
|
-
"./util.js": "./browser/util.js",
|
|
41
|
-
"./util.mjs": "./browser/util.js"
|
|
23
|
+
"./dist/index.js": "./browser/index.js",
|
|
24
|
+
"./dist/util.js": "./browser/dist/util.js",
|
|
25
|
+
"./util.js": "./browser/dist/util.js"
|
|
42
26
|
},
|
|
43
27
|
"exports": {
|
|
44
|
-
".":
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"./
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
"import": "./util.mjs"
|
|
55
|
-
},
|
|
56
|
-
"./util.js"
|
|
57
|
-
],
|
|
58
|
-
"./": "./"
|
|
28
|
+
".": {
|
|
29
|
+
"node": "./dist/index.js",
|
|
30
|
+
"default": "./browser/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json",
|
|
33
|
+
"./util": {
|
|
34
|
+
"node": "./dist/util.js",
|
|
35
|
+
"default": "./browser/dist/util.js"
|
|
36
|
+
}
|
|
59
37
|
},
|
|
60
38
|
"scripts": {
|
|
61
39
|
"build": "npm run build:node && npm run build:browser",
|
|
62
|
-
"build:browser": "rollup -c rollup.browser-config.js",
|
|
63
|
-
"build:node": "rollup -c rollup.node-config.js",
|
|
40
|
+
"build:browser": "rollup -c config/rollup.browser-config.js",
|
|
41
|
+
"build:node": "rollup -c config/rollup.node-config.js",
|
|
64
42
|
"clean": "git clean -fdxe node_modules",
|
|
65
43
|
"lint": "eslint src/",
|
|
66
44
|
"prettier": "prettier --write .",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
45
|
+
"prestart": "npm run build:node",
|
|
46
|
+
"start": "node -i -e 'YAML=require(\"./dist/index.js\")'",
|
|
47
|
+
"test": "jest --config config/jest.config.js",
|
|
48
|
+
"test:all": "npm test && npm run test:types && npm run test:dist && npm run test:dist:types",
|
|
69
49
|
"test:browsers": "cd playground && npm test",
|
|
70
|
-
"test:dist": "npm run build:node && jest",
|
|
71
|
-
"test:types": "tsc --
|
|
50
|
+
"test:dist": "npm run build:node && jest --config config/jest.config.js",
|
|
51
|
+
"test:dist:types": "tsc --allowJs --moduleResolution node --noEmit --target es5 dist/index.js",
|
|
52
|
+
"test:types": "tsc --noEmit",
|
|
72
53
|
"docs:install": "cd docs-slate && bundle install",
|
|
73
54
|
"docs:deploy": "cd docs-slate && ./deploy.sh",
|
|
74
55
|
"docs": "cd docs-slate && bundle exec middleman server",
|
|
75
56
|
"preversion": "npm test && npm run build",
|
|
76
57
|
"prepublishOnly": "npm run clean && npm test && npm run build"
|
|
77
58
|
},
|
|
78
|
-
"browserslist": "
|
|
59
|
+
"browserslist": "defaults, not ie 11",
|
|
79
60
|
"prettier": {
|
|
80
61
|
"arrowParens": "avoid",
|
|
81
62
|
"semi": false,
|
|
@@ -85,22 +66,29 @@
|
|
|
85
66
|
"devDependencies": {
|
|
86
67
|
"@babel/core": "^7.12.10",
|
|
87
68
|
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
|
69
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
|
|
70
|
+
"@babel/plugin-transform-typescript": "^7.12.17",
|
|
88
71
|
"@babel/preset-env": "^7.12.11",
|
|
89
72
|
"@rollup/plugin-babel": "^5.2.3",
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
73
|
+
"@rollup/plugin-replace": "^3.0.0",
|
|
74
|
+
"@rollup/plugin-typescript": "^8.1.1",
|
|
75
|
+
"@types/jest": "^27.0.1",
|
|
76
|
+
"@types/node": "^16.9.1",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
78
|
+
"@typescript-eslint/parser": "^5.3.1",
|
|
79
|
+
"babel-jest": "^27.0.1",
|
|
94
80
|
"cross-env": "^7.0.3",
|
|
95
|
-
"eslint": "^
|
|
96
|
-
"eslint-config-prettier": "^
|
|
81
|
+
"eslint": "^8.2.0",
|
|
82
|
+
"eslint-config-prettier": "^8.1.0",
|
|
97
83
|
"fast-check": "^2.12.0",
|
|
98
|
-
"jest": "^
|
|
84
|
+
"jest": "^27.0.1",
|
|
85
|
+
"jest-ts-webcompat-resolver": "^1.0.0",
|
|
99
86
|
"prettier": "^2.2.1",
|
|
100
87
|
"rollup": "^2.38.2",
|
|
101
|
-
"
|
|
88
|
+
"tslib": "^2.1.0",
|
|
89
|
+
"typescript": "^4.3.5"
|
|
102
90
|
},
|
|
103
91
|
"engines": {
|
|
104
|
-
"node": ">=
|
|
92
|
+
"node": ">= 12"
|
|
105
93
|
}
|
|
106
94
|
}
|
|
@@ -1,86 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export function findPair(items: any[], key: Scalar | any): Pair | undefined
|
|
6
|
-
|
|
7
|
-
export function parseMap(doc: Document, cst: CST.Map): AST.BlockMap
|
|
8
|
-
export function parseMap(doc: Document, cst: CST.FlowMap): AST.FlowMap
|
|
9
|
-
export function parseSeq(doc: Document, cst: CST.Seq): AST.BlockSeq
|
|
10
|
-
export function parseSeq(doc: Document, cst: CST.FlowSeq): AST.FlowSeq
|
|
11
|
-
|
|
12
|
-
export function stringifyNumber(item: Scalar): string
|
|
13
|
-
export function stringifyString(
|
|
14
|
-
item: Scalar,
|
|
15
|
-
ctx: Schema.StringifyContext,
|
|
16
|
-
onComment?: () => void,
|
|
17
|
-
onChompKeep?: () => void
|
|
18
|
-
): string
|
|
19
|
-
|
|
20
|
-
export function toJSON(
|
|
21
|
-
value: any,
|
|
22
|
-
arg?: any,
|
|
23
|
-
ctx?: Schema.CreateNodeContext
|
|
24
|
-
): any
|
|
25
|
-
|
|
26
|
-
export enum Type {
|
|
27
|
-
ALIAS = 'ALIAS',
|
|
28
|
-
BLANK_LINE = 'BLANK_LINE',
|
|
29
|
-
BLOCK_FOLDED = 'BLOCK_FOLDED',
|
|
30
|
-
BLOCK_LITERAL = 'BLOCK_LITERAL',
|
|
31
|
-
COMMENT = 'COMMENT',
|
|
32
|
-
DIRECTIVE = 'DIRECTIVE',
|
|
33
|
-
DOCUMENT = 'DOCUMENT',
|
|
34
|
-
FLOW_MAP = 'FLOW_MAP',
|
|
35
|
-
FLOW_SEQ = 'FLOW_SEQ',
|
|
36
|
-
MAP = 'MAP',
|
|
37
|
-
MAP_KEY = 'MAP_KEY',
|
|
38
|
-
MAP_VALUE = 'MAP_VALUE',
|
|
39
|
-
PLAIN = 'PLAIN',
|
|
40
|
-
QUOTE_DOUBLE = 'QUOTE_DOUBLE',
|
|
41
|
-
QUOTE_SINGLE = 'QUOTE_SINGLE',
|
|
42
|
-
SEQ = 'SEQ',
|
|
43
|
-
SEQ_ITEM = 'SEQ_ITEM'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface LinePos {
|
|
47
|
-
line: number
|
|
48
|
-
col: number
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class YAMLError extends Error {
|
|
52
|
-
name:
|
|
53
|
-
| 'YAMLReferenceError'
|
|
54
|
-
| 'YAMLSemanticError'
|
|
55
|
-
| 'YAMLSyntaxError'
|
|
56
|
-
| 'YAMLWarning'
|
|
57
|
-
message: string
|
|
58
|
-
source?: CST.Node
|
|
59
|
-
|
|
60
|
-
nodeType?: Type
|
|
61
|
-
range?: CST.Range
|
|
62
|
-
linePos?: { start: LinePos; end: LinePos }
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Drops `source` and adds `nodeType`, `range` and `linePos`, as well as
|
|
66
|
-
* adding details to `message`. Run automatically for document errors if
|
|
67
|
-
* the `prettyErrors` option is set.
|
|
68
|
-
*/
|
|
69
|
-
makePretty(): void
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export class YAMLReferenceError extends YAMLError {
|
|
73
|
-
name: 'YAMLReferenceError'
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export class YAMLSemanticError extends YAMLError {
|
|
77
|
-
name: 'YAMLSemanticError'
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export class YAMLSyntaxError extends YAMLError {
|
|
81
|
-
name: 'YAMLSyntaxError'
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export class YAMLWarning extends YAMLError {
|
|
85
|
-
name: 'YAMLWarning'
|
|
86
|
-
}
|
|
1
|
+
// Workaround for incomplete exports support in TypeScript
|
|
2
|
+
// https://github.com/microsoft/TypeScript/issues/33079
|
|
3
|
+
export * from './dist/util.js'
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.findPair = util.findPair
|
|
4
|
-
exports.toJSON = util.toJSON
|
|
5
|
-
exports.parseMap = util.parseMap
|
|
6
|
-
exports.parseSeq = util.parseSeq
|
|
7
|
-
|
|
8
|
-
exports.stringifyNumber = util.stringifyNumber
|
|
9
|
-
exports.stringifyString = util.stringifyString
|
|
10
|
-
exports.Type = util.Type
|
|
11
|
-
|
|
12
|
-
exports.YAMLError = util.YAMLError
|
|
13
|
-
exports.YAMLReferenceError = util.YAMLReferenceError
|
|
14
|
-
exports.YAMLSemanticError = util.YAMLSemanticError
|
|
15
|
-
exports.YAMLSyntaxError = util.YAMLSyntaxError
|
|
16
|
-
exports.YAMLWarning = util.YAMLWarning
|
|
1
|
+
// Re-exporter for Node.js < 12.16.0
|
|
2
|
+
module.exports = require('./dist/util.js')
|
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"jsii-diff": "^1.52.1",
|
|
70
70
|
"jsii-docgen": "^1.8.110",
|
|
71
71
|
"json-schema": "^0.4.0",
|
|
72
|
-
"markmac": "^0.1.
|
|
72
|
+
"markmac": "^0.1.143",
|
|
73
73
|
"npm-check-updates": "^12",
|
|
74
74
|
"prettier": "^2.5.1",
|
|
75
75
|
"standard-version": "^9",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"semver": "^7.3.5",
|
|
88
88
|
"shx": "^0.3.4",
|
|
89
89
|
"xmlbuilder2": "^2.4.1",
|
|
90
|
-
"yaml": "
|
|
90
|
+
"yaml": "next",
|
|
91
91
|
"yargs": "^16.2.0"
|
|
92
92
|
},
|
|
93
93
|
"bundledDependencies": [
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
},
|
|
118
118
|
"main": "lib/index.js",
|
|
119
119
|
"license": "Apache-2.0",
|
|
120
|
-
"version": "0.51.
|
|
120
|
+
"version": "0.51.8",
|
|
121
121
|
"jest": {
|
|
122
122
|
"testMatch": [
|
|
123
123
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|
package/releasetag.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v0.51.
|
|
1
|
+
v0.51.8
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.51.
|
|
1
|
+
0.51.8
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
(The MIT License)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017, Ryan Zimmerman <opensrc@ryanzim.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the 'Software'), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# universalify
|
|
2
|
-
|
|
3
|
-
[](https://travis-ci.org/RyanZim/universalify)
|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
Make a callback- or promise-based function support both promises and callbacks.
|
|
9
|
-
|
|
10
|
-
Uses the native promise implementation.
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install universalify
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## API
|
|
19
|
-
|
|
20
|
-
### `universalify.fromCallback(fn)`
|
|
21
|
-
|
|
22
|
-
Takes a callback-based function to universalify, and returns the universalified function.
|
|
23
|
-
|
|
24
|
-
Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once.
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
function callbackFn (n, cb) {
|
|
28
|
-
setTimeout(() => cb(null, n), 15)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const fn = universalify.fromCallback(callbackFn)
|
|
32
|
-
|
|
33
|
-
// Works with Promises:
|
|
34
|
-
fn('Hello World!')
|
|
35
|
-
.then(result => console.log(result)) // -> Hello World!
|
|
36
|
-
.catch(error => console.error(error))
|
|
37
|
-
|
|
38
|
-
// Works with Callbacks:
|
|
39
|
-
fn('Hi!', (error, result) => {
|
|
40
|
-
if (error) return console.error(error)
|
|
41
|
-
console.log(result)
|
|
42
|
-
// -> Hi!
|
|
43
|
-
})
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### `universalify.fromPromise(fn)`
|
|
47
|
-
|
|
48
|
-
Takes a promise-based function to universalify, and returns the universalified function.
|
|
49
|
-
|
|
50
|
-
Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned.
|
|
51
|
-
|
|
52
|
-
```js
|
|
53
|
-
function promiseFn (n) {
|
|
54
|
-
return new Promise(resolve => {
|
|
55
|
-
setTimeout(() => resolve(n), 15)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const fn = universalify.fromPromise(promiseFn)
|
|
60
|
-
|
|
61
|
-
// Works with Promises:
|
|
62
|
-
fn('Hello World!')
|
|
63
|
-
.then(result => console.log(result)) // -> Hello World!
|
|
64
|
-
.catch(error => console.error(error))
|
|
65
|
-
|
|
66
|
-
// Works with Callbacks:
|
|
67
|
-
fn('Hi!', (error, result) => {
|
|
68
|
-
if (error) return console.error(error)
|
|
69
|
-
console.log(result)
|
|
70
|
-
// -> Hi!
|
|
71
|
-
})
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## License
|
|
75
|
-
|
|
76
|
-
MIT
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
exports.fromCallback = function (fn) {
|
|
4
|
-
return Object.defineProperty(function (...args) {
|
|
5
|
-
if (typeof args[args.length - 1] === 'function') fn.apply(this, args)
|
|
6
|
-
else {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
fn.call(
|
|
9
|
-
this,
|
|
10
|
-
...args,
|
|
11
|
-
(err, res) => (err != null) ? reject(err) : resolve(res)
|
|
12
|
-
)
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
}, 'name', { value: fn.name })
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exports.fromPromise = function (fn) {
|
|
19
|
-
return Object.defineProperty(function (...args) {
|
|
20
|
-
const cb = args[args.length - 1]
|
|
21
|
-
if (typeof cb !== 'function') return fn.apply(this, args)
|
|
22
|
-
else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)
|
|
23
|
-
}, 'name', { value: fn.name })
|
|
24
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "universalify",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"description": "Make a callback- or promise-based function support both promises and callbacks.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"callback",
|
|
7
|
-
"native",
|
|
8
|
-
"promise"
|
|
9
|
-
],
|
|
10
|
-
"homepage": "https://github.com/RyanZim/universalify#readme",
|
|
11
|
-
"bugs": "https://github.com/RyanZim/universalify/issues",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"author": "Ryan Zimmerman <opensrc@ryanzim.com>",
|
|
14
|
-
"files": [
|
|
15
|
-
"index.js"
|
|
16
|
-
],
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/RyanZim/universalify.git"
|
|
20
|
-
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"test": "standard && nyc tape test/*.js | colortape"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"colortape": "^0.1.2",
|
|
26
|
-
"coveralls": "^3.0.1",
|
|
27
|
-
"nyc": "^15.0.0",
|
|
28
|
-
"standard": "^14.3.1",
|
|
29
|
-
"tape": "^5.0.1"
|
|
30
|
-
},
|
|
31
|
-
"engines": {
|
|
32
|
-
"node": ">= 10.0.0"
|
|
33
|
-
}
|
|
34
|
-
}
|