projen 0.98.32 → 0.98.34
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 +1906 -626
- package/lib/ai-instructions.js +2 -2
- package/lib/awscdk/auto-discover.js +5 -5
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-py.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-py.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +4 -4
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/internal.d.ts +1 -2
- package/lib/awscdk/lambda-extension.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/awscdk/private/feature-flags-v2.const.d.ts +2 -3
- package/lib/awscdk/private/feature-flags-v2.const.js +4 -5
- package/lib/build/build-workflow.js +6 -7
- package/lib/cdk/auto-discover-base.js +2 -2
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/integration-test-base.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/auto-discover.js +2 -2
- package/lib/cdk8s/cdk8s-app-py.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdk8s/cdk8s-deps-py.js +1 -1
- package/lib/cdk8s/cdk8s-deps.js +1 -1
- package/lib/cdk8s/integration-test.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/circleci/circleci.js +1 -1
- package/lib/cli/index.js +6 -3
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose/docker-compose-service.js +1 -1
- package/lib/docker-compose/docker-compose.js +1 -1
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/actions-provider.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/auto-queue.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-credentials.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/merge-queue.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/private/util.d.ts +14 -0
- package/lib/github/private/util.js +20 -1
- package/lib/github/pull-request-backport.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow-job.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflow-actions.js +1 -1
- package/lib/github/workflow-jobs.js +1 -1
- package/lib/github/workflow-steps.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 +2 -2
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/biome/biome-config.d.ts +126 -50
- package/lib/javascript/biome/biome-config.js +74 -39
- package/lib/javascript/biome/biome.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +4 -4
- package/lib/javascript/license-checker.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.d.ts +2 -2
- package/lib/javascript/node-project.js +3 -3
- 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 +2 -2
- package/lib/javascript/upgrade-dependencies.js +17 -9
- package/lib/javascript/yarnrc.js +1 -1
- package/lib/json-patch.js +1 -1
- 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-tree.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +2 -2
- package/lib/projenrc.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/pyproject-toml-file.js +1 -1
- package/lib/python/pytest-sample.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/uv-config.d.ts +437 -21
- package/lib/python/uv-config.js +437 -2
- package/lib/python/uv.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 +15 -18
- package/lib/renovatebot.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-ts.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +6 -6
- package/lib/version.js +2 -2
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/extensions.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/settings.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.js +1 -1
- package/node_modules/@oozcitak/dom/README.md +2 -4
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js +7 -29
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js +3 -3
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js +14 -14
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js +40 -62
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js +53 -54
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js +14 -14
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js +29 -51
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js +11 -11
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js +25 -63
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js +79 -85
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.d.ts +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js +96 -153
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js +15 -37
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js +229 -404
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js +47 -109
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.d.ts +5 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js +19 -19
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js +69 -124
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js +11 -11
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js +20 -72
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js +12 -34
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js +183 -289
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js +2 -2
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js +65 -140
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js +63 -89
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js +6 -6
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js +141 -208
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js +13 -13
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js +16 -16
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/index.js +42 -31
- package/node_modules/@oozcitak/dom/lib/algorithm/index.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js +12 -15
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js +20 -43
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js +20 -62
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js +53 -92
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js +13 -27
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js +40 -88
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js +41 -55
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js +13 -28
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js +14 -36
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.js +114 -204
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js +51 -68
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js +32 -31
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js +105 -163
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.d.ts +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js +30 -73
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.d.ts +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js +198 -330
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js +3 -5
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js +29 -75
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.d.ts +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js +234 -393
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js +89 -137
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js +32 -57
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js +58 -64
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js +36 -88
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js +33 -60
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js +33 -47
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js +58 -42
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.d.ts +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js +375 -471
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js +29 -49
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js +69 -97
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js +66 -93
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js +33 -43
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js +9 -11
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js +73 -121
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js +19 -36
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js +174 -241
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js +22 -43
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js +13 -25
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js +12 -25
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js +34 -80
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js +15 -23
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js +46 -64
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js +21 -42
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js +6 -20
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/index.js +92 -91
- package/node_modules/@oozcitak/dom/lib/dom/index.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.d.ts +28 -25
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.js +9 -7
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/index.js +5 -4
- package/node_modules/@oozcitak/dom/lib/index.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js +13 -15
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js +78 -128
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js +107 -123
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/parser/index.js +2 -1
- package/node_modules/@oozcitak/dom/lib/parser/index.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.d.ts +2 -2
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.js +2 -1
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js +10 -12
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js +23 -25
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js +405 -517
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/serializer/index.js +2 -1
- package/node_modules/@oozcitak/dom/lib/serializer/index.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/util/Cast.js +6 -8
- package/node_modules/@oozcitak/dom/lib/util/Cast.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.d.ts +13 -5
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.js +33 -46
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/util/Guard.js +47 -49
- package/node_modules/@oozcitak/dom/lib/util/Guard.js.map +1 -1
- package/node_modules/@oozcitak/dom/lib/util/index.js +4 -3
- package/node_modules/@oozcitak/dom/lib/util/index.js.map +1 -1
- package/node_modules/@oozcitak/dom/package.json +14 -41
- package/node_modules/@oozcitak/infra/LICENSE +21 -21
- package/node_modules/@oozcitak/infra/README.md +11 -13
- package/node_modules/@oozcitak/infra/lib/Base64.js +3 -3
- package/node_modules/@oozcitak/infra/lib/Base64.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/Byte.js +1 -1
- package/node_modules/@oozcitak/infra/lib/Byte.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/ByteSequence.js +19 -39
- package/node_modules/@oozcitak/infra/lib/ByteSequence.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/CodePoints.js +1 -0
- package/node_modules/@oozcitak/infra/lib/CodePoints.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/JSON.d.ts +1 -1
- package/node_modules/@oozcitak/infra/lib/JSON.js +18 -40
- package/node_modules/@oozcitak/infra/lib/JSON.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/List.d.ts +4 -4
- package/node_modules/@oozcitak/infra/lib/List.js +49 -173
- package/node_modules/@oozcitak/infra/lib/List.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/Map.d.ts +1 -1
- package/node_modules/@oozcitak/infra/lib/Map.js +43 -177
- package/node_modules/@oozcitak/infra/lib/Map.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/Namespace.js +1 -0
- package/node_modules/@oozcitak/infra/lib/Namespace.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/Queue.d.ts +1 -1
- package/node_modules/@oozcitak/infra/lib/Queue.js +2 -2
- package/node_modules/@oozcitak/infra/lib/Queue.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/Set.d.ts +1 -1
- package/node_modules/@oozcitak/infra/lib/Set.js +76 -254
- package/node_modules/@oozcitak/infra/lib/Set.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/Stack.d.ts +1 -1
- package/node_modules/@oozcitak/infra/lib/Stack.js +2 -2
- package/node_modules/@oozcitak/infra/lib/Stack.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/String.d.ts +2 -2
- package/node_modules/@oozcitak/infra/lib/String.js +75 -131
- package/node_modules/@oozcitak/infra/lib/String.js.map +1 -1
- package/node_modules/@oozcitak/infra/lib/index.js +46 -19
- package/node_modules/@oozcitak/infra/lib/index.js.map +1 -1
- package/node_modules/@oozcitak/infra/package.json +41 -54
- package/node_modules/@oozcitak/url/LICENSE +21 -21
- package/node_modules/@oozcitak/url/README.md +25 -27
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.d.ts +3 -3
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.js +287 -460
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.js.map +1 -1
- package/node_modules/@oozcitak/url/lib/URLImpl.js +285 -331
- package/node_modules/@oozcitak/url/lib/URLImpl.js.map +1 -1
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.d.ts +1 -1
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js +71 -190
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js.map +1 -1
- package/node_modules/@oozcitak/url/lib/index.js +3 -2
- package/node_modules/@oozcitak/url/lib/index.js.map +1 -1
- package/node_modules/@oozcitak/url/lib/interfaces.d.ts +2 -2
- package/node_modules/@oozcitak/url/lib/interfaces.js +2 -1
- package/node_modules/@oozcitak/url/lib/interfaces.js.map +1 -1
- package/node_modules/@oozcitak/url/package.json +42 -55
- package/node_modules/@oozcitak/util/LICENSE +21 -21
- package/node_modules/@oozcitak/util/README.md +8 -10
- package/node_modules/@oozcitak/util/lib/CompareCache.js +12 -12
- package/node_modules/@oozcitak/util/lib/CompareCache.js.map +1 -1
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.d.ts +6 -6
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.js +42 -117
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.js.map +1 -1
- package/node_modules/@oozcitak/util/lib/Lazy.js +17 -19
- package/node_modules/@oozcitak/util/lib/Lazy.js.map +1 -1
- package/node_modules/@oozcitak/util/lib/ObjectCache.d.ts +4 -4
- package/node_modules/@oozcitak/util/lib/ObjectCache.js +44 -118
- package/node_modules/@oozcitak/util/lib/ObjectCache.js.map +1 -1
- package/node_modules/@oozcitak/util/lib/StringWalker.js +41 -47
- package/node_modules/@oozcitak/util/lib/StringWalker.js.map +1 -1
- package/node_modules/@oozcitak/util/lib/index.d.ts +23 -25
- package/node_modules/@oozcitak/util/lib/index.js +62 -88
- package/node_modules/@oozcitak/util/lib/index.js.map +1 -1
- package/node_modules/@oozcitak/util/package.json +37 -50
- package/node_modules/argparse/LICENSE +254 -0
- package/node_modules/argparse/README.md +84 -0
- package/node_modules/argparse/argparse.js +3707 -0
- package/node_modules/argparse/lib/sub.js +67 -0
- package/node_modules/argparse/lib/textwrap.js +440 -0
- package/node_modules/argparse/package.json +31 -0
- package/node_modules/{xmlbuilder2/node_modules/js-yaml → js-yaml}/README.md +36 -88
- package/node_modules/{xmlbuilder2/node_modules/js-yaml → js-yaml}/bin/js-yaml.js +17 -23
- package/node_modules/js-yaml/dist/js-yaml.js +3880 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/dist/js-yaml.js → js-yaml/dist/js-yaml.mjs} +2926 -3075
- package/node_modules/js-yaml/index.js +47 -0
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/dumper.js +205 -90
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/exception.js +22 -10
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/loader.js +149 -76
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/schema/core.js +1 -8
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js → js-yaml/lib/schema/default.js} +1 -7
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/schema/json.js +1 -7
- package/node_modules/js-yaml/lib/schema.js +121 -0
- package/node_modules/js-yaml/lib/snippet.js +101 -0
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/binary.js +4 -17
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/float.js +2 -21
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/int.js +18 -35
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/null.js +2 -1
- package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type.js +14 -9
- package/node_modules/js-yaml/package.json +66 -0
- package/node_modules/xmlbuilder2/README.md +8 -7
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js +36 -37
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js +3 -3
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.d.ts +0 -1
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js +235 -333
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js +271 -371
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/builder/dom.js +13 -13
- package/node_modules/xmlbuilder2/lib/builder/dom.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/builder/index.js +9 -8
- package/node_modules/xmlbuilder2/lib/builder/index.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/constants.js +1 -0
- package/node_modules/xmlbuilder2/lib/constants.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/index.js +7 -6
- package/node_modules/xmlbuilder2/lib/index.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/interfaces.d.ts +25 -24
- package/node_modules/xmlbuilder2/lib/interfaces.js +1 -0
- package/node_modules/xmlbuilder2/lib/interfaces.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.js +53 -56
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.js +7 -24
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js +59 -77
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.js +61 -126
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js +9 -26
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/readers/index.js +5 -4
- package/node_modules/xmlbuilder2/lib/readers/index.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.d.ts +1 -0
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js +14 -8
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js +474 -609
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js +48 -64
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js +54 -95
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.js +21 -36
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js +131 -166
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.d.ts +1 -1
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js +42 -56
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js +48 -62
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js +43 -59
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js +49 -89
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/writers/index.js +6 -5
- package/node_modules/xmlbuilder2/lib/writers/index.js.map +1 -1
- package/node_modules/xmlbuilder2/lib/xmlbuilder2.min.js +2 -8
- package/node_modules/xmlbuilder2/lib/xmlbuilder2.min.js.LICENSE.txt +10 -0
- package/node_modules/xmlbuilder2/package.json +34 -52
- package/package.json +8 -13
- package/node_modules/sprintf-js/.npmignore +0 -1
- package/node_modules/sprintf-js/LICENSE +0 -24
- package/node_modules/sprintf-js/README.md +0 -88
- package/node_modules/sprintf-js/bower.json +0 -14
- package/node_modules/sprintf-js/demo/angular.html +0 -20
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -4
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +0 -1
- package/node_modules/sprintf-js/dist/angular-sprintf.min.map +0 -1
- package/node_modules/sprintf-js/dist/sprintf.min.js +0 -4
- package/node_modules/sprintf-js/dist/sprintf.min.js.map +0 -1
- package/node_modules/sprintf-js/dist/sprintf.min.map +0 -1
- package/node_modules/sprintf-js/gruntfile.js +0 -36
- package/node_modules/sprintf-js/package.json +0 -22
- package/node_modules/sprintf-js/src/angular-sprintf.js +0 -18
- package/node_modules/sprintf-js/src/sprintf.js +0 -208
- package/node_modules/sprintf-js/test/test.js +0 -82
- package/node_modules/xmlbuilder2/node_modules/argparse/LICENSE +0 -21
- package/node_modules/xmlbuilder2/node_modules/argparse/README.md +0 -257
- package/node_modules/xmlbuilder2/node_modules/argparse/index.js +0 -3
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/append/constant.js +0 -47
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/append.js +0 -53
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/count.js +0 -40
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/help.js +0 -47
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/constant.js +0 -43
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/false.js +0 -27
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store/true.js +0 -26
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/store.js +0 -50
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/subparsers.js +0 -149
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action/version.js +0 -47
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action.js +0 -146
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/action_container.js +0 -482
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argparse.js +0 -14
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/error.js +0 -50
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/exclusive.js +0 -54
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument/group.js +0 -75
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/argument_parser.js +0 -1161
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/const.js +0 -21
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/help/added_formatters.js +0 -87
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/help/formatter.js +0 -795
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/namespace.js +0 -76
- package/node_modules/xmlbuilder2/node_modules/argparse/lib/utils.js +0 -57
- package/node_modules/xmlbuilder2/node_modules/argparse/package.json +0 -34
- package/node_modules/xmlbuilder2/node_modules/js-yaml/dist/js-yaml.min.js +0 -1
- package/node_modules/xmlbuilder2/node_modules/js-yaml/index.js +0 -7
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/mark.js +0 -76
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +0 -25
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema.js +0 -108
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/function.js +0 -93
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +0 -60
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +0 -28
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml.js +0 -39
- package/node_modules/xmlbuilder2/node_modules/js-yaml/package.json +0 -49
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml → js-yaml}/LICENSE +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/common.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/schema/failsafe.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/bool.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/map.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/merge.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/omap.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/pairs.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/seq.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/set.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/str.js +0 -0
- /package/node_modules/{xmlbuilder2/node_modules/js-yaml/lib/js-yaml → js-yaml/lib}/type/timestamp.js +0 -0
- /package/node_modules/xmlbuilder2/{LICENSE → LICENSE.txt} +0 -0
|
@@ -1,41 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
exports.setValidationErrorCallback = setValidationErrorCallback;
|
|
4
|
+
exports.newURL = newURL;
|
|
5
|
+
exports.isSpecialScheme = isSpecialScheme;
|
|
6
|
+
exports.isSpecial = isSpecial;
|
|
7
|
+
exports.defaultPort = defaultPort;
|
|
8
|
+
exports.includesCredentials = includesCredentials;
|
|
9
|
+
exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
|
|
10
|
+
exports.urlSerializer = urlSerializer;
|
|
11
|
+
exports.hostSerializer = hostSerializer;
|
|
12
|
+
exports.iPv4Serializer = iPv4Serializer;
|
|
13
|
+
exports.iPv6Serializer = iPv6Serializer;
|
|
14
|
+
exports.urlParser = urlParser;
|
|
15
|
+
exports.basicURLParser = basicURLParser;
|
|
16
|
+
exports.setTheUsername = setTheUsername;
|
|
17
|
+
exports.setThePassword = setThePassword;
|
|
18
|
+
exports.isSingleDotPathSegment = isSingleDotPathSegment;
|
|
19
|
+
exports.isDoubleDotPathSegment = isDoubleDotPathSegment;
|
|
20
|
+
exports.shorten = shorten;
|
|
21
|
+
exports.isNormalizedWindowsDriveLetter = isNormalizedWindowsDriveLetter;
|
|
22
|
+
exports.isWindowsDriveLetter = isWindowsDriveLetter;
|
|
23
|
+
exports.startsWithAWindowsDriveLetter = startsWithAWindowsDriveLetter;
|
|
24
|
+
exports.hostParser = hostParser;
|
|
25
|
+
exports.iPv4NumberParser = iPv4NumberParser;
|
|
26
|
+
exports.iPv4Parser = iPv4Parser;
|
|
27
|
+
exports.iPv6Parser = iPv6Parser;
|
|
28
|
+
exports.opaqueHostParser = opaqueHostParser;
|
|
29
|
+
exports.resolveABlobURL = resolveABlobURL;
|
|
30
|
+
exports.percentEncode = percentEncode;
|
|
31
|
+
exports.percentDecode = percentDecode;
|
|
32
|
+
exports.stringPercentDecode = stringPercentDecode;
|
|
33
|
+
exports.utf8PercentEncode = utf8PercentEncode;
|
|
34
|
+
exports.hostEquals = hostEquals;
|
|
35
|
+
exports.urlEquals = urlEquals;
|
|
36
|
+
exports.urlEncodedStringParser = urlEncodedStringParser;
|
|
37
|
+
exports.urlEncodedParser = urlEncodedParser;
|
|
38
|
+
exports.urlEncodedByteSerializer = urlEncodedByteSerializer;
|
|
39
|
+
exports.urlEncodedSerializer = urlEncodedSerializer;
|
|
40
|
+
exports.origin = origin;
|
|
41
|
+
exports.domainToASCII = domainToASCII;
|
|
42
|
+
exports.domainToUnicode = domainToUnicode;
|
|
43
|
+
exports.asciiSerializationOfAnOrigin = asciiSerializationOfAnOrigin;
|
|
44
|
+
const util_1 = require("@oozcitak/util");
|
|
45
|
+
const interfaces_1 = require("./interfaces");
|
|
46
|
+
const infra_1 = require("@oozcitak/infra");
|
|
47
|
+
const url_1 = require("url");
|
|
48
|
+
let _validationErrorCallback;
|
|
35
49
|
/**
|
|
36
50
|
* Default ports for a special URL scheme.
|
|
37
51
|
*/
|
|
38
|
-
|
|
52
|
+
const _defaultPorts = {
|
|
39
53
|
"ftp": 21,
|
|
40
54
|
"file": null,
|
|
41
55
|
"http": 80,
|
|
@@ -47,23 +61,23 @@ var _defaultPorts = {
|
|
|
47
61
|
* The C0 control percent-encode set are the C0 controls and all code points
|
|
48
62
|
* greater than U+007E (~).
|
|
49
63
|
*/
|
|
50
|
-
|
|
64
|
+
const _c0ControlPercentEncodeSet = /[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
51
65
|
/**
|
|
52
66
|
* The fragment percent-encode set is the C0 control percent-encode set and
|
|
53
67
|
* U+0020 SPACE, U+0022 ("), U+003C (<), U+003E (>), and U+0060 (`).
|
|
54
68
|
*/
|
|
55
|
-
|
|
69
|
+
const _fragmentPercentEncodeSet = /[ "<>`]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
56
70
|
/**
|
|
57
71
|
* The path percent-encode set is the fragment percent-encode set and
|
|
58
72
|
* U+0023 (#), U+003F (?), U+007B ({), and U+007D (}).
|
|
59
73
|
*/
|
|
60
|
-
|
|
74
|
+
const _pathPercentEncodeSet = /[ "<>`#?{}]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
61
75
|
/**
|
|
62
76
|
* The userinfo percent-encode set is the path percent-encode set and
|
|
63
77
|
* U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@), U+005B ([),
|
|
64
78
|
* U+005C (\), U+005D (]), U+005E (^), and U+007C (|).
|
|
65
79
|
*/
|
|
66
|
-
|
|
80
|
+
const _userInfoPercentEncodeSet = /[ "<>`#?{}/:;=@\[\]\\\^\|]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
67
81
|
/**
|
|
68
82
|
* The URL code points are ASCII alphanumeric, U+0021 (!), U+0024 ($),
|
|
69
83
|
* U+0026 (&), U+0027 ('), U+0028 LEFT PARENTHESIS, U+0029 RIGHT PARENTHESIS,
|
|
@@ -72,13 +86,13 @@ var _userInfoPercentEncodeSet = /[ "<>`#?{}/:;=@\[\]\\\^\|]|[\0-\x1F\x7F-\uD7FF\
|
|
|
72
86
|
* U+007E (~), and code points in the range U+00A0 to U+10FFFD, inclusive,
|
|
73
87
|
* excluding surrogates and noncharacters.
|
|
74
88
|
*/
|
|
75
|
-
|
|
89
|
+
const _urlCodePoints = /[0-9A-Za-z!\$&-\/:;=\?@_~\xA0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uD83E\uD840-\uD87E\uD880-\uD8BE\uD8C0-\uD8FE\uD900-\uD93E\uD940-\uD97E\uD980-\uD9BE\uD9C0-\uD9FE\uDA00-\uDA3E\uDA40-\uDA7E\uDA80-\uDABE\uDAC0-\uDAFE\uDB00-\uDB3E\uDB40-\uDB7E\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDC00-\uDFFD]/;
|
|
76
90
|
/**
|
|
77
91
|
* A forbidden host code point is U+0000 NULL, U+0009 TAB, U+000A LF,
|
|
78
92
|
* U+000D CR, U+0020 SPACE, U+0023 (#), U+0025 (%), U+002F (/), U+003A (:),
|
|
79
93
|
* U+003F (?), U+0040 (@), U+005B ([), U+005C (\), or U+005D (]).
|
|
80
94
|
*/
|
|
81
|
-
|
|
95
|
+
const _forbiddenHostCodePoint = /[\0\t\f\r #%/:?@\[\\\]]/;
|
|
82
96
|
/**
|
|
83
97
|
* Sets the callback function for validation errors.
|
|
84
98
|
*
|
|
@@ -88,7 +102,6 @@ var _forbiddenHostCodePoint = /[\0\t\f\r #%/:?@\[\\\]]/;
|
|
|
88
102
|
function setValidationErrorCallback(validationErrorCallback) {
|
|
89
103
|
_validationErrorCallback = validationErrorCallback;
|
|
90
104
|
}
|
|
91
|
-
exports.setValidationErrorCallback = setValidationErrorCallback;
|
|
92
105
|
/**
|
|
93
106
|
* Generates a validation error.
|
|
94
107
|
*
|
|
@@ -116,7 +129,6 @@ function newURL() {
|
|
|
116
129
|
_blobURLEntry: null
|
|
117
130
|
};
|
|
118
131
|
}
|
|
119
|
-
exports.newURL = newURL;
|
|
120
132
|
/**
|
|
121
133
|
* Determines if the scheme is a special scheme.
|
|
122
134
|
*
|
|
@@ -125,7 +137,6 @@ exports.newURL = newURL;
|
|
|
125
137
|
function isSpecialScheme(scheme) {
|
|
126
138
|
return (scheme in _defaultPorts);
|
|
127
139
|
}
|
|
128
|
-
exports.isSpecialScheme = isSpecialScheme;
|
|
129
140
|
/**
|
|
130
141
|
* Determines if the URL has a special scheme.
|
|
131
142
|
*
|
|
@@ -134,7 +145,6 @@ exports.isSpecialScheme = isSpecialScheme;
|
|
|
134
145
|
function isSpecial(url) {
|
|
135
146
|
return isSpecialScheme(url.scheme);
|
|
136
147
|
}
|
|
137
|
-
exports.isSpecial = isSpecial;
|
|
138
148
|
/**
|
|
139
149
|
* Returns the default port for a special scheme.
|
|
140
150
|
*
|
|
@@ -143,7 +153,6 @@ exports.isSpecial = isSpecial;
|
|
|
143
153
|
function defaultPort(scheme) {
|
|
144
154
|
return _defaultPorts[scheme] || null;
|
|
145
155
|
}
|
|
146
|
-
exports.defaultPort = defaultPort;
|
|
147
156
|
/**
|
|
148
157
|
* Determines if the URL has credentials.
|
|
149
158
|
*
|
|
@@ -152,7 +161,6 @@ exports.defaultPort = defaultPort;
|
|
|
152
161
|
function includesCredentials(url) {
|
|
153
162
|
return url.username !== '' || url.password !== '';
|
|
154
163
|
}
|
|
155
|
-
exports.includesCredentials = includesCredentials;
|
|
156
164
|
/**
|
|
157
165
|
* Determines if an URL cannot have credentials.
|
|
158
166
|
*
|
|
@@ -167,19 +175,16 @@ function cannotHaveAUsernamePasswordPort(url) {
|
|
|
167
175
|
return (url.host === null || url.host === "" || url._cannotBeABaseURLFlag ||
|
|
168
176
|
url.scheme === "file");
|
|
169
177
|
}
|
|
170
|
-
exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
|
|
171
178
|
/**
|
|
172
179
|
* Serializes an URL into a string.
|
|
173
180
|
*
|
|
174
181
|
* @param url - an URL
|
|
175
182
|
*/
|
|
176
|
-
function urlSerializer(url, excludeFragmentFlag) {
|
|
177
|
-
var e_1, _a;
|
|
178
|
-
if (excludeFragmentFlag === void 0) { excludeFragmentFlag = false; }
|
|
183
|
+
function urlSerializer(url, excludeFragmentFlag = false) {
|
|
179
184
|
/**
|
|
180
185
|
* 1. Let output be url’s scheme and U+003A (:) concatenated.
|
|
181
186
|
*/
|
|
182
|
-
|
|
187
|
+
let output = url.scheme + ':';
|
|
183
188
|
/**
|
|
184
189
|
* 2. If url’s host is non-null:
|
|
185
190
|
*/
|
|
@@ -230,18 +235,8 @@ function urlSerializer(url, excludeFragmentFlag) {
|
|
|
230
235
|
output += url.path[0];
|
|
231
236
|
}
|
|
232
237
|
else {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
var str = _c.value;
|
|
236
|
-
output += '/' + str;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
240
|
-
finally {
|
|
241
|
-
try {
|
|
242
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
243
|
-
}
|
|
244
|
-
finally { if (e_1) throw e_1.error; }
|
|
238
|
+
for (const str of url.path) {
|
|
239
|
+
output += '/' + str;
|
|
245
240
|
}
|
|
246
241
|
}
|
|
247
242
|
/**
|
|
@@ -259,7 +254,6 @@ function urlSerializer(url, excludeFragmentFlag) {
|
|
|
259
254
|
}
|
|
260
255
|
return output;
|
|
261
256
|
}
|
|
262
|
-
exports.urlSerializer = urlSerializer;
|
|
263
257
|
/**
|
|
264
258
|
* Serializes a host into a string.
|
|
265
259
|
*
|
|
@@ -274,17 +268,16 @@ function hostSerializer(host) {
|
|
|
274
268
|
* U+005D (]).
|
|
275
269
|
* 3. Otherwise, host is a domain, opaque host, or empty host, return host.
|
|
276
270
|
*/
|
|
277
|
-
if (util_1.isNumber(host)) {
|
|
271
|
+
if ((0, util_1.isNumber)(host)) {
|
|
278
272
|
return iPv4Serializer(host);
|
|
279
273
|
}
|
|
280
|
-
else if (util_1.isArray(host)) {
|
|
274
|
+
else if ((0, util_1.isArray)(host)) {
|
|
281
275
|
return '[' + iPv6Serializer(host) + ']';
|
|
282
276
|
}
|
|
283
277
|
else {
|
|
284
278
|
return host;
|
|
285
279
|
}
|
|
286
280
|
}
|
|
287
|
-
exports.hostSerializer = hostSerializer;
|
|
288
281
|
/**
|
|
289
282
|
* Serializes an IPv4 address into a string.
|
|
290
283
|
*
|
|
@@ -300,9 +293,9 @@ function iPv4Serializer(address) {
|
|
|
300
293
|
* 3.3. Set n to floor(n / 256).
|
|
301
294
|
* 4. Return output.
|
|
302
295
|
*/
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
for (
|
|
296
|
+
let output = "";
|
|
297
|
+
let n = address;
|
|
298
|
+
for (let i = 1; i <= 4; i++) {
|
|
306
299
|
output = (n % 256).toString() + output;
|
|
307
300
|
if (i !== 4) {
|
|
308
301
|
output = '.' + output;
|
|
@@ -311,7 +304,6 @@ function iPv4Serializer(address) {
|
|
|
311
304
|
}
|
|
312
305
|
return output;
|
|
313
306
|
}
|
|
314
|
-
exports.iPv4Serializer = iPv4Serializer;
|
|
315
307
|
/**
|
|
316
308
|
* Serializes an IPv6 address into a string.
|
|
317
309
|
*
|
|
@@ -326,16 +318,16 @@ function iPv6Serializer(address) {
|
|
|
326
318
|
* 3. If there is no sequence of address’s IPv6 pieces that are 0 that is
|
|
327
319
|
* longer than 1, then set compress to null.
|
|
328
320
|
*/
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
for (
|
|
321
|
+
let output = "";
|
|
322
|
+
let compress = null;
|
|
323
|
+
let lastIndex = -1;
|
|
324
|
+
let count = 0;
|
|
325
|
+
let lastCount = 0;
|
|
326
|
+
for (let i = 0; i < 8; i++) {
|
|
335
327
|
if (address[i] !== 0)
|
|
336
328
|
continue;
|
|
337
329
|
count = 1;
|
|
338
|
-
for (
|
|
330
|
+
for (let j = i + 1; j < 8; j++) {
|
|
339
331
|
if (address[j] !== 0)
|
|
340
332
|
break;
|
|
341
333
|
count++;
|
|
@@ -352,8 +344,8 @@ function iPv6Serializer(address) {
|
|
|
352
344
|
* 4. Let ignore0 be false.
|
|
353
345
|
* 5. For each pieceIndex in the range 0 to 7, inclusive:
|
|
354
346
|
*/
|
|
355
|
-
|
|
356
|
-
for (
|
|
347
|
+
let ignore0 = false;
|
|
348
|
+
for (let pieceIndex = 0; pieceIndex < 8; pieceIndex++) {
|
|
357
349
|
/**
|
|
358
350
|
* 5.1. If ignore0 is true and address[pieceIndex] is 0, then continue.
|
|
359
351
|
* 5.2. Otherwise, if ignore0 is true, set ignore0 to false.
|
|
@@ -387,7 +379,6 @@ function iPv6Serializer(address) {
|
|
|
387
379
|
*/
|
|
388
380
|
return output;
|
|
389
381
|
}
|
|
390
|
-
exports.iPv6Serializer = iPv6Serializer;
|
|
391
382
|
/**
|
|
392
383
|
* Parses an URL string.
|
|
393
384
|
*
|
|
@@ -405,12 +396,12 @@ function urlParser(input, baseURL, encodingOverride) {
|
|
|
405
396
|
* if that did not return failure, and null otherwise.
|
|
406
397
|
* 5. Return url.
|
|
407
398
|
*/
|
|
408
|
-
|
|
399
|
+
const url = basicURLParser(input, baseURL, encodingOverride);
|
|
409
400
|
if (url === null)
|
|
410
401
|
return null;
|
|
411
402
|
if (url.scheme !== "blob")
|
|
412
403
|
return url;
|
|
413
|
-
|
|
404
|
+
const entry = resolveABlobURL(url);
|
|
414
405
|
if (entry !== null) {
|
|
415
406
|
url._blobURLEntry = entry;
|
|
416
407
|
}
|
|
@@ -419,7 +410,6 @@ function urlParser(input, baseURL, encodingOverride) {
|
|
|
419
410
|
}
|
|
420
411
|
return url;
|
|
421
412
|
}
|
|
422
|
-
exports.urlParser = urlParser;
|
|
423
413
|
/**
|
|
424
414
|
* Parses an URL string.
|
|
425
415
|
*
|
|
@@ -428,7 +418,6 @@ exports.urlParser = urlParser;
|
|
|
428
418
|
* @param encodingOverride - encoding override
|
|
429
419
|
*/
|
|
430
420
|
function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
431
|
-
var e_2, _a, e_3, _b;
|
|
432
421
|
/**
|
|
433
422
|
* 1. If url is not given:
|
|
434
423
|
* 1.1. Set url to a new URL.
|
|
@@ -439,8 +428,8 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
439
428
|
if (url === undefined) {
|
|
440
429
|
url = newURL();
|
|
441
430
|
// leading
|
|
442
|
-
|
|
443
|
-
|
|
431
|
+
const leadingControlOrSpace = /^[\u0000-\u001F\u0020]+/;
|
|
432
|
+
const trailingControlOrSpace = /[\u0000-\u001F\u0020]+$/;
|
|
444
433
|
if (leadingControlOrSpace.test(input) || trailingControlOrSpace.test(input)) {
|
|
445
434
|
validationError("Input string contains leading or trailing control characters or space.");
|
|
446
435
|
}
|
|
@@ -451,7 +440,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
451
440
|
* 2. If input contains any ASCII tab or newline, validation error.
|
|
452
441
|
* 3. Remove all ASCII tab or newline from input.
|
|
453
442
|
*/
|
|
454
|
-
|
|
443
|
+
const tabOrNewline = /[\u0009\u000A\u000D]/g;
|
|
455
444
|
if (tabOrNewline.test(input)) {
|
|
456
445
|
validationError("Input string contains tab or newline characters.");
|
|
457
446
|
}
|
|
@@ -463,10 +452,10 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
463
452
|
* 7. If encoding override is given, set encoding to the result of getting
|
|
464
453
|
* an output encoding from encoding override.
|
|
465
454
|
*/
|
|
466
|
-
|
|
455
|
+
let state = (stateOverride === undefined ? interfaces_1.ParserState.SchemeStart : stateOverride);
|
|
467
456
|
if (baseURL === undefined)
|
|
468
457
|
baseURL = null;
|
|
469
|
-
|
|
458
|
+
let encoding = (encodingOverride === undefined ||
|
|
470
459
|
encodingOverride === "replacement" || encodingOverride === "UTF-16BE" ||
|
|
471
460
|
encodingOverride === "UTF-16LE" ? "UTF-8" : encodingOverride);
|
|
472
461
|
/**
|
|
@@ -474,12 +463,12 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
474
463
|
* 9. Let the @ flag, [] flag, and passwordTokenSeenFlag be unset.
|
|
475
464
|
* 10. Let pointer be a pointer to first code point in input.
|
|
476
465
|
*/
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
466
|
+
let buffer = "";
|
|
467
|
+
let atFlag = false;
|
|
468
|
+
let arrayFlag = false;
|
|
469
|
+
let passwordTokenSeenFlag = false;
|
|
470
|
+
const EOF = "";
|
|
471
|
+
const walker = new util_1.StringWalker(input);
|
|
483
472
|
/**
|
|
484
473
|
* 11. Keep running the following state machine by switching on state. If
|
|
485
474
|
* after a run pointer points to the EOF code point, go to the next step.
|
|
@@ -857,37 +846,27 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
857
846
|
if (atFlag)
|
|
858
847
|
buffer = '%40' + buffer;
|
|
859
848
|
atFlag = true;
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
passwordTokenSeenFlag = true;
|
|
874
|
-
continue;
|
|
875
|
-
}
|
|
876
|
-
var encodedCodePoints = utf8PercentEncode(codePoint, _userInfoPercentEncodeSet);
|
|
877
|
-
if (passwordTokenSeenFlag) {
|
|
878
|
-
url.password += encodedCodePoints;
|
|
879
|
-
}
|
|
880
|
-
else {
|
|
881
|
-
url.username += encodedCodePoints;
|
|
882
|
-
}
|
|
849
|
+
for (const codePoint of buffer) {
|
|
850
|
+
/**
|
|
851
|
+
* 1.4.1. If codePoint is U+003A (:) and passwordTokenSeenFlag is
|
|
852
|
+
* unset, then set passwordTokenSeenFlag and continue.
|
|
853
|
+
* 1.4.2. Let encodedCodePoints be the result of running UTF-8
|
|
854
|
+
* percent encode codePoint using the userinfo percent-encode set.
|
|
855
|
+
* 1.4.3. If passwordTokenSeenFlag is set, then append
|
|
856
|
+
* encodedCodePoints to url’s password.
|
|
857
|
+
* 1.4.4. Otherwise, append encodedCodePoints to url’s username.
|
|
858
|
+
*/
|
|
859
|
+
if (codePoint === ':' && !passwordTokenSeenFlag) {
|
|
860
|
+
passwordTokenSeenFlag = true;
|
|
861
|
+
continue;
|
|
883
862
|
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
863
|
+
const encodedCodePoints = utf8PercentEncode(codePoint, _userInfoPercentEncodeSet);
|
|
864
|
+
if (passwordTokenSeenFlag) {
|
|
865
|
+
url.password += encodedCodePoints;
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
url.username += encodedCodePoints;
|
|
889
869
|
}
|
|
890
|
-
finally { if (e_2) throw e_2.error; }
|
|
891
870
|
}
|
|
892
871
|
/**
|
|
893
872
|
* 1.5. Set buffer to the empty string.
|
|
@@ -948,7 +927,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
948
927
|
validationError("Invalid input string.");
|
|
949
928
|
return null;
|
|
950
929
|
}
|
|
951
|
-
|
|
930
|
+
const host = hostParser(buffer, !isSpecial(url));
|
|
952
931
|
if (host === null)
|
|
953
932
|
return null;
|
|
954
933
|
url.host = host;
|
|
@@ -986,7 +965,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
986
965
|
validationError("Invalid input string.");
|
|
987
966
|
return url;
|
|
988
967
|
}
|
|
989
|
-
|
|
968
|
+
const host = hostParser(buffer, !isSpecial(url));
|
|
990
969
|
if (host === null)
|
|
991
970
|
return null;
|
|
992
971
|
url.host = host;
|
|
@@ -1038,7 +1017,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
1038
1017
|
* 2.1.4. Set buffer to the empty string.
|
|
1039
1018
|
*/
|
|
1040
1019
|
if (buffer !== "") {
|
|
1041
|
-
|
|
1020
|
+
const port = parseInt(buffer, 10);
|
|
1042
1021
|
if (port > Math.pow(2, 16) - 1) {
|
|
1043
1022
|
validationError("Invalid port number.");
|
|
1044
1023
|
return null;
|
|
@@ -1234,7 +1213,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
1234
1213
|
* 1.3.6. Set buffer to the empty string and state to path start
|
|
1235
1214
|
* state.
|
|
1236
1215
|
*/
|
|
1237
|
-
|
|
1216
|
+
let host = hostParser(buffer, !isSpecial(url));
|
|
1238
1217
|
if (host === null)
|
|
1239
1218
|
return null;
|
|
1240
1219
|
if (host === "localhost")
|
|
@@ -1352,7 +1331,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
1352
1331
|
validationError("Invalid input string.");
|
|
1353
1332
|
url.host = "";
|
|
1354
1333
|
}
|
|
1355
|
-
|
|
1334
|
+
const bufferCodePoints = Array.from(buffer);
|
|
1356
1335
|
buffer = bufferCodePoints.slice(0, 1) + ':' + bufferCodePoints.slice(2);
|
|
1357
1336
|
}
|
|
1358
1337
|
/**
|
|
@@ -1486,7 +1465,7 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
1486
1465
|
if (encoding.toUpperCase() !== "UTF-8") {
|
|
1487
1466
|
throw new Error("Only UTF-8 encoding is supported.");
|
|
1488
1467
|
}
|
|
1489
|
-
|
|
1468
|
+
let bytes = (0, util_1.utf8Encode)(walker.c());
|
|
1490
1469
|
/**
|
|
1491
1470
|
* 3.4. If bytes starts with `&#` and ends with 0x3B (;), then:
|
|
1492
1471
|
*/
|
|
@@ -1503,36 +1482,26 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
1503
1482
|
url.query += "%26%23" + infra_1.byteSequence.isomorphicDecode(bytes) + "%3B";
|
|
1504
1483
|
}
|
|
1505
1484
|
else {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
(byte === 0x27 && isSpecial(url))) {
|
|
1523
|
-
url.query += percentEncode(byte);
|
|
1524
|
-
}
|
|
1525
|
-
else {
|
|
1526
|
-
url.query += String.fromCharCode(byte);
|
|
1527
|
-
}
|
|
1485
|
+
/**
|
|
1486
|
+
* 3.5. Otherwise, for each byte in bytes:
|
|
1487
|
+
* 3.5.1. If one of the following is true
|
|
1488
|
+
* - byte is less than 0x21 (!)
|
|
1489
|
+
* - byte is greater than 0x7E (~)
|
|
1490
|
+
* - byte is 0x22 ("), 0x23 (#), 0x3C (<), or 0x3E (>)
|
|
1491
|
+
* - byte is 0x27 (') and url is special
|
|
1492
|
+
* then append byte, percent encoded, to url’s query.
|
|
1493
|
+
* 3.5.2. Otherwise, append a code point whose value is byte to
|
|
1494
|
+
* url’s query.
|
|
1495
|
+
*/
|
|
1496
|
+
for (const byte of bytes) {
|
|
1497
|
+
if (byte < 0x21 || byte > 0x7E || byte === 0x22 ||
|
|
1498
|
+
byte === 0x23 || byte === 0x3C || byte === 0x3E ||
|
|
1499
|
+
(byte === 0x27 && isSpecial(url))) {
|
|
1500
|
+
url.query += percentEncode(byte);
|
|
1528
1501
|
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
finally {
|
|
1532
|
-
try {
|
|
1533
|
-
if (bytes_1_1 && !bytes_1_1.done && (_b = bytes_1.return)) _b.call(bytes_1);
|
|
1502
|
+
else {
|
|
1503
|
+
url.query += String.fromCharCode(byte);
|
|
1534
1504
|
}
|
|
1535
|
-
finally { if (e_3) throw e_3.error; }
|
|
1536
1505
|
}
|
|
1537
1506
|
}
|
|
1538
1507
|
}
|
|
@@ -1579,7 +1548,6 @@ function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
|
1579
1548
|
*/
|
|
1580
1549
|
return url;
|
|
1581
1550
|
}
|
|
1582
|
-
exports.basicURLParser = basicURLParser;
|
|
1583
1551
|
/**
|
|
1584
1552
|
* Sets a URL's username.
|
|
1585
1553
|
*
|
|
@@ -1587,29 +1555,17 @@ exports.basicURLParser = basicURLParser;
|
|
|
1587
1555
|
* @param username - username string
|
|
1588
1556
|
*/
|
|
1589
1557
|
function setTheUsername(url, username) {
|
|
1590
|
-
var e_4, _a;
|
|
1591
1558
|
/**
|
|
1592
1559
|
* 1. Set url’s username to the empty string.
|
|
1593
1560
|
* 2. For each code point in username, UTF-8 percent encode it using the
|
|
1594
1561
|
* userinfo percent-encode set, and append the result to url’s username.
|
|
1595
1562
|
*/
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
var codePoint = username_1_1.value;
|
|
1600
|
-
result += utf8PercentEncode(codePoint, _userInfoPercentEncodeSet);
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1604
|
-
finally {
|
|
1605
|
-
try {
|
|
1606
|
-
if (username_1_1 && !username_1_1.done && (_a = username_1.return)) _a.call(username_1);
|
|
1607
|
-
}
|
|
1608
|
-
finally { if (e_4) throw e_4.error; }
|
|
1563
|
+
let result = "";
|
|
1564
|
+
for (const codePoint of username) {
|
|
1565
|
+
result += utf8PercentEncode(codePoint, _userInfoPercentEncodeSet);
|
|
1609
1566
|
}
|
|
1610
1567
|
url.username = result;
|
|
1611
1568
|
}
|
|
1612
|
-
exports.setTheUsername = setTheUsername;
|
|
1613
1569
|
/**
|
|
1614
1570
|
* Sets a URL's password.
|
|
1615
1571
|
*
|
|
@@ -1617,29 +1573,17 @@ exports.setTheUsername = setTheUsername;
|
|
|
1617
1573
|
* @param username - password string
|
|
1618
1574
|
*/
|
|
1619
1575
|
function setThePassword(url, password) {
|
|
1620
|
-
var e_5, _a;
|
|
1621
1576
|
/**
|
|
1622
1577
|
* 1. Set url’s password to the empty string.
|
|
1623
1578
|
* 2. For each code point in password, UTF-8 percent encode it using the
|
|
1624
1579
|
* userinfo percent-encode set, and append the result to url’s password.
|
|
1625
1580
|
*/
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
var codePoint = password_1_1.value;
|
|
1630
|
-
result += utf8PercentEncode(codePoint, _userInfoPercentEncodeSet);
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1634
|
-
finally {
|
|
1635
|
-
try {
|
|
1636
|
-
if (password_1_1 && !password_1_1.done && (_a = password_1.return)) _a.call(password_1);
|
|
1637
|
-
}
|
|
1638
|
-
finally { if (e_5) throw e_5.error; }
|
|
1581
|
+
let result = "";
|
|
1582
|
+
for (const codePoint of password) {
|
|
1583
|
+
result += utf8PercentEncode(codePoint, _userInfoPercentEncodeSet);
|
|
1639
1584
|
}
|
|
1640
1585
|
url.password = result;
|
|
1641
1586
|
}
|
|
1642
|
-
exports.setThePassword = setThePassword;
|
|
1643
1587
|
/**
|
|
1644
1588
|
* Determines if the string represents a single dot path.
|
|
1645
1589
|
*
|
|
@@ -1648,18 +1592,16 @@ exports.setThePassword = setThePassword;
|
|
|
1648
1592
|
function isSingleDotPathSegment(str) {
|
|
1649
1593
|
return str === '.' || str.toLowerCase() === "%2e";
|
|
1650
1594
|
}
|
|
1651
|
-
exports.isSingleDotPathSegment = isSingleDotPathSegment;
|
|
1652
1595
|
/**
|
|
1653
1596
|
* Determines if the string represents a double dot path.
|
|
1654
1597
|
*
|
|
1655
1598
|
* @param str - a string
|
|
1656
1599
|
*/
|
|
1657
1600
|
function isDoubleDotPathSegment(str) {
|
|
1658
|
-
|
|
1601
|
+
const lowerStr = str.toLowerCase();
|
|
1659
1602
|
return lowerStr === ".." || lowerStr === ".%2e" ||
|
|
1660
1603
|
lowerStr === "%2e." || lowerStr === "%2e%2e";
|
|
1661
1604
|
}
|
|
1662
|
-
exports.isDoubleDotPathSegment = isDoubleDotPathSegment;
|
|
1663
1605
|
/**
|
|
1664
1606
|
* Shorten's URL's path.
|
|
1665
1607
|
*
|
|
@@ -1673,7 +1615,7 @@ function shorten(url) {
|
|
|
1673
1615
|
* normalized Windows drive letter, then return.
|
|
1674
1616
|
* 4. Remove path’s last item.
|
|
1675
1617
|
*/
|
|
1676
|
-
|
|
1618
|
+
const path = url.path;
|
|
1677
1619
|
if (path.length === 0)
|
|
1678
1620
|
return;
|
|
1679
1621
|
if (url.scheme === "file" && path.length === 1 &&
|
|
@@ -1681,7 +1623,6 @@ function shorten(url) {
|
|
|
1681
1623
|
return;
|
|
1682
1624
|
url.path.splice(url.path.length - 1, 1);
|
|
1683
1625
|
}
|
|
1684
|
-
exports.shorten = shorten;
|
|
1685
1626
|
/**
|
|
1686
1627
|
* Determines if a string is a normalized Windows drive letter.
|
|
1687
1628
|
*
|
|
@@ -1695,7 +1636,6 @@ function isNormalizedWindowsDriveLetter(str) {
|
|
|
1695
1636
|
return str.length >= 2 && infra_1.codePoint.ASCIIAlpha.test(str[0]) &&
|
|
1696
1637
|
str[1] === ':';
|
|
1697
1638
|
}
|
|
1698
|
-
exports.isNormalizedWindowsDriveLetter = isNormalizedWindowsDriveLetter;
|
|
1699
1639
|
/**
|
|
1700
1640
|
* Determines if a string is a Windows drive letter.
|
|
1701
1641
|
*
|
|
@@ -1709,7 +1649,6 @@ function isWindowsDriveLetter(str) {
|
|
|
1709
1649
|
return str.length >= 2 && infra_1.codePoint.ASCIIAlpha.test(str[0]) &&
|
|
1710
1650
|
(str[1] === ':' || str[1] === '|');
|
|
1711
1651
|
}
|
|
1712
|
-
exports.isWindowsDriveLetter = isWindowsDriveLetter;
|
|
1713
1652
|
/**
|
|
1714
1653
|
* Determines if a string starts with a Windows drive letter.
|
|
1715
1654
|
*
|
|
@@ -1728,7 +1667,6 @@ function startsWithAWindowsDriveLetter(str) {
|
|
|
1728
1667
|
(str.length === 2 || (str[2] === '/' || str[2] === '\\' ||
|
|
1729
1668
|
str[2] === '?' || str[2] === '#'));
|
|
1730
1669
|
}
|
|
1731
|
-
exports.startsWithAWindowsDriveLetter = startsWithAWindowsDriveLetter;
|
|
1732
1670
|
/**
|
|
1733
1671
|
* Parses a host string.
|
|
1734
1672
|
*
|
|
@@ -1736,8 +1674,7 @@ exports.startsWithAWindowsDriveLetter = startsWithAWindowsDriveLetter;
|
|
|
1736
1674
|
* @param isNotSpecial - `true` if the source URL is not special; otherwise
|
|
1737
1675
|
* `false`.
|
|
1738
1676
|
*/
|
|
1739
|
-
function hostParser(input, isNotSpecial) {
|
|
1740
|
-
if (isNotSpecial === void 0) { isNotSpecial = false; }
|
|
1677
|
+
function hostParser(input, isNotSpecial = false) {
|
|
1741
1678
|
/**
|
|
1742
1679
|
* 1. If isNotSpecial is not given, then set isNotSpecial to false.
|
|
1743
1680
|
* 2. If input starts with U+005B ([), then:
|
|
@@ -1767,14 +1704,14 @@ function hostParser(input, isNotSpecial) {
|
|
|
1767
1704
|
* coupled with an early return for failure, as domain to ASCII fails
|
|
1768
1705
|
* on U+FFFD REPLACEMENT CHARACTER.
|
|
1769
1706
|
*/
|
|
1770
|
-
|
|
1707
|
+
const domain = (0, util_1.utf8Decode)(stringPercentDecode(input));
|
|
1771
1708
|
/**
|
|
1772
1709
|
* 5. Let asciiDomain be the result of running domain to ASCII on domain.
|
|
1773
1710
|
* 6. If asciiDomain is failure, validation error, return failure.
|
|
1774
1711
|
* 7. If asciiDomain contains a forbidden host code point, validation error,
|
|
1775
1712
|
* return failure.
|
|
1776
1713
|
*/
|
|
1777
|
-
|
|
1714
|
+
const asciiDomain = domainToASCII(domain);
|
|
1778
1715
|
if (asciiDomain === null) {
|
|
1779
1716
|
validationError("Invalid domain.");
|
|
1780
1717
|
return null;
|
|
@@ -1788,12 +1725,11 @@ function hostParser(input, isNotSpecial) {
|
|
|
1788
1725
|
* 9. If ipv4Host is an IPv4 address or failure, return ipv4Host.
|
|
1789
1726
|
* 10. Return asciiDomain.
|
|
1790
1727
|
*/
|
|
1791
|
-
|
|
1792
|
-
if (ipv4Host === null || util_1.isNumber(ipv4Host))
|
|
1728
|
+
const ipv4Host = iPv4Parser(asciiDomain);
|
|
1729
|
+
if (ipv4Host === null || (0, util_1.isNumber)(ipv4Host))
|
|
1793
1730
|
return ipv4Host;
|
|
1794
1731
|
return asciiDomain;
|
|
1795
1732
|
}
|
|
1796
|
-
exports.hostParser = hostParser;
|
|
1797
1733
|
/**
|
|
1798
1734
|
* Parses a string containing an IP v4 address.
|
|
1799
1735
|
*
|
|
@@ -1801,12 +1737,11 @@ exports.hostParser = hostParser;
|
|
|
1801
1737
|
* @param isNotSpecial - `true` if the source URL is not special; otherwise
|
|
1802
1738
|
* `false`.
|
|
1803
1739
|
*/
|
|
1804
|
-
function iPv4NumberParser(input, validationErrorFlag) {
|
|
1805
|
-
if (validationErrorFlag === void 0) { validationErrorFlag = { value: false }; }
|
|
1740
|
+
function iPv4NumberParser(input, validationErrorFlag = { value: false }) {
|
|
1806
1741
|
/**
|
|
1807
1742
|
* 1. Let R be 10.
|
|
1808
1743
|
*/
|
|
1809
|
-
|
|
1744
|
+
let R = 10;
|
|
1810
1745
|
if (input.startsWith("0x") || input.startsWith("0X")) {
|
|
1811
1746
|
/**
|
|
1812
1747
|
* 2. If input contains at least two code points and the first two code
|
|
@@ -1838,7 +1773,7 @@ function iPv4NumberParser(input, validationErrorFlag) {
|
|
|
1838
1773
|
*/
|
|
1839
1774
|
if (input === "")
|
|
1840
1775
|
return 0;
|
|
1841
|
-
|
|
1776
|
+
const radixRDigits = (R === 10 ? /^[0-9]+$/ : (R === 16 ? /^[0-9A-Fa-f]+$/ : /^[0-7]+$/));
|
|
1842
1777
|
if (!radixRDigits.test(input))
|
|
1843
1778
|
return null;
|
|
1844
1779
|
/**
|
|
@@ -1848,20 +1783,18 @@ function iPv4NumberParser(input, validationErrorFlag) {
|
|
|
1848
1783
|
*/
|
|
1849
1784
|
return parseInt(input, R);
|
|
1850
1785
|
}
|
|
1851
|
-
exports.iPv4NumberParser = iPv4NumberParser;
|
|
1852
1786
|
/**
|
|
1853
1787
|
* Parses a string containing an IP v4 address.
|
|
1854
1788
|
*
|
|
1855
1789
|
* @param input - input string
|
|
1856
1790
|
*/
|
|
1857
1791
|
function iPv4Parser(input) {
|
|
1858
|
-
var e_6, _a, e_7, _b;
|
|
1859
1792
|
/**
|
|
1860
1793
|
* 1. Let validationErrorFlag be unset.
|
|
1861
1794
|
* 2. Let parts be input split on U+002E (.).
|
|
1862
1795
|
*/
|
|
1863
|
-
|
|
1864
|
-
|
|
1796
|
+
const validationErrorFlag = { value: false };
|
|
1797
|
+
const parts = input.split('.');
|
|
1865
1798
|
/**
|
|
1866
1799
|
* 3. If the last item in parts is the empty string, then:
|
|
1867
1800
|
* 3.1. Set validationErrorFlag.
|
|
@@ -1886,24 +1819,14 @@ function iPv4Parser(input) {
|
|
|
1886
1819
|
* 6.3. If n is failure, return input.
|
|
1887
1820
|
* 6.4. Append n to numbers.
|
|
1888
1821
|
*/
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
return input;
|
|
1898
|
-
numbers.push(n);
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1902
|
-
finally {
|
|
1903
|
-
try {
|
|
1904
|
-
if (parts_1_1 && !parts_1_1.done && (_a = parts_1.return)) _a.call(parts_1);
|
|
1905
|
-
}
|
|
1906
|
-
finally { if (e_6) throw e_6.error; }
|
|
1822
|
+
const numbers = [];
|
|
1823
|
+
for (const part of parts) {
|
|
1824
|
+
if (part === "")
|
|
1825
|
+
return input;
|
|
1826
|
+
const n = iPv4NumberParser(part, validationErrorFlag);
|
|
1827
|
+
if (n === null)
|
|
1828
|
+
return input;
|
|
1829
|
+
numbers.push(n);
|
|
1907
1830
|
}
|
|
1908
1831
|
/**
|
|
1909
1832
|
* 7. If validationErrorFlag is set, validation error.
|
|
@@ -1915,8 +1838,8 @@ function iPv4Parser(input) {
|
|
|
1915
1838
|
*/
|
|
1916
1839
|
if (validationErrorFlag.value)
|
|
1917
1840
|
validationError("Invalid IP v4 address.");
|
|
1918
|
-
for (
|
|
1919
|
-
|
|
1841
|
+
for (let i = 0; i < numbers.length; i++) {
|
|
1842
|
+
const item = numbers[i];
|
|
1920
1843
|
if (item > 255) {
|
|
1921
1844
|
validationError("Invalid IP v4 address.");
|
|
1922
1845
|
if (i < numbers.length - 1)
|
|
@@ -1931,7 +1854,7 @@ function iPv4Parser(input) {
|
|
|
1931
1854
|
* 11. Let ipv4 be the last item in numbers.
|
|
1932
1855
|
* 12. Remove the last item from numbers.
|
|
1933
1856
|
*/
|
|
1934
|
-
|
|
1857
|
+
let ipv4 = numbers[numbers.length - 1];
|
|
1935
1858
|
numbers.pop();
|
|
1936
1859
|
/**
|
|
1937
1860
|
* 13. Let counter be zero.
|
|
@@ -1939,34 +1862,22 @@ function iPv4Parser(input) {
|
|
|
1939
1862
|
* 14.2. Increment ipv4 by n × 256**(3 − counter).
|
|
1940
1863
|
* 14.2. Increment counter by 1.
|
|
1941
1864
|
*/
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
ipv4 += n * Math.pow(256, 3 - counter);
|
|
1947
|
-
counter++;
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1951
|
-
finally {
|
|
1952
|
-
try {
|
|
1953
|
-
if (numbers_1_1 && !numbers_1_1.done && (_b = numbers_1.return)) _b.call(numbers_1);
|
|
1954
|
-
}
|
|
1955
|
-
finally { if (e_7) throw e_7.error; }
|
|
1865
|
+
let counter = 0;
|
|
1866
|
+
for (const n of numbers) {
|
|
1867
|
+
ipv4 += n * Math.pow(256, 3 - counter);
|
|
1868
|
+
counter++;
|
|
1956
1869
|
}
|
|
1957
1870
|
/**
|
|
1958
1871
|
* 15. Return ipv4.
|
|
1959
1872
|
*/
|
|
1960
1873
|
return ipv4;
|
|
1961
1874
|
}
|
|
1962
|
-
exports.iPv4Parser = iPv4Parser;
|
|
1963
1875
|
/**
|
|
1964
1876
|
* Parses a string containing an IP v6 address.
|
|
1965
1877
|
*
|
|
1966
1878
|
* @param input - input string
|
|
1967
1879
|
*/
|
|
1968
1880
|
function iPv6Parser(input) {
|
|
1969
|
-
var _a;
|
|
1970
1881
|
/**
|
|
1971
1882
|
* 1. Let address be a new IPv6 address whose IPv6 pieces are all 0.
|
|
1972
1883
|
* 2. Let pieceIndex be 0.
|
|
@@ -1974,11 +1885,11 @@ function iPv6Parser(input) {
|
|
|
1974
1885
|
* 4. Let pointer be a pointer into input, initially 0 (pointing to the
|
|
1975
1886
|
* first code point).
|
|
1976
1887
|
*/
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1888
|
+
const EOF = "";
|
|
1889
|
+
const address = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
1890
|
+
let pieceIndex = 0;
|
|
1891
|
+
let compress = null;
|
|
1892
|
+
const walker = new util_1.StringWalker(input);
|
|
1982
1893
|
/**
|
|
1983
1894
|
* 5. If c is U+003A (:), then:
|
|
1984
1895
|
* 5.1. If remaining does not start with U+003A (:), validation error,
|
|
@@ -2028,8 +1939,8 @@ function iPv6Parser(input) {
|
|
|
2028
1939
|
* to value × 0x10 + c interpreted as hexadecimal number, and increase
|
|
2029
1940
|
* pointer and length by 1.
|
|
2030
1941
|
*/
|
|
2031
|
-
|
|
2032
|
-
|
|
1942
|
+
let value = 0;
|
|
1943
|
+
let length = 0;
|
|
2033
1944
|
while (length < 4 && infra_1.codePoint.ASCIIHexDigit.test(walker.c())) {
|
|
2034
1945
|
value = value * 0x10 + parseInt(walker.c(), 16);
|
|
2035
1946
|
walker.pointer++;
|
|
@@ -2055,7 +1966,7 @@ function iPv6Parser(input) {
|
|
|
2055
1966
|
validationError("Invalid IP v6 address.");
|
|
2056
1967
|
return null;
|
|
2057
1968
|
}
|
|
2058
|
-
|
|
1969
|
+
let numbersSeen = 0;
|
|
2059
1970
|
/**
|
|
2060
1971
|
* 6.5.5. While c is not the EOF code point:
|
|
2061
1972
|
*/
|
|
@@ -2063,7 +1974,7 @@ function iPv6Parser(input) {
|
|
|
2063
1974
|
/**
|
|
2064
1975
|
* 6.5.5.1. Let ipv4Piece be null.
|
|
2065
1976
|
*/
|
|
2066
|
-
|
|
1977
|
+
let ipv4Piece = null;
|
|
2067
1978
|
/**
|
|
2068
1979
|
* 6.5.5.2. If numbersSeen is greater than 0, then:
|
|
2069
1980
|
* 6.5.5.2.1. If c is a U+002E (.) and numbersSeen is less than 4, then
|
|
@@ -2094,7 +2005,7 @@ function iPv6Parser(input) {
|
|
|
2094
2005
|
/**
|
|
2095
2006
|
* 6.5.5.4.1. Let number be c interpreted as decimal number.
|
|
2096
2007
|
*/
|
|
2097
|
-
|
|
2008
|
+
const number = parseInt(walker.c(), 10);
|
|
2098
2009
|
/**
|
|
2099
2010
|
* 6.5.5.4.2. If ipv4Piece is null, then set ipv4Piece to number.
|
|
2100
2011
|
* Otherwise, if ipv4Piece is 0, validation error, return failure.
|
|
@@ -2182,10 +2093,11 @@ function iPv6Parser(input) {
|
|
|
2182
2093
|
* both pieceIndex and swaps by 1.
|
|
2183
2094
|
*/
|
|
2184
2095
|
if (compress !== null) {
|
|
2185
|
-
|
|
2096
|
+
let swaps = pieceIndex - compress;
|
|
2186
2097
|
pieceIndex = 7;
|
|
2187
2098
|
while (pieceIndex !== 0 && swaps > 0) {
|
|
2188
|
-
|
|
2099
|
+
[address[pieceIndex], address[compress + swaps - 1]] =
|
|
2100
|
+
[address[compress + swaps - 1], address[pieceIndex]];
|
|
2189
2101
|
pieceIndex--;
|
|
2190
2102
|
swaps--;
|
|
2191
2103
|
}
|
|
@@ -2203,14 +2115,12 @@ function iPv6Parser(input) {
|
|
|
2203
2115
|
*/
|
|
2204
2116
|
return address;
|
|
2205
2117
|
}
|
|
2206
|
-
exports.iPv6Parser = iPv6Parser;
|
|
2207
2118
|
/**
|
|
2208
2119
|
* Parses an opaque host string.
|
|
2209
2120
|
*
|
|
2210
2121
|
* @param input - a string
|
|
2211
2122
|
*/
|
|
2212
2123
|
function opaqueHostParser(input) {
|
|
2213
|
-
var e_8, _a;
|
|
2214
2124
|
/**
|
|
2215
2125
|
* 1. If input contains a forbidden host code point excluding U+0025 (%),
|
|
2216
2126
|
* validation error, return failure.
|
|
@@ -2219,28 +2129,17 @@ function opaqueHostParser(input) {
|
|
|
2219
2129
|
* control percent-encode set, and append the result to output.
|
|
2220
2130
|
* 4. Return output.
|
|
2221
2131
|
*/
|
|
2222
|
-
|
|
2132
|
+
const forbiddenChars = /[\x00\t\f\r #/:?@\[\\\]]/;
|
|
2223
2133
|
if (forbiddenChars.test(input)) {
|
|
2224
2134
|
validationError("Invalid host string.");
|
|
2225
2135
|
return null;
|
|
2226
2136
|
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
var codePoint = input_1_1.value;
|
|
2231
|
-
output += utf8PercentEncode(codePoint, _c0ControlPercentEncodeSet);
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
2235
|
-
finally {
|
|
2236
|
-
try {
|
|
2237
|
-
if (input_1_1 && !input_1_1.done && (_a = input_1.return)) _a.call(input_1);
|
|
2238
|
-
}
|
|
2239
|
-
finally { if (e_8) throw e_8.error; }
|
|
2137
|
+
let output = "";
|
|
2138
|
+
for (const codePoint of input) {
|
|
2139
|
+
output += utf8PercentEncode(codePoint, _c0ControlPercentEncodeSet);
|
|
2240
2140
|
}
|
|
2241
2141
|
return output;
|
|
2242
2142
|
}
|
|
2243
|
-
exports.opaqueHostParser = opaqueHostParser;
|
|
2244
2143
|
/**
|
|
2245
2144
|
* Resolves a Blob URL from the user agent's Blob URL store.
|
|
2246
2145
|
* function is not implemented.
|
|
@@ -2251,7 +2150,6 @@ exports.opaqueHostParser = opaqueHostParser;
|
|
|
2251
2150
|
function resolveABlobURL(url) {
|
|
2252
2151
|
return null;
|
|
2253
2152
|
}
|
|
2254
|
-
exports.resolveABlobURL = resolveABlobURL;
|
|
2255
2153
|
/**
|
|
2256
2154
|
* Percent encodes a byte.
|
|
2257
2155
|
*
|
|
@@ -2265,14 +2163,13 @@ function percentEncode(value) {
|
|
|
2265
2163
|
*/
|
|
2266
2164
|
return '%' + ('00' + value.toString(16).toUpperCase()).slice(-2);
|
|
2267
2165
|
}
|
|
2268
|
-
exports.percentEncode = percentEncode;
|
|
2269
2166
|
/**
|
|
2270
2167
|
* Percent decodes a byte sequence input.
|
|
2271
2168
|
*
|
|
2272
2169
|
* @param input - a byte sequence
|
|
2273
2170
|
*/
|
|
2274
2171
|
function percentDecode(input) {
|
|
2275
|
-
|
|
2172
|
+
const isHexDigit = (byte) => {
|
|
2276
2173
|
return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) ||
|
|
2277
2174
|
(byte >= 0x61 && byte <= 0x66);
|
|
2278
2175
|
};
|
|
@@ -2280,10 +2177,10 @@ function percentDecode(input) {
|
|
|
2280
2177
|
* 1. Let output be an empty byte sequence.
|
|
2281
2178
|
* 2. For each byte byte in input:
|
|
2282
2179
|
*/
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
for (
|
|
2286
|
-
|
|
2180
|
+
const output = new Uint8Array(input.length);
|
|
2181
|
+
let n = 0;
|
|
2182
|
+
for (let i = 0; i < input.length; i++) {
|
|
2183
|
+
const byte = input[i];
|
|
2287
2184
|
/**
|
|
2288
2185
|
* 2.1. If byte is not 0x25 (%), then append byte to output.
|
|
2289
2186
|
* 2.2. Otherwise, if byte is 0x25 (%) and the next two bytes after byte
|
|
@@ -2309,7 +2206,7 @@ function percentDecode(input) {
|
|
|
2309
2206
|
n++;
|
|
2310
2207
|
}
|
|
2311
2208
|
else {
|
|
2312
|
-
|
|
2209
|
+
const bytePoint = parseInt((0, util_1.utf8Decode)(Uint8Array.of(input[i + 1], input[i + 2])), 16);
|
|
2313
2210
|
output[n] = bytePoint;
|
|
2314
2211
|
n++;
|
|
2315
2212
|
i += 2;
|
|
@@ -2317,7 +2214,6 @@ function percentDecode(input) {
|
|
|
2317
2214
|
}
|
|
2318
2215
|
return output.subarray(0, n);
|
|
2319
2216
|
}
|
|
2320
|
-
exports.percentDecode = percentDecode;
|
|
2321
2217
|
/**
|
|
2322
2218
|
* String percent decodes a string.
|
|
2323
2219
|
*
|
|
@@ -2328,9 +2224,8 @@ function stringPercentDecode(input) {
|
|
|
2328
2224
|
* 1. Let bytes be the UTF-8 encoding of input.
|
|
2329
2225
|
* 2. Return the percent decoding of bytes.
|
|
2330
2226
|
*/
|
|
2331
|
-
return percentDecode(util_1.utf8Encode(input));
|
|
2227
|
+
return percentDecode((0, util_1.utf8Encode)(input));
|
|
2332
2228
|
}
|
|
2333
|
-
exports.stringPercentDecode = stringPercentDecode;
|
|
2334
2229
|
/**
|
|
2335
2230
|
* UTF-8 percent encodes a code point, using a percent encode set.
|
|
2336
2231
|
*
|
|
@@ -2338,7 +2233,6 @@ exports.stringPercentDecode = stringPercentDecode;
|
|
|
2338
2233
|
* @param percentEncodeSet - a percent encode set
|
|
2339
2234
|
*/
|
|
2340
2235
|
function utf8PercentEncode(codePoint, percentEncodeSet) {
|
|
2341
|
-
var e_9, _a;
|
|
2342
2236
|
/**
|
|
2343
2237
|
* 1. If codePoint is not in percentEncodeSet, then return codePoint.
|
|
2344
2238
|
* 2. Let bytes be the result of running UTF-8 encode on codePoint.
|
|
@@ -2347,24 +2241,13 @@ function utf8PercentEncode(codePoint, percentEncodeSet) {
|
|
|
2347
2241
|
*/
|
|
2348
2242
|
if (!percentEncodeSet.test(codePoint))
|
|
2349
2243
|
return codePoint;
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
var byte = bytes_2_1.value;
|
|
2355
|
-
result += percentEncode(byte);
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
2359
|
-
finally {
|
|
2360
|
-
try {
|
|
2361
|
-
if (bytes_2_1 && !bytes_2_1.done && (_a = bytes_2.return)) _a.call(bytes_2);
|
|
2362
|
-
}
|
|
2363
|
-
finally { if (e_9) throw e_9.error; }
|
|
2244
|
+
const bytes = (0, util_1.utf8Encode)(codePoint);
|
|
2245
|
+
let result = "";
|
|
2246
|
+
for (const byte of bytes) {
|
|
2247
|
+
result += percentEncode(byte);
|
|
2364
2248
|
}
|
|
2365
2249
|
return result;
|
|
2366
2250
|
}
|
|
2367
|
-
exports.utf8PercentEncode = utf8PercentEncode;
|
|
2368
2251
|
/**
|
|
2369
2252
|
* Determines if two hosts are considered equal.
|
|
2370
2253
|
*
|
|
@@ -2374,7 +2257,6 @@ exports.utf8PercentEncode = utf8PercentEncode;
|
|
|
2374
2257
|
function hostEquals(hostA, hostB) {
|
|
2375
2258
|
return hostA === hostB;
|
|
2376
2259
|
}
|
|
2377
|
-
exports.hostEquals = hostEquals;
|
|
2378
2260
|
/**
|
|
2379
2261
|
* Determines if two URLs are considered equal.
|
|
2380
2262
|
*
|
|
@@ -2382,8 +2264,7 @@ exports.hostEquals = hostEquals;
|
|
|
2382
2264
|
* @param urlB - a URL
|
|
2383
2265
|
* @param excludeFragmentsFlag - whether to ignore fragments while comparing
|
|
2384
2266
|
*/
|
|
2385
|
-
function urlEquals(urlA, urlB, excludeFragmentsFlag) {
|
|
2386
|
-
if (excludeFragmentsFlag === void 0) { excludeFragmentsFlag = false; }
|
|
2267
|
+
function urlEquals(urlA, urlB, excludeFragmentsFlag = false) {
|
|
2387
2268
|
/**
|
|
2388
2269
|
* 1. Let serializedA be the result of serializing A, with the exclude
|
|
2389
2270
|
* fragment flag set if the exclude fragments flag is set.
|
|
@@ -2394,7 +2275,6 @@ function urlEquals(urlA, urlB, excludeFragmentsFlag) {
|
|
|
2394
2275
|
return urlSerializer(urlA, excludeFragmentsFlag) ===
|
|
2395
2276
|
urlSerializer(urlB, excludeFragmentsFlag);
|
|
2396
2277
|
}
|
|
2397
|
-
exports.urlEquals = urlEquals;
|
|
2398
2278
|
/**
|
|
2399
2279
|
* Parses an `application/x-www-form-urlencoded` string.
|
|
2400
2280
|
*
|
|
@@ -2406,39 +2286,27 @@ function urlEncodedStringParser(input) {
|
|
|
2406
2286
|
* UTF-8 encodes it, and then returns the result of
|
|
2407
2287
|
* application/x-www-form-urlencoded parsing it.
|
|
2408
2288
|
*/
|
|
2409
|
-
return urlEncodedParser(util_1.utf8Encode(input));
|
|
2289
|
+
return urlEncodedParser((0, util_1.utf8Encode)(input));
|
|
2410
2290
|
}
|
|
2411
|
-
exports.urlEncodedStringParser = urlEncodedStringParser;
|
|
2412
2291
|
/**
|
|
2413
2292
|
* Parses `application/x-www-form-urlencoded` bytes.
|
|
2414
2293
|
*
|
|
2415
2294
|
* @param input - a byte sequence
|
|
2416
2295
|
*/
|
|
2417
2296
|
function urlEncodedParser(input) {
|
|
2418
|
-
var e_10, _a, e_11, _b;
|
|
2419
2297
|
/**
|
|
2420
2298
|
* 1. Let sequences be the result of splitting input on 0x26 (&).
|
|
2421
2299
|
*/
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
sequences.push(Uint8Array.from(currentSequence));
|
|
2429
|
-
currentSequence = [];
|
|
2430
|
-
}
|
|
2431
|
-
else {
|
|
2432
|
-
currentSequence.push(byte);
|
|
2433
|
-
}
|
|
2300
|
+
const sequences = [];
|
|
2301
|
+
let currentSequence = [];
|
|
2302
|
+
for (const byte of input) {
|
|
2303
|
+
if (byte === 0x26) {
|
|
2304
|
+
sequences.push(Uint8Array.from(currentSequence));
|
|
2305
|
+
currentSequence = [];
|
|
2434
2306
|
}
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
finally {
|
|
2438
|
-
try {
|
|
2439
|
-
if (input_2_1 && !input_2_1.done && (_a = input_2.return)) _a.call(input_2);
|
|
2307
|
+
else {
|
|
2308
|
+
currentSequence.push(byte);
|
|
2440
2309
|
}
|
|
2441
|
-
finally { if (e_10) throw e_10.error; }
|
|
2442
2310
|
}
|
|
2443
2311
|
if (currentSequence.length !== 0) {
|
|
2444
2312
|
sequences.push(Uint8Array.from(currentSequence));
|
|
@@ -2446,72 +2314,60 @@ function urlEncodedParser(input) {
|
|
|
2446
2314
|
/**
|
|
2447
2315
|
* 2. Let output be an initially empty list of name-value tuples where both name and value hold a string.
|
|
2448
2316
|
*/
|
|
2449
|
-
|
|
2450
|
-
|
|
2317
|
+
const output = [];
|
|
2318
|
+
/**
|
|
2319
|
+
* 3. For each byte sequence bytes in sequences:
|
|
2320
|
+
*/
|
|
2321
|
+
for (const bytes of sequences) {
|
|
2451
2322
|
/**
|
|
2452
|
-
* 3.
|
|
2323
|
+
* 3.1. If bytes is the empty byte sequence, then continue.
|
|
2453
2324
|
*/
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
var valueString = util_1.utf8Decode(value);
|
|
2489
|
-
/**
|
|
2490
|
-
* 3.6. Append (nameString, valueString) to output.
|
|
2491
|
-
*/
|
|
2492
|
-
output.push([nameString, valueString]);
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
2496
|
-
finally {
|
|
2497
|
-
try {
|
|
2498
|
-
if (sequences_1_1 && !sequences_1_1.done && (_b = sequences_1.return)) _b.call(sequences_1);
|
|
2499
|
-
}
|
|
2500
|
-
finally { if (e_11) throw e_11.error; }
|
|
2325
|
+
if (bytes.length === 0)
|
|
2326
|
+
continue;
|
|
2327
|
+
/**
|
|
2328
|
+
* 3.2. If bytes contains a 0x3D (=), then let name be the bytes from the
|
|
2329
|
+
* start of bytes up to but excluding its first 0x3D (=), and let value be
|
|
2330
|
+
* the bytes, if any, after the first 0x3D (=) up to the end of bytes.
|
|
2331
|
+
* If 0x3D (=) is the first byte, then name will be the empty byte
|
|
2332
|
+
* sequence. If it is the last, then value will be the empty byte sequence.
|
|
2333
|
+
* 3.3. Otherwise, let name have the value of bytes and let value be the
|
|
2334
|
+
* empty byte sequence.
|
|
2335
|
+
*/
|
|
2336
|
+
const index = bytes.indexOf(0x3D);
|
|
2337
|
+
const name = (index !== -1 ? bytes.slice(0, index) : bytes);
|
|
2338
|
+
const value = (index !== -1 ? bytes.slice(index + 1) : new Uint8Array());
|
|
2339
|
+
/**
|
|
2340
|
+
* 3.4. Replace any 0x2B (+) in name and value with 0x20 (SP).
|
|
2341
|
+
*/
|
|
2342
|
+
for (let i = 0; i < name.length; i++)
|
|
2343
|
+
if (name[i] === 0x2B)
|
|
2344
|
+
name[i] = 0x20;
|
|
2345
|
+
for (let i = 0; i < value.length; i++)
|
|
2346
|
+
if (value[i] === 0x2B)
|
|
2347
|
+
value[i] = 0x20;
|
|
2348
|
+
/**
|
|
2349
|
+
* 3.5. Let nameString and valueString be the result of running UTF-8
|
|
2350
|
+
* decode without BOM on the percent decoding of name and value,
|
|
2351
|
+
* respectively.
|
|
2352
|
+
*/
|
|
2353
|
+
const nameString = (0, util_1.utf8Decode)(name);
|
|
2354
|
+
const valueString = (0, util_1.utf8Decode)(value);
|
|
2355
|
+
/**
|
|
2356
|
+
* 3.6. Append (nameString, valueString) to output.
|
|
2357
|
+
*/
|
|
2358
|
+
output.push([nameString, valueString]);
|
|
2501
2359
|
}
|
|
2502
2360
|
/**
|
|
2503
2361
|
* 4. Return output.
|
|
2504
2362
|
*/
|
|
2505
2363
|
return output;
|
|
2506
2364
|
}
|
|
2507
|
-
exports.urlEncodedParser = urlEncodedParser;
|
|
2508
2365
|
/**
|
|
2509
2366
|
* Serializes `application/x-www-form-urlencoded` bytes.
|
|
2510
2367
|
*
|
|
2511
2368
|
* @param input - a byte sequence
|
|
2512
2369
|
*/
|
|
2513
2370
|
function urlEncodedByteSerializer(input) {
|
|
2514
|
-
var e_12, _a;
|
|
2515
2371
|
/**
|
|
2516
2372
|
* 1. Let output be the empty string.
|
|
2517
2373
|
* 2. For each byte in input, depending on byte:
|
|
@@ -2531,33 +2387,22 @@ function urlEncodedByteSerializer(input) {
|
|
|
2531
2387
|
* Append byte, percent encoded, to output.
|
|
2532
2388
|
* 3. Return output.
|
|
2533
2389
|
*/
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
if (byte === 0x20) {
|
|
2539
|
-
output += '+';
|
|
2540
|
-
}
|
|
2541
|
-
else if (byte === 0x2A || byte === 0x2D || byte === 0x2E ||
|
|
2542
|
-
(byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x5A) ||
|
|
2543
|
-
byte === 0x5F || (byte >= 0x61 && byte <= 0x7A)) {
|
|
2544
|
-
output += String.fromCodePoint(byte);
|
|
2545
|
-
}
|
|
2546
|
-
else {
|
|
2547
|
-
output += percentEncode(byte);
|
|
2548
|
-
}
|
|
2390
|
+
let output = "";
|
|
2391
|
+
for (const byte of input) {
|
|
2392
|
+
if (byte === 0x20) {
|
|
2393
|
+
output += '+';
|
|
2549
2394
|
}
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2395
|
+
else if (byte === 0x2A || byte === 0x2D || byte === 0x2E ||
|
|
2396
|
+
(byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x5A) ||
|
|
2397
|
+
byte === 0x5F || (byte >= 0x61 && byte <= 0x7A)) {
|
|
2398
|
+
output += String.fromCodePoint(byte);
|
|
2399
|
+
}
|
|
2400
|
+
else {
|
|
2401
|
+
output += percentEncode(byte);
|
|
2555
2402
|
}
|
|
2556
|
-
finally { if (e_12) throw e_12.error; }
|
|
2557
2403
|
}
|
|
2558
2404
|
return output;
|
|
2559
2405
|
}
|
|
2560
|
-
exports.urlEncodedByteSerializer = urlEncodedByteSerializer;
|
|
2561
2406
|
/**
|
|
2562
2407
|
* Serializes `application/x-www-form-urlencoded` tuples.
|
|
2563
2408
|
*
|
|
@@ -2565,13 +2410,12 @@ exports.urlEncodedByteSerializer = urlEncodedByteSerializer;
|
|
|
2565
2410
|
* @param encodingOverride: encoding override
|
|
2566
2411
|
*/
|
|
2567
2412
|
function urlEncodedSerializer(tuples, encodingOverride) {
|
|
2568
|
-
var e_13, _a;
|
|
2569
2413
|
/**
|
|
2570
2414
|
* 1. Let encoding be UTF-8.
|
|
2571
2415
|
* 2. If encoding override is given, set encoding to the result of getting
|
|
2572
2416
|
* an output encoding from encoding override.
|
|
2573
2417
|
*/
|
|
2574
|
-
|
|
2418
|
+
const encoding = (encodingOverride === undefined ||
|
|
2575
2419
|
encodingOverride === "replacement" || encodingOverride === "UTF-16BE" ||
|
|
2576
2420
|
encodingOverride === "UTF-16LE" ? "UTF-8" : encodingOverride);
|
|
2577
2421
|
if (encoding.toUpperCase() !== "UTF-8") {
|
|
@@ -2580,56 +2424,45 @@ function urlEncodedSerializer(tuples, encodingOverride) {
|
|
|
2580
2424
|
/**
|
|
2581
2425
|
* 3. Let output be the empty string.
|
|
2582
2426
|
*/
|
|
2583
|
-
|
|
2584
|
-
|
|
2427
|
+
let output = "";
|
|
2428
|
+
/**
|
|
2429
|
+
* 4. For each tuple in tuples:
|
|
2430
|
+
*/
|
|
2431
|
+
for (const tuple of tuples) {
|
|
2585
2432
|
/**
|
|
2586
|
-
* 4.
|
|
2433
|
+
* 4.1. Let name be the result of serializing the result of encoding
|
|
2434
|
+
* tuple’s name, using encoding.
|
|
2587
2435
|
*/
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
if (output !== "")
|
|
2613
|
-
output += '&';
|
|
2614
|
-
/**
|
|
2615
|
-
* 4.6. Append name, followed by U+003D (=), followed by value, to output.
|
|
2616
|
-
*/
|
|
2617
|
-
output += name + '=' + value;
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
|
-
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
2621
|
-
finally {
|
|
2622
|
-
try {
|
|
2623
|
-
if (tuples_1_1 && !tuples_1_1.done && (_a = tuples_1.return)) _a.call(tuples_1);
|
|
2624
|
-
}
|
|
2625
|
-
finally { if (e_13) throw e_13.error; }
|
|
2436
|
+
const name = urlEncodedByteSerializer((0, util_1.utf8Encode)(tuple[0]));
|
|
2437
|
+
/**
|
|
2438
|
+
* 4.2. Let value be tuple’s value.
|
|
2439
|
+
*/
|
|
2440
|
+
let value = tuple[1];
|
|
2441
|
+
/**
|
|
2442
|
+
* TODO:
|
|
2443
|
+
* 4.3. If value is a file, then set value to value’s filename.
|
|
2444
|
+
*/
|
|
2445
|
+
/**
|
|
2446
|
+
* 4.4. Set value to the result of serializing the result of encoding
|
|
2447
|
+
* value, using encoding.
|
|
2448
|
+
*/
|
|
2449
|
+
value = urlEncodedByteSerializer((0, util_1.utf8Encode)(value));
|
|
2450
|
+
/**
|
|
2451
|
+
* 4.5. If tuple is not the first pair in tuples, then append U+0026 (&)
|
|
2452
|
+
* to output.
|
|
2453
|
+
*/
|
|
2454
|
+
if (output !== "")
|
|
2455
|
+
output += '&';
|
|
2456
|
+
/**
|
|
2457
|
+
* 4.6. Append name, followed by U+003D (=), followed by value, to output.
|
|
2458
|
+
*/
|
|
2459
|
+
output += name + '=' + value;
|
|
2626
2460
|
}
|
|
2627
2461
|
/**
|
|
2628
2462
|
* 5. Return output.
|
|
2629
2463
|
*/
|
|
2630
2464
|
return output;
|
|
2631
2465
|
}
|
|
2632
|
-
exports.urlEncodedSerializer = urlEncodedSerializer;
|
|
2633
2466
|
/**
|
|
2634
2467
|
* Returns a URL's origin.
|
|
2635
2468
|
*
|
|
@@ -2663,7 +2496,7 @@ function origin(url) {
|
|
|
2663
2496
|
if (url._blobURLEntry !== null) {
|
|
2664
2497
|
// TODO: return URL’s blob URL entry’s environment’s origin.
|
|
2665
2498
|
}
|
|
2666
|
-
|
|
2499
|
+
const parsedURL = basicURLParser(url.path[0]);
|
|
2667
2500
|
if (parsedURL === null)
|
|
2668
2501
|
return interfaces_1.OpaqueOrigin;
|
|
2669
2502
|
else
|
|
@@ -2680,14 +2513,12 @@ function origin(url) {
|
|
|
2680
2513
|
return interfaces_1.OpaqueOrigin;
|
|
2681
2514
|
}
|
|
2682
2515
|
}
|
|
2683
|
-
exports.origin = origin;
|
|
2684
2516
|
/**
|
|
2685
2517
|
* Converts a domain string to ASCII.
|
|
2686
2518
|
*
|
|
2687
2519
|
* @param domain - a domain string
|
|
2688
2520
|
*/
|
|
2689
|
-
function domainToASCII(domain, beStrict) {
|
|
2690
|
-
if (beStrict === void 0) { beStrict = false; }
|
|
2521
|
+
function domainToASCII(domain, beStrict = false) {
|
|
2691
2522
|
/**
|
|
2692
2523
|
* 1. If beStrict is not given, set it to false.
|
|
2693
2524
|
* 2. Let result be the result of running Unicode ToASCII with domain_name
|
|
@@ -2698,21 +2529,19 @@ function domainToASCII(domain, beStrict) {
|
|
|
2698
2529
|
* 4. Return result.
|
|
2699
2530
|
*/
|
|
2700
2531
|
// Use node.js function
|
|
2701
|
-
|
|
2532
|
+
const result = (0, url_1.domainToASCII)(domain);
|
|
2702
2533
|
if (result === "") {
|
|
2703
2534
|
validationError("Invalid domain name.");
|
|
2704
2535
|
return null;
|
|
2705
2536
|
}
|
|
2706
2537
|
return result;
|
|
2707
2538
|
}
|
|
2708
|
-
exports.domainToASCII = domainToASCII;
|
|
2709
2539
|
/**
|
|
2710
2540
|
* Converts a domain string to Unicode.
|
|
2711
2541
|
*
|
|
2712
2542
|
* @param domain - a domain string
|
|
2713
2543
|
*/
|
|
2714
|
-
function domainToUnicode(domain, beStrict) {
|
|
2715
|
-
if (beStrict === void 0) { beStrict = false; }
|
|
2544
|
+
function domainToUnicode(domain, beStrict = false) {
|
|
2716
2545
|
/**
|
|
2717
2546
|
* 1. Let result be the result of running Unicode ToUnicode with domain_name
|
|
2718
2547
|
* set to domain, CheckHyphens set to false, CheckBidi set to true,
|
|
@@ -2722,13 +2551,12 @@ function domainToUnicode(domain, beStrict) {
|
|
|
2722
2551
|
* return result.
|
|
2723
2552
|
*/
|
|
2724
2553
|
// Use node.js function
|
|
2725
|
-
|
|
2554
|
+
const result = (0, url_1.domainToUnicode)(domain);
|
|
2726
2555
|
if (result === "") {
|
|
2727
2556
|
validationError("Invalid domain name.");
|
|
2728
2557
|
}
|
|
2729
2558
|
return result;
|
|
2730
2559
|
}
|
|
2731
|
-
exports.domainToUnicode = domainToUnicode;
|
|
2732
2560
|
/**
|
|
2733
2561
|
* Serializes an origin.
|
|
2734
2562
|
* function is from the HTML spec:
|
|
@@ -2749,10 +2577,9 @@ function asciiSerializationOfAnOrigin(origin) {
|
|
|
2749
2577
|
if (origin[0] === "" && origin[1] === "" && origin[2] === null && origin[3] === null) {
|
|
2750
2578
|
return "null";
|
|
2751
2579
|
}
|
|
2752
|
-
|
|
2580
|
+
let result = origin[0] + "://" + hostSerializer(origin[1]);
|
|
2753
2581
|
if (origin[2] !== null)
|
|
2754
2582
|
result += ":" + origin[2].toString();
|
|
2755
2583
|
return result;
|
|
2756
2584
|
}
|
|
2757
|
-
exports.asciiSerializationOfAnOrigin = asciiSerializationOfAnOrigin;
|
|
2758
2585
|
//# sourceMappingURL=URLAlgorithm.js.map
|