@pokash/n8n-nodes-ksef 0.2.16 → 0.2.17
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/package.json +5 -12
- package/node_modules/@oozcitak/dom/LICENSE +0 -21
- package/node_modules/@oozcitak/dom/README.md +0 -32
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.d.ts +0 -21
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js +0 -79
- package/node_modules/@oozcitak/dom/lib/algorithm/AbortAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.d.ts +0 -8
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js +0 -23
- package/node_modules/@oozcitak/dom/lib/algorithm/AttrAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.d.ts +0 -8
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js +0 -76
- package/node_modules/@oozcitak/dom/lib/algorithm/BoundaryPointAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.d.ts +0 -19
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js +0 -140
- package/node_modules/@oozcitak/dom/lib/algorithm/CharacterDataAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.d.ts +0 -192
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js +0 -303
- package/node_modules/@oozcitak/dom/lib/algorithm/CreateAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.d.ts +0 -61
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js +0 -108
- package/node_modules/@oozcitak/dom/lib/algorithm/CustomElementAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.d.ts +0 -72
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js +0 -288
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.d.ts +0 -21
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js +0 -61
- package/node_modules/@oozcitak/dom/lib/algorithm/DOMTokenListAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.d.ts +0 -29
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js +0 -161
- package/node_modules/@oozcitak/dom/lib/algorithm/DocumentAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.d.ts +0 -121
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js +0 -608
- package/node_modules/@oozcitak/dom/lib/algorithm/ElementAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.d.ts +0 -146
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js +0 -995
- package/node_modules/@oozcitak/dom/lib/algorithm/EventAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.d.ts +0 -33
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js +0 -142
- package/node_modules/@oozcitak/dom/lib/algorithm/EventTargetAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.d.ts +0 -66
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js +0 -1173
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.d.ts +0 -43
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js +0 -276
- package/node_modules/@oozcitak/dom/lib/algorithm/MutationObserverAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.d.ts +0 -25
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js +0 -85
- package/node_modules/@oozcitak/dom/lib/algorithm/NamespaceAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.d.ts +0 -68
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js +0 -543
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.d.ts +0 -15
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js +0 -105
- package/node_modules/@oozcitak/dom/lib/algorithm/NodeIteratorAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.d.ts +0 -27
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js +0 -125
- package/node_modules/@oozcitak/dom/lib/algorithm/OrderedSetAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.d.ts +0 -9
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js +0 -69
- package/node_modules/@oozcitak/dom/lib/algorithm/ParentNodeAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.d.ts +0 -82
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js +0 -829
- package/node_modules/@oozcitak/dom/lib/algorithm/RangeAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.d.ts +0 -8
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js +0 -21
- package/node_modules/@oozcitak/dom/lib/algorithm/SelectorsAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.d.ts +0 -57
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js +0 -316
- package/node_modules/@oozcitak/dom/lib/algorithm/ShadowTreeAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.d.ts +0 -30
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js +0 -226
- package/node_modules/@oozcitak/dom/lib/algorithm/TextAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.d.ts +0 -8
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js +0 -62
- package/node_modules/@oozcitak/dom/lib/algorithm/TraversalAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.d.ts +0 -268
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js +0 -853
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.d.ts +0 -17
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js +0 -147
- package/node_modules/@oozcitak/dom/lib/algorithm/TreeWalkerAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.d.ts +0 -8
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js +0 -14
- package/node_modules/@oozcitak/dom/lib/algorithm/WebIDLAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.d.ts +0 -25
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js +0 -164
- package/node_modules/@oozcitak/dom/lib/algorithm/XMLAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/algorithm/index.d.ts +0 -28
- package/node_modules/@oozcitak/dom/lib/algorithm/index.js +0 -34
- package/node_modules/@oozcitak/dom/lib/algorithm/index.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.d.ts +0 -15
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js +0 -32
- package/node_modules/@oozcitak/dom/lib/dom/AbortControllerImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.d.ts +0 -23
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js +0 -59
- package/node_modules/@oozcitak/dom/lib/dom/AbortSignalImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.d.ts +0 -23
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js +0 -70
- package/node_modules/@oozcitak/dom/lib/dom/AbstractRangeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.d.ts +0 -45
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js +0 -118
- package/node_modules/@oozcitak/dom/lib/dom/AttrImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.d.ts +0 -21
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js +0 -51
- package/node_modules/@oozcitak/dom/lib/dom/CDATASectionImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.d.ts +0 -35
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js +0 -132
- package/node_modules/@oozcitak/dom/lib/dom/CharacterDataImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.d.ts +0 -16
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js +0 -165
- package/node_modules/@oozcitak/dom/lib/dom/ChildNodeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.d.ts +0 -21
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js +0 -52
- package/node_modules/@oozcitak/dom/lib/dom/CommentImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.d.ts +0 -16
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js +0 -60
- package/node_modules/@oozcitak/dom/lib/dom/CustomEventImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.d.ts +0 -171
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.js +0 -347
- package/node_modules/@oozcitak/dom/lib/dom/DOMException.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.d.ts +0 -48
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js +0 -100
- package/node_modules/@oozcitak/dom/lib/dom/DOMImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.d.ts +0 -29
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js +0 -149
- package/node_modules/@oozcitak/dom/lib/dom/DOMImplementationImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.d.ts +0 -46
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js +0 -312
- package/node_modules/@oozcitak/dom/lib/dom/DOMTokenListImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.d.ts +0 -32
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js +0 -103
- package/node_modules/@oozcitak/dom/lib/dom/DocumentFragmentImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.d.ts +0 -116
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js +0 -545
- package/node_modules/@oozcitak/dom/lib/dom/DocumentImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.d.ts +0 -11
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js +0 -17
- package/node_modules/@oozcitak/dom/lib/dom/DocumentOrShadowRootImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.d.ts +0 -39
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js +0 -109
- package/node_modules/@oozcitak/dom/lib/dom/DocumentTypeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.d.ts +0 -132
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js +0 -714
- package/node_modules/@oozcitak/dom/lib/dom/ElementImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.d.ts +0 -74
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js +0 -313
- package/node_modules/@oozcitak/dom/lib/dom/EventImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.d.ts +0 -30
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js +0 -133
- package/node_modules/@oozcitak/dom/lib/dom/EventTargetImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.d.ts +0 -44
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js +0 -157
- package/node_modules/@oozcitak/dom/lib/dom/HTMLCollectionImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.d.ts +0 -22
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js +0 -184
- package/node_modules/@oozcitak/dom/lib/dom/MutationObserverImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.d.ts +0 -73
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js +0 -116
- package/node_modules/@oozcitak/dom/lib/dom/MutationRecordImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.d.ts +0 -34
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js +0 -112
- package/node_modules/@oozcitak/dom/lib/dom/NamedNodeMapImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.d.ts +0 -50
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js +0 -64
- package/node_modules/@oozcitak/dom/lib/dom/NodeFilterImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.d.ts +0 -252
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js +0 -891
- package/node_modules/@oozcitak/dom/lib/dom/NodeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.d.ts +0 -34
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js +0 -86
- package/node_modules/@oozcitak/dom/lib/dom/NodeIteratorImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.d.ts +0 -46
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js +0 -198
- package/node_modules/@oozcitak/dom/lib/dom/NodeListImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.d.ts +0 -49
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js +0 -188
- package/node_modules/@oozcitak/dom/lib/dom/NodeListStaticImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.d.ts +0 -12
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js +0 -53
- package/node_modules/@oozcitak/dom/lib/dom/NonDocumentTypeChildNodeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.d.ts +0 -9
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js +0 -31
- package/node_modules/@oozcitak/dom/lib/dom/NonElementParentNodeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.d.ts +0 -24
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js +0 -158
- package/node_modules/@oozcitak/dom/lib/dom/ParentNodeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.d.ts +0 -25
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js +0 -59
- package/node_modules/@oozcitak/dom/lib/dom/ProcessingInstructionImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.d.ts +0 -71
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js +0 -649
- package/node_modules/@oozcitak/dom/lib/dom/RangeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.d.ts +0 -33
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js +0 -82
- package/node_modules/@oozcitak/dom/lib/dom/ShadowRootImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.d.ts +0 -16
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js +0 -35
- package/node_modules/@oozcitak/dom/lib/dom/SlotableImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.d.ts +0 -13
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js +0 -48
- package/node_modules/@oozcitak/dom/lib/dom/StaticRangeImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.d.ts +0 -28
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js +0 -109
- package/node_modules/@oozcitak/dom/lib/dom/TextImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.d.ts +0 -23
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js +0 -41
- package/node_modules/@oozcitak/dom/lib/dom/TraverserImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.d.ts +0 -36
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js +0 -249
- package/node_modules/@oozcitak/dom/lib/dom/TreeWalkerImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.d.ts +0 -26
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js +0 -57
- package/node_modules/@oozcitak/dom/lib/dom/WindowImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.d.ts +0 -11
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js +0 -31
- package/node_modules/@oozcitak/dom/lib/dom/XMLDocumentImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/index.d.ts +0 -36
- package/node_modules/@oozcitak/dom/lib/dom/index.js +0 -102
- package/node_modules/@oozcitak/dom/lib/dom/index.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.d.ts +0 -2218
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.js +0 -91
- package/node_modules/@oozcitak/dom/lib/dom/interfaces.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/index.d.ts +0 -3
- package/node_modules/@oozcitak/dom/lib/index.js +0 -11
- package/node_modules/@oozcitak/dom/lib/index.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.d.ts +0 -11
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js +0 -37
- package/node_modules/@oozcitak/dom/lib/parser/DOMParserImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.d.ts +0 -26
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js +0 -240
- package/node_modules/@oozcitak/dom/lib/parser/XMLParserImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.d.ts +0 -159
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js +0 -512
- package/node_modules/@oozcitak/dom/lib/parser/XMLStringLexer.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/parser/index.d.ts +0 -1
- package/node_modules/@oozcitak/dom/lib/parser/index.js +0 -6
- package/node_modules/@oozcitak/dom/lib/parser/index.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.d.ts +0 -131
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.js +0 -18
- package/node_modules/@oozcitak/dom/lib/parser/interfaces.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.d.ts +0 -27
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js +0 -56
- package/node_modules/@oozcitak/dom/lib/serializer/LocalNameSet.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.d.ts +0 -52
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js +0 -151
- package/node_modules/@oozcitak/dom/lib/serializer/NamespacePrefixMap.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.d.ts +0 -166
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js +0 -1479
- package/node_modules/@oozcitak/dom/lib/serializer/XMLSerializerImpl.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/serializer/index.d.ts +0 -1
- package/node_modules/@oozcitak/dom/lib/serializer/index.js +0 -6
- package/node_modules/@oozcitak/dom/lib/serializer/index.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/serializer/interfaces.d.ts +0 -15
- package/node_modules/@oozcitak/dom/lib/serializer/interfaces.js +0 -3
- package/node_modules/@oozcitak/dom/lib/serializer/interfaces.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/util/Cast.d.ts +0 -12
- package/node_modules/@oozcitak/dom/lib/util/Cast.js +0 -26
- package/node_modules/@oozcitak/dom/lib/util/Cast.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.d.ts +0 -13
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.js +0 -61
- package/node_modules/@oozcitak/dom/lib/util/EmptySet.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/util/Guard.d.ts +0 -135
- package/node_modules/@oozcitak/dom/lib/util/Guard.js +0 -192
- package/node_modules/@oozcitak/dom/lib/util/Guard.js.map +0 -1
- package/node_modules/@oozcitak/dom/lib/util/index.d.ts +0 -3
- package/node_modules/@oozcitak/dom/lib/util/index.js +0 -9
- package/node_modules/@oozcitak/dom/lib/util/index.js.map +0 -1
- package/node_modules/@oozcitak/dom/package.json +0 -72
- package/node_modules/@oozcitak/infra/LICENSE +0 -21
- package/node_modules/@oozcitak/infra/README.md +0 -13
- package/node_modules/@oozcitak/infra/lib/Base64.d.ts +0 -12
- package/node_modules/@oozcitak/infra/lib/Base64.js +0 -82
- package/node_modules/@oozcitak/infra/lib/Base64.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/Byte.d.ts +0 -6
- package/node_modules/@oozcitak/infra/lib/Byte.js +0 -15
- package/node_modules/@oozcitak/infra/lib/Byte.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/ByteSequence.d.ts +0 -45
- package/node_modules/@oozcitak/infra/lib/ByteSequence.js +0 -171
- package/node_modules/@oozcitak/infra/lib/ByteSequence.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/CodePoints.d.ts +0 -82
- package/node_modules/@oozcitak/infra/lib/CodePoints.js +0 -85
- package/node_modules/@oozcitak/infra/lib/CodePoints.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/JSON.d.ts +0 -24
- package/node_modules/@oozcitak/infra/lib/JSON.js +0 -123
- package/node_modules/@oozcitak/infra/lib/JSON.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/List.d.ts +0 -101
- package/node_modules/@oozcitak/infra/lib/List.js +0 -325
- package/node_modules/@oozcitak/infra/lib/List.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/Map.d.ts +0 -87
- package/node_modules/@oozcitak/infra/lib/Map.js +0 -308
- package/node_modules/@oozcitak/infra/lib/Map.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/Namespace.d.ts +0 -6
- package/node_modules/@oozcitak/infra/lib/Namespace.js +0 -9
- package/node_modules/@oozcitak/infra/lib/Namespace.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/Queue.d.ts +0 -13
- package/node_modules/@oozcitak/infra/lib/Queue.js +0 -22
- package/node_modules/@oozcitak/infra/lib/Queue.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/Set.d.ts +0 -136
- package/node_modules/@oozcitak/infra/lib/Set.js +0 -467
- package/node_modules/@oozcitak/infra/lib/Set.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/Stack.d.ts +0 -13
- package/node_modules/@oozcitak/infra/lib/Stack.js +0 -22
- package/node_modules/@oozcitak/infra/lib/Stack.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/String.d.ts +0 -129
- package/node_modules/@oozcitak/infra/lib/String.js +0 -472
- package/node_modules/@oozcitak/infra/lib/String.js.map +0 -1
- package/node_modules/@oozcitak/infra/lib/index.d.ts +0 -13
- package/node_modules/@oozcitak/infra/lib/index.js +0 -34
- package/node_modules/@oozcitak/infra/lib/index.js.map +0 -1
- package/node_modules/@oozcitak/infra/package.json +0 -54
- package/node_modules/@oozcitak/url/LICENSE +0 -21
- package/node_modules/@oozcitak/url/README.md +0 -27
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.d.ts +0 -267
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.js +0 -2758
- package/node_modules/@oozcitak/url/lib/URLAlgorithm.js.map +0 -1
- package/node_modules/@oozcitak/url/lib/URLImpl.d.ts +0 -53
- package/node_modules/@oozcitak/url/lib/URLImpl.js +0 -377
- package/node_modules/@oozcitak/url/lib/URLImpl.js.map +0 -1
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.d.ts +0 -38
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js +0 -303
- package/node_modules/@oozcitak/url/lib/URLSearchParamsImpl.js.map +0 -1
- package/node_modules/@oozcitak/url/lib/index.d.ts +0 -2
- package/node_modules/@oozcitak/url/lib/index.js +0 -7
- package/node_modules/@oozcitak/url/lib/index.js.map +0 -1
- package/node_modules/@oozcitak/url/lib/interfaces.d.ts +0 -195
- package/node_modules/@oozcitak/url/lib/interfaces.js +0 -31
- package/node_modules/@oozcitak/url/lib/interfaces.js.map +0 -1
- package/node_modules/@oozcitak/url/package.json +0 -55
- package/node_modules/@oozcitak/util/LICENSE +0 -21
- package/node_modules/@oozcitak/util/README.md +0 -10
- package/node_modules/@oozcitak/util/lib/CompareCache.d.ts +0 -32
- package/node_modules/@oozcitak/util/lib/CompareCache.js +0 -59
- package/node_modules/@oozcitak/util/lib/CompareCache.js.map +0 -1
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.d.ts +0 -64
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.js +0 -174
- package/node_modules/@oozcitak/util/lib/FixedSizeSet.js.map +0 -1
- package/node_modules/@oozcitak/util/lib/Lazy.d.ts +0 -18
- package/node_modules/@oozcitak/util/lib/Lazy.js +0 -34
- package/node_modules/@oozcitak/util/lib/Lazy.js.map +0 -1
- package/node_modules/@oozcitak/util/lib/ObjectCache.d.ts +0 -71
- package/node_modules/@oozcitak/util/lib/ObjectCache.js +0 -181
- package/node_modules/@oozcitak/util/lib/ObjectCache.js.map +0 -1
- package/node_modules/@oozcitak/util/lib/StringWalker.d.ts +0 -49
- package/node_modules/@oozcitak/util/lib/StringWalker.js +0 -105
- package/node_modules/@oozcitak/util/lib/StringWalker.js.map +0 -1
- package/node_modules/@oozcitak/util/lib/index.d.ts +0 -178
- package/node_modules/@oozcitak/util/lib/index.js +0 -439
- package/node_modules/@oozcitak/util/lib/index.js.map +0 -1
- package/node_modules/@oozcitak/util/package.json +0 -50
- package/node_modules/@xmldom/is-dom-node/LICENSE.md +0 -21
- package/node_modules/@xmldom/is-dom-node/README.md +0 -91
- package/node_modules/@xmldom/is-dom-node/dist/index.d.ts +0 -33
- package/node_modules/@xmldom/is-dom-node/dist/index.js +0 -91
- package/node_modules/@xmldom/is-dom-node/dist/index.js.map +0 -1
- package/node_modules/@xmldom/is-dom-node/package.json +0 -69
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +0 -468
- package/node_modules/@xmldom/xmldom/LICENSE +0 -8
- package/node_modules/@xmldom/xmldom/SECURITY.md +0 -50
- package/node_modules/@xmldom/xmldom/index.d.ts +0 -43
- package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +0 -2
- package/node_modules/@xmldom/xmldom/lib/conventions.js +0 -203
- package/node_modules/@xmldom/xmldom/lib/dom-parser.js +0 -322
- package/node_modules/@xmldom/xmldom/lib/dom.js +0 -1879
- package/node_modules/@xmldom/xmldom/lib/entities.js +0 -2166
- package/node_modules/@xmldom/xmldom/lib/index.js +0 -4
- package/node_modules/@xmldom/xmldom/lib/sax.js +0 -662
- package/node_modules/@xmldom/xmldom/package.json +0 -71
- package/node_modules/@xmldom/xmldom/readme.md +0 -356
- package/node_modules/esprima/ChangeLog +0 -235
- package/node_modules/esprima/LICENSE.BSD +0 -21
- package/node_modules/esprima/README.md +0 -46
- package/node_modules/esprima/bin/esparse.js +0 -139
- package/node_modules/esprima/bin/esvalidate.js +0 -236
- package/node_modules/esprima/dist/esprima.js +0 -6709
- package/node_modules/esprima/package.json +0 -112
- package/node_modules/node-forge/LICENSE +0 -331
- package/node_modules/node-forge/README.md +0 -2071
- package/node_modules/node-forge/dist/forge.all.min.js +0 -2
- package/node_modules/node-forge/dist/forge.all.min.js.map +0 -1
- package/node_modules/node-forge/dist/forge.min.js +0 -2
- package/node_modules/node-forge/dist/forge.min.js.map +0 -1
- package/node_modules/node-forge/dist/prime.worker.min.js +0 -2
- package/node_modules/node-forge/dist/prime.worker.min.js.map +0 -1
- package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/node_modules/node-forge/lib/aes.js +0 -1091
- package/node_modules/node-forge/lib/aesCipherSuites.js +0 -282
- package/node_modules/node-forge/lib/asn1-validator.js +0 -91
- package/node_modules/node-forge/lib/asn1.js +0 -1503
- package/node_modules/node-forge/lib/baseN.js +0 -186
- package/node_modules/node-forge/lib/cipher.js +0 -230
- package/node_modules/node-forge/lib/cipherModes.js +0 -999
- package/node_modules/node-forge/lib/des.js +0 -496
- package/node_modules/node-forge/lib/ed25519.js +0 -1072
- package/node_modules/node-forge/lib/forge.js +0 -13
- package/node_modules/node-forge/lib/form.js +0 -149
- package/node_modules/node-forge/lib/hmac.js +0 -146
- package/node_modules/node-forge/lib/http.js +0 -1346
- package/node_modules/node-forge/lib/index.all.js +0 -16
- package/node_modules/node-forge/lib/index.js +0 -33
- package/node_modules/node-forge/lib/jsbn.js +0 -1264
- package/node_modules/node-forge/lib/kem.js +0 -168
- package/node_modules/node-forge/lib/log.js +0 -319
- package/node_modules/node-forge/lib/md.all.js +0 -13
- package/node_modules/node-forge/lib/md.js +0 -11
- package/node_modules/node-forge/lib/md5.js +0 -289
- package/node_modules/node-forge/lib/mgf.js +0 -12
- package/node_modules/node-forge/lib/mgf1.js +0 -57
- package/node_modules/node-forge/lib/oids.js +0 -179
- package/node_modules/node-forge/lib/pbe.js +0 -1023
- package/node_modules/node-forge/lib/pbkdf2.js +0 -211
- package/node_modules/node-forge/lib/pem.js +0 -237
- package/node_modules/node-forge/lib/pkcs1.js +0 -276
- package/node_modules/node-forge/lib/pkcs12.js +0 -1078
- package/node_modules/node-forge/lib/pkcs7.js +0 -1260
- package/node_modules/node-forge/lib/pkcs7asn1.js +0 -410
- package/node_modules/node-forge/lib/pki.js +0 -102
- package/node_modules/node-forge/lib/prime.js +0 -297
- package/node_modules/node-forge/lib/prime.worker.js +0 -168
- package/node_modules/node-forge/lib/prng.js +0 -419
- package/node_modules/node-forge/lib/pss.js +0 -241
- package/node_modules/node-forge/lib/random.js +0 -191
- package/node_modules/node-forge/lib/rc2.js +0 -410
- package/node_modules/node-forge/lib/rsa.js +0 -1949
- package/node_modules/node-forge/lib/sha1.js +0 -319
- package/node_modules/node-forge/lib/sha256.js +0 -327
- package/node_modules/node-forge/lib/sha512.js +0 -561
- package/node_modules/node-forge/lib/socket.js +0 -287
- package/node_modules/node-forge/lib/ssh.js +0 -236
- package/node_modules/node-forge/lib/tls.js +0 -4282
- package/node_modules/node-forge/lib/tlssocket.js +0 -249
- package/node_modules/node-forge/lib/util.js +0 -2652
- package/node_modules/node-forge/lib/x509.js +0 -3242
- package/node_modules/node-forge/lib/xhr.js +0 -738
- package/node_modules/node-forge/package.json +0 -123
- 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/xml-crypto/LICENSE +0 -22
- package/node_modules/xml-crypto/README.md +0 -557
- package/node_modules/xml-crypto/lib/c14n-canonicalization.d.ts +0 -39
- package/node_modules/xml-crypto/lib/c14n-canonicalization.js +0 -230
- package/node_modules/xml-crypto/lib/c14n-canonicalization.js.map +0 -1
- package/node_modules/xml-crypto/lib/enveloped-signature.d.ts +0 -7
- package/node_modules/xml-crypto/lib/enveloped-signature.js +0 -43
- package/node_modules/xml-crypto/lib/enveloped-signature.js.map +0 -1
- package/node_modules/xml-crypto/lib/exclusive-canonicalization.d.ts +0 -38
- package/node_modules/xml-crypto/lib/exclusive-canonicalization.js +0 -246
- package/node_modules/xml-crypto/lib/exclusive-canonicalization.js.map +0 -1
- package/node_modules/xml-crypto/lib/hash-algorithms.d.ts +0 -13
- package/node_modules/xml-crypto/lib/hash-algorithms.js +0 -47
- package/node_modules/xml-crypto/lib/hash-algorithms.js.map +0 -1
- package/node_modules/xml-crypto/lib/index.d.ts +0 -5
- package/node_modules/xml-crypto/lib/index.js +0 -28
- package/node_modules/xml-crypto/lib/index.js.map +0 -1
- package/node_modules/xml-crypto/lib/signature-algorithms.d.ts +0 -47
- package/node_modules/xml-crypto/lib/signature-algorithms.js +0 -86
- package/node_modules/xml-crypto/lib/signature-algorithms.js.map +0 -1
- package/node_modules/xml-crypto/lib/signed-xml.d.ts +0 -225
- package/node_modules/xml-crypto/lib/signed-xml.js +0 -960
- package/node_modules/xml-crypto/lib/signed-xml.js.map +0 -1
- package/node_modules/xml-crypto/lib/types.d.ts +0 -125
- package/node_modules/xml-crypto/lib/types.js +0 -57
- package/node_modules/xml-crypto/lib/types.js.map +0 -1
- package/node_modules/xml-crypto/lib/utils.d.ts +0 -65
- package/node_modules/xml-crypto/lib/utils.js +0 -256
- package/node_modules/xml-crypto/lib/utils.js.map +0 -1
- package/node_modules/xml-crypto/node_modules/xpath/LICENSE +0 -22
- package/node_modules/xml-crypto/node_modules/xpath/README.md +0 -133
- package/node_modules/xml-crypto/node_modules/xpath/docs/XPathEvaluator.md +0 -62
- package/node_modules/xml-crypto/node_modules/xpath/docs/XPathResult.md +0 -47
- package/node_modules/xml-crypto/node_modules/xpath/docs/function resolvers.md +0 -88
- package/node_modules/xml-crypto/node_modules/xpath/docs/namespace resolvers.md +0 -69
- package/node_modules/xml-crypto/node_modules/xpath/docs/parsed expressions.md +0 -21
- package/node_modules/xml-crypto/node_modules/xpath/docs/variable resolvers.md +0 -89
- package/node_modules/xml-crypto/node_modules/xpath/docs/xpath methods.md +0 -39
- package/node_modules/xml-crypto/node_modules/xpath/package.json +0 -39
- package/node_modules/xml-crypto/node_modules/xpath/test.js +0 -1186
- package/node_modules/xml-crypto/node_modules/xpath/xpath.d.ts +0 -51
- package/node_modules/xml-crypto/node_modules/xpath/xpath.js +0 -4938
- package/node_modules/xml-crypto/package.json +0 -73
- package/node_modules/xmlbuilder2/CHANGELOG.md +0 -309
- package/node_modules/xmlbuilder2/LICENSE +0 -21
- package/node_modules/xmlbuilder2/README.md +0 -183
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.d.ts +0 -236
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js +0 -108
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctions.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.d.ts +0 -17
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js +0 -26
- package/node_modules/xmlbuilder2/lib/builder/BuilderFunctionsCB.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.d.ts +0 -124
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js +0 -782
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderCBImpl.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.d.ts +0 -143
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js +0 -841
- package/node_modules/xmlbuilder2/lib/builder/XMLBuilderImpl.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/builder/dom.d.ts +0 -8
- package/node_modules/xmlbuilder2/lib/builder/dom.js +0 -67
- package/node_modules/xmlbuilder2/lib/builder/dom.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/builder/index.d.ts +0 -4
- package/node_modules/xmlbuilder2/lib/builder/index.js +0 -15
- package/node_modules/xmlbuilder2/lib/builder/index.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/constants.d.ts +0 -1
- package/node_modules/xmlbuilder2/lib/constants.js +0 -4
- package/node_modules/xmlbuilder2/lib/constants.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/index.d.ts +0 -1
- package/node_modules/xmlbuilder2/lib/index.js +0 -10
- package/node_modules/xmlbuilder2/lib/index.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/interfaces.d.ts +0 -1355
- package/node_modules/xmlbuilder2/lib/interfaces.js +0 -76
- package/node_modules/xmlbuilder2/lib/interfaces.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.d.ts +0 -109
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.js +0 -167
- package/node_modules/xmlbuilder2/lib/readers/BaseReader.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.d.ts +0 -14
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.js +0 -38
- package/node_modules/xmlbuilder2/lib/readers/JSONReader.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.d.ts +0 -15
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js +0 -168
- package/node_modules/xmlbuilder2/lib/readers/ObjectReader.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.d.ts +0 -14
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.js +0 -206
- package/node_modules/xmlbuilder2/lib/readers/XMLReader.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.d.ts +0 -14
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js +0 -44
- package/node_modules/xmlbuilder2/lib/readers/YAMLReader.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/readers/index.d.ts +0 -4
- package/node_modules/xmlbuilder2/lib/readers/index.js +0 -11
- package/node_modules/xmlbuilder2/lib/readers/index.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.d.ts +0 -110
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js +0 -23
- package/node_modules/xmlbuilder2/lib/writers/BaseCBWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.d.ts +0 -276
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js +0 -1603
- package/node_modules/xmlbuilder2/lib/writers/BaseWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.d.ts +0 -68
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js +0 -172
- package/node_modules/xmlbuilder2/lib/writers/JSONCBWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.d.ts +0 -67
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js +0 -222
- package/node_modules/xmlbuilder2/lib/writers/JSONWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.d.ts +0 -27
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.js +0 -84
- package/node_modules/xmlbuilder2/lib/writers/MapWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.d.ts +0 -56
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js +0 -483
- package/node_modules/xmlbuilder2/lib/writers/ObjectWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.d.ts +0 -51
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js +0 -165
- package/node_modules/xmlbuilder2/lib/writers/XMLCBWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.d.ts +0 -60
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js +0 -236
- package/node_modules/xmlbuilder2/lib/writers/XMLWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.d.ts +0 -61
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js +0 -161
- package/node_modules/xmlbuilder2/lib/writers/YAMLCBWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.d.ts +0 -55
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js +0 -186
- package/node_modules/xmlbuilder2/lib/writers/YAMLWriter.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/writers/index.d.ts +0 -5
- package/node_modules/xmlbuilder2/lib/writers/index.js +0 -13
- package/node_modules/xmlbuilder2/lib/writers/index.js.map +0 -1
- package/node_modules/xmlbuilder2/lib/xmlbuilder2.min.js +0 -8
- package/node_modules/xmlbuilder2/node_modules/argparse/CHANGELOG.md +0 -185
- 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/CHANGELOG.md +0 -557
- package/node_modules/xmlbuilder2/node_modules/js-yaml/LICENSE +0 -21
- package/node_modules/xmlbuilder2/node_modules/js-yaml/README.md +0 -299
- package/node_modules/xmlbuilder2/node_modules/js-yaml/bin/js-yaml.js +0 -132
- package/node_modules/xmlbuilder2/node_modules/js-yaml/dist/js-yaml.js +0 -3989
- 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/common.js +0 -59
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/dumper.js +0 -850
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/exception.js +0 -43
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/loader.js +0 -1644
- 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/core.js +0 -18
- 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/default_safe.js +0 -28
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +0 -17
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/schema/json.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/binary.js +0 -138
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/bool.js +0 -35
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/float.js +0 -116
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/int.js +0 -173
- 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/type/map.js +0 -8
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/merge.js +0 -12
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/null.js +0 -34
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/omap.js +0 -44
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/pairs.js +0 -53
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/seq.js +0 -8
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/set.js +0 -29
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/str.js +0 -8
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +0 -88
- package/node_modules/xmlbuilder2/node_modules/js-yaml/lib/js-yaml/type.js +0 -61
- 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/package.json +0 -82
- package/node_modules/xpath/LICENSE +0 -22
- package/node_modules/xpath/README.md +0 -133
- package/node_modules/xpath/package.json +0 -43
- package/node_modules/xpath/xpath.d.ts +0 -51
- package/node_modules/xpath/xpath.js +0 -5041
|
@@ -1,2758 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
var util_1 = require("@oozcitak/util");
|
|
31
|
-
var interfaces_1 = require("./interfaces");
|
|
32
|
-
var infra_1 = require("@oozcitak/infra");
|
|
33
|
-
var url_1 = require("url");
|
|
34
|
-
var _validationErrorCallback;
|
|
35
|
-
/**
|
|
36
|
-
* Default ports for a special URL scheme.
|
|
37
|
-
*/
|
|
38
|
-
var _defaultPorts = {
|
|
39
|
-
"ftp": 21,
|
|
40
|
-
"file": null,
|
|
41
|
-
"http": 80,
|
|
42
|
-
"https": 443,
|
|
43
|
-
"ws": 80,
|
|
44
|
-
"wss": 443
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* The C0 control percent-encode set are the C0 controls and all code points
|
|
48
|
-
* greater than U+007E (~).
|
|
49
|
-
*/
|
|
50
|
-
var _c0ControlPercentEncodeSet = /[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
51
|
-
/**
|
|
52
|
-
* The fragment percent-encode set is the C0 control percent-encode set and
|
|
53
|
-
* U+0020 SPACE, U+0022 ("), U+003C (<), U+003E (>), and U+0060 (`).
|
|
54
|
-
*/
|
|
55
|
-
var _fragmentPercentEncodeSet = /[ "<>`]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
56
|
-
/**
|
|
57
|
-
* The path percent-encode set is the fragment percent-encode set and
|
|
58
|
-
* U+0023 (#), U+003F (?), U+007B ({), and U+007D (}).
|
|
59
|
-
*/
|
|
60
|
-
var _pathPercentEncodeSet = /[ "<>`#?{}]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
61
|
-
/**
|
|
62
|
-
* The userinfo percent-encode set is the path percent-encode set and
|
|
63
|
-
* U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@), U+005B ([),
|
|
64
|
-
* U+005C (\), U+005D (]), U+005E (^), and U+007C (|).
|
|
65
|
-
*/
|
|
66
|
-
var _userInfoPercentEncodeSet = /[ "<>`#?{}/:;=@\[\]\\\^\|]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
67
|
-
/**
|
|
68
|
-
* The URL code points are ASCII alphanumeric, U+0021 (!), U+0024 ($),
|
|
69
|
-
* U+0026 (&), U+0027 ('), U+0028 LEFT PARENTHESIS, U+0029 RIGHT PARENTHESIS,
|
|
70
|
-
* U+002A (*), U+002B (+), U+002C (,), U+002D (-), U+002E (.), U+002F (/),
|
|
71
|
-
* U+003A (:), U+003B (;), U+003D (=), U+003F (?), U+0040 (@), U+005F (_),
|
|
72
|
-
* U+007E (~), and code points in the range U+00A0 to U+10FFFD, inclusive,
|
|
73
|
-
* excluding surrogates and noncharacters.
|
|
74
|
-
*/
|
|
75
|
-
var _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
|
-
/**
|
|
77
|
-
* A forbidden host code point is U+0000 NULL, U+0009 TAB, U+000A LF,
|
|
78
|
-
* U+000D CR, U+0020 SPACE, U+0023 (#), U+0025 (%), U+002F (/), U+003A (:),
|
|
79
|
-
* U+003F (?), U+0040 (@), U+005B ([), U+005C (\), or U+005D (]).
|
|
80
|
-
*/
|
|
81
|
-
var _forbiddenHostCodePoint = /[\0\t\f\r #%/:?@\[\\\]]/;
|
|
82
|
-
/**
|
|
83
|
-
* Sets the callback function for validation errors.
|
|
84
|
-
*
|
|
85
|
-
* @param validationErrorCallback - a callback function to be called when a
|
|
86
|
-
* validation error occurs
|
|
87
|
-
*/
|
|
88
|
-
function setValidationErrorCallback(validationErrorCallback) {
|
|
89
|
-
_validationErrorCallback = validationErrorCallback;
|
|
90
|
-
}
|
|
91
|
-
exports.setValidationErrorCallback = setValidationErrorCallback;
|
|
92
|
-
/**
|
|
93
|
-
* Generates a validation error.
|
|
94
|
-
*
|
|
95
|
-
* @param message - error message
|
|
96
|
-
*/
|
|
97
|
-
function validationError(message) {
|
|
98
|
-
if (_validationErrorCallback !== undefined) {
|
|
99
|
-
_validationErrorCallback.call(null, "Validation Error: " + message);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Creates a new URL.
|
|
104
|
-
*/
|
|
105
|
-
function newURL() {
|
|
106
|
-
return {
|
|
107
|
-
scheme: '',
|
|
108
|
-
username: '',
|
|
109
|
-
password: '',
|
|
110
|
-
host: null,
|
|
111
|
-
port: null,
|
|
112
|
-
path: [],
|
|
113
|
-
query: null,
|
|
114
|
-
fragment: null,
|
|
115
|
-
_cannotBeABaseURLFlag: false,
|
|
116
|
-
_blobURLEntry: null
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
exports.newURL = newURL;
|
|
120
|
-
/**
|
|
121
|
-
* Determines if the scheme is a special scheme.
|
|
122
|
-
*
|
|
123
|
-
* @param scheme - a scheme
|
|
124
|
-
*/
|
|
125
|
-
function isSpecialScheme(scheme) {
|
|
126
|
-
return (scheme in _defaultPorts);
|
|
127
|
-
}
|
|
128
|
-
exports.isSpecialScheme = isSpecialScheme;
|
|
129
|
-
/**
|
|
130
|
-
* Determines if the URL has a special scheme.
|
|
131
|
-
*
|
|
132
|
-
* @param url - an URL
|
|
133
|
-
*/
|
|
134
|
-
function isSpecial(url) {
|
|
135
|
-
return isSpecialScheme(url.scheme);
|
|
136
|
-
}
|
|
137
|
-
exports.isSpecial = isSpecial;
|
|
138
|
-
/**
|
|
139
|
-
* Returns the default port for a special scheme.
|
|
140
|
-
*
|
|
141
|
-
* @param scheme - a scheme
|
|
142
|
-
*/
|
|
143
|
-
function defaultPort(scheme) {
|
|
144
|
-
return _defaultPorts[scheme] || null;
|
|
145
|
-
}
|
|
146
|
-
exports.defaultPort = defaultPort;
|
|
147
|
-
/**
|
|
148
|
-
* Determines if the URL has credentials.
|
|
149
|
-
*
|
|
150
|
-
* @param url - an URL
|
|
151
|
-
*/
|
|
152
|
-
function includesCredentials(url) {
|
|
153
|
-
return url.username !== '' || url.password !== '';
|
|
154
|
-
}
|
|
155
|
-
exports.includesCredentials = includesCredentials;
|
|
156
|
-
/**
|
|
157
|
-
* Determines if an URL cannot have credentials.
|
|
158
|
-
*
|
|
159
|
-
* @param url - an URL
|
|
160
|
-
*/
|
|
161
|
-
function cannotHaveAUsernamePasswordPort(url) {
|
|
162
|
-
/**
|
|
163
|
-
* A URL cannot have a username/password/port if its host is null or the
|
|
164
|
-
* empty string, its cannot-be-a-base-URL flag is set, or its scheme is
|
|
165
|
-
* "file".
|
|
166
|
-
*/
|
|
167
|
-
return (url.host === null || url.host === "" || url._cannotBeABaseURLFlag ||
|
|
168
|
-
url.scheme === "file");
|
|
169
|
-
}
|
|
170
|
-
exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
|
|
171
|
-
/**
|
|
172
|
-
* Serializes an URL into a string.
|
|
173
|
-
*
|
|
174
|
-
* @param url - an URL
|
|
175
|
-
*/
|
|
176
|
-
function urlSerializer(url, excludeFragmentFlag) {
|
|
177
|
-
var e_1, _a;
|
|
178
|
-
if (excludeFragmentFlag === void 0) { excludeFragmentFlag = false; }
|
|
179
|
-
/**
|
|
180
|
-
* 1. Let output be url’s scheme and U+003A (:) concatenated.
|
|
181
|
-
*/
|
|
182
|
-
var output = url.scheme + ':';
|
|
183
|
-
/**
|
|
184
|
-
* 2. If url’s host is non-null:
|
|
185
|
-
*/
|
|
186
|
-
if (url.host !== null) {
|
|
187
|
-
/**
|
|
188
|
-
* 2.1. Append "//" to output.
|
|
189
|
-
*/
|
|
190
|
-
output += '//';
|
|
191
|
-
/**
|
|
192
|
-
* 2.2. If url includes credentials, then:
|
|
193
|
-
*/
|
|
194
|
-
if (includesCredentials(url)) {
|
|
195
|
-
/**
|
|
196
|
-
* 2.2.1. Append url’s username to output.
|
|
197
|
-
* 2.2.2. If url’s password is not the empty string, then append U+003A (:),
|
|
198
|
-
* followed by url’s password, to output.
|
|
199
|
-
* 2.2.3. Append U+0040 (@) to output.
|
|
200
|
-
*/
|
|
201
|
-
output += url.username;
|
|
202
|
-
if (url.password !== '') {
|
|
203
|
-
output += ':' + url.password;
|
|
204
|
-
}
|
|
205
|
-
output += '@';
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* 2.3. Append url’s host, serialized, to output.
|
|
209
|
-
* 2.4. If url’s port is non-null, append U+003A (:) followed by url’s port,
|
|
210
|
-
* serialized, to output.
|
|
211
|
-
*/
|
|
212
|
-
output += hostSerializer(url.host);
|
|
213
|
-
if (url.port !== null) {
|
|
214
|
-
output += ':' + url.port;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
else if (url.host === null && url.scheme === "file") {
|
|
218
|
-
/**
|
|
219
|
-
* 3. Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output.
|
|
220
|
-
*/
|
|
221
|
-
output += '//';
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* 4. If url’s cannot-be-a-base-URL flag is set, append url’s path[0] to
|
|
225
|
-
* output.
|
|
226
|
-
* 5. Otherwise, then for each string in url’s path, append U+002F (/)
|
|
227
|
-
* followed by the string to output.
|
|
228
|
-
*/
|
|
229
|
-
if (url._cannotBeABaseURLFlag) {
|
|
230
|
-
output += url.path[0];
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
try {
|
|
234
|
-
for (var _b = __values(url.path), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
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; }
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* 6. If url’s query is non-null, append U+003F (?), followed by url’s
|
|
249
|
-
* query, to output.
|
|
250
|
-
* 7. If the exclude fragment flag is unset and url’s fragment is non-null,
|
|
251
|
-
* append U+0023 (#), followed by url’s fragment, to output.
|
|
252
|
-
* 8. Return output.
|
|
253
|
-
*/
|
|
254
|
-
if (url.query !== null) {
|
|
255
|
-
output += '?' + url.query;
|
|
256
|
-
}
|
|
257
|
-
if (!excludeFragmentFlag && url.fragment !== null) {
|
|
258
|
-
output += '#' + url.fragment;
|
|
259
|
-
}
|
|
260
|
-
return output;
|
|
261
|
-
}
|
|
262
|
-
exports.urlSerializer = urlSerializer;
|
|
263
|
-
/**
|
|
264
|
-
* Serializes a host into a string.
|
|
265
|
-
*
|
|
266
|
-
* @param host - a host
|
|
267
|
-
*/
|
|
268
|
-
function hostSerializer(host) {
|
|
269
|
-
/**
|
|
270
|
-
* 1. If host is an IPv4 address, return the result of running the IPv4
|
|
271
|
-
* serializer on host.
|
|
272
|
-
* 2. Otherwise, if host is an IPv6 address, return U+005B ([), followed
|
|
273
|
-
* by the result of running the IPv6 serializer on host, followed by
|
|
274
|
-
* U+005D (]).
|
|
275
|
-
* 3. Otherwise, host is a domain, opaque host, or empty host, return host.
|
|
276
|
-
*/
|
|
277
|
-
if (util_1.isNumber(host)) {
|
|
278
|
-
return iPv4Serializer(host);
|
|
279
|
-
}
|
|
280
|
-
else if (util_1.isArray(host)) {
|
|
281
|
-
return '[' + iPv6Serializer(host) + ']';
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
return host;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
exports.hostSerializer = hostSerializer;
|
|
288
|
-
/**
|
|
289
|
-
* Serializes an IPv4 address into a string.
|
|
290
|
-
*
|
|
291
|
-
* @param address - an IPv4 address
|
|
292
|
-
*/
|
|
293
|
-
function iPv4Serializer(address) {
|
|
294
|
-
/**
|
|
295
|
-
* 1. Let output be the empty string.
|
|
296
|
-
* 2. Let n be the value of address.
|
|
297
|
-
* 3. For each i in the range 1 to 4, inclusive:
|
|
298
|
-
* 3.1. Prepend n % 256, serialized, to output.
|
|
299
|
-
* 3.2. If i is not 4, then prepend U+002E (.) to output.
|
|
300
|
-
* 3.3. Set n to floor(n / 256).
|
|
301
|
-
* 4. Return output.
|
|
302
|
-
*/
|
|
303
|
-
var output = "";
|
|
304
|
-
var n = address;
|
|
305
|
-
for (var i = 1; i <= 4; i++) {
|
|
306
|
-
output = (n % 256).toString() + output;
|
|
307
|
-
if (i !== 4) {
|
|
308
|
-
output = '.' + output;
|
|
309
|
-
}
|
|
310
|
-
n = Math.floor(n / 256);
|
|
311
|
-
}
|
|
312
|
-
return output;
|
|
313
|
-
}
|
|
314
|
-
exports.iPv4Serializer = iPv4Serializer;
|
|
315
|
-
/**
|
|
316
|
-
* Serializes an IPv6 address into a string.
|
|
317
|
-
*
|
|
318
|
-
* @param address - an IPv6 address represented as a list of eight numbers
|
|
319
|
-
*/
|
|
320
|
-
function iPv6Serializer(address) {
|
|
321
|
-
/**
|
|
322
|
-
* 1. Let output be the empty string.
|
|
323
|
-
* 2. Let compress be an index to the first IPv6 piece in the first longest
|
|
324
|
-
* sequences of address’s IPv6 pieces that are 0.
|
|
325
|
-
* In 0:f:0:0:f:f:0:0 it would point to the second 0.
|
|
326
|
-
* 3. If there is no sequence of address’s IPv6 pieces that are 0 that is
|
|
327
|
-
* longer than 1, then set compress to null.
|
|
328
|
-
*/
|
|
329
|
-
var output = "";
|
|
330
|
-
var compress = null;
|
|
331
|
-
var lastIndex = -1;
|
|
332
|
-
var count = 0;
|
|
333
|
-
var lastCount = 0;
|
|
334
|
-
for (var i = 0; i < 8; i++) {
|
|
335
|
-
if (address[i] !== 0)
|
|
336
|
-
continue;
|
|
337
|
-
count = 1;
|
|
338
|
-
for (var j = i + 1; j < 8; j++) {
|
|
339
|
-
if (address[j] !== 0)
|
|
340
|
-
break;
|
|
341
|
-
count++;
|
|
342
|
-
continue;
|
|
343
|
-
}
|
|
344
|
-
if (count > lastCount) {
|
|
345
|
-
lastCount = count;
|
|
346
|
-
lastIndex = i;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (lastCount > 1)
|
|
350
|
-
compress = lastIndex;
|
|
351
|
-
/**
|
|
352
|
-
* 4. Let ignore0 be false.
|
|
353
|
-
* 5. For each pieceIndex in the range 0 to 7, inclusive:
|
|
354
|
-
*/
|
|
355
|
-
var ignore0 = false;
|
|
356
|
-
for (var pieceIndex = 0; pieceIndex < 8; pieceIndex++) {
|
|
357
|
-
/**
|
|
358
|
-
* 5.1. If ignore0 is true and address[pieceIndex] is 0, then continue.
|
|
359
|
-
* 5.2. Otherwise, if ignore0 is true, set ignore0 to false.
|
|
360
|
-
* 5.3. If compress is pieceIndex, then:
|
|
361
|
-
*/
|
|
362
|
-
if (ignore0 && address[pieceIndex] === 0)
|
|
363
|
-
continue;
|
|
364
|
-
if (ignore0)
|
|
365
|
-
ignore0 = false;
|
|
366
|
-
if (compress === pieceIndex) {
|
|
367
|
-
/**
|
|
368
|
-
* 5.3.1. Let separator be "::" if pieceIndex is 0, and U+003A (:) otherwise.
|
|
369
|
-
* 5.3.2. Append separator to output.
|
|
370
|
-
* 5.3.3. Set ignore0 to true and continue.
|
|
371
|
-
*/
|
|
372
|
-
output += (pieceIndex === 0 ? '::' : ':');
|
|
373
|
-
ignore0 = true;
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* 5.4. Append address[pieceIndex], represented as the shortest possible
|
|
378
|
-
* lowercase hexadecimal number, to output.
|
|
379
|
-
* 5.5. If pieceIndex is not 7, then append U+003A (:) to output.
|
|
380
|
-
*/
|
|
381
|
-
output += address[pieceIndex].toString(16);
|
|
382
|
-
if (pieceIndex !== 7)
|
|
383
|
-
output += ':';
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* 6. Return output.
|
|
387
|
-
*/
|
|
388
|
-
return output;
|
|
389
|
-
}
|
|
390
|
-
exports.iPv6Serializer = iPv6Serializer;
|
|
391
|
-
/**
|
|
392
|
-
* Parses an URL string.
|
|
393
|
-
*
|
|
394
|
-
* @param input - input string
|
|
395
|
-
* @param baseURL - base URL
|
|
396
|
-
* @param encodingOverride - encoding override
|
|
397
|
-
*/
|
|
398
|
-
function urlParser(input, baseURL, encodingOverride) {
|
|
399
|
-
/**
|
|
400
|
-
* 1. Let url be the result of running the basic URL parser on input with
|
|
401
|
-
* base, and encoding override as provided.
|
|
402
|
-
* 2. If url is failure, return failure.
|
|
403
|
-
* 3. If url’s scheme is not "blob", return url.
|
|
404
|
-
* 4. Set url’s blob URL entry to the result of resolving the blob URL url,
|
|
405
|
-
* if that did not return failure, and null otherwise.
|
|
406
|
-
* 5. Return url.
|
|
407
|
-
*/
|
|
408
|
-
var url = basicURLParser(input, baseURL, encodingOverride);
|
|
409
|
-
if (url === null)
|
|
410
|
-
return null;
|
|
411
|
-
if (url.scheme !== "blob")
|
|
412
|
-
return url;
|
|
413
|
-
var entry = resolveABlobURL(url);
|
|
414
|
-
if (entry !== null) {
|
|
415
|
-
url._blobURLEntry = entry;
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
url._blobURLEntry = null;
|
|
419
|
-
}
|
|
420
|
-
return url;
|
|
421
|
-
}
|
|
422
|
-
exports.urlParser = urlParser;
|
|
423
|
-
/**
|
|
424
|
-
* Parses an URL string.
|
|
425
|
-
*
|
|
426
|
-
* @param input - input string
|
|
427
|
-
* @param baseURL - base URL
|
|
428
|
-
* @param encodingOverride - encoding override
|
|
429
|
-
*/
|
|
430
|
-
function basicURLParser(input, baseURL, encodingOverride, url, stateOverride) {
|
|
431
|
-
var e_2, _a, e_3, _b;
|
|
432
|
-
/**
|
|
433
|
-
* 1. If url is not given:
|
|
434
|
-
* 1.1. Set url to a new URL.
|
|
435
|
-
* 1.2. If input contains any leading or trailing C0 control or space,
|
|
436
|
-
* validation error.
|
|
437
|
-
* 1.3. Remove any leading and trailing C0 control or space from input.
|
|
438
|
-
*/
|
|
439
|
-
if (url === undefined) {
|
|
440
|
-
url = newURL();
|
|
441
|
-
// leading
|
|
442
|
-
var leadingControlOrSpace = /^[\u0000-\u001F\u0020]+/;
|
|
443
|
-
var trailingControlOrSpace = /[\u0000-\u001F\u0020]+$/;
|
|
444
|
-
if (leadingControlOrSpace.test(input) || trailingControlOrSpace.test(input)) {
|
|
445
|
-
validationError("Input string contains leading or trailing control characters or space.");
|
|
446
|
-
}
|
|
447
|
-
input = input.replace(leadingControlOrSpace, '');
|
|
448
|
-
input = input.replace(trailingControlOrSpace, '');
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* 2. If input contains any ASCII tab or newline, validation error.
|
|
452
|
-
* 3. Remove all ASCII tab or newline from input.
|
|
453
|
-
*/
|
|
454
|
-
var tabOrNewline = /[\u0009\u000A\u000D]/g;
|
|
455
|
-
if (tabOrNewline.test(input)) {
|
|
456
|
-
validationError("Input string contains tab or newline characters.");
|
|
457
|
-
}
|
|
458
|
-
input = input.replace(tabOrNewline, '');
|
|
459
|
-
/**
|
|
460
|
-
* 4. Let state be state override if given, or scheme start state otherwise.
|
|
461
|
-
* 5. If base is not given, set it to null.
|
|
462
|
-
* 6. Let encoding be UTF-8.
|
|
463
|
-
* 7. If encoding override is given, set encoding to the result of getting
|
|
464
|
-
* an output encoding from encoding override.
|
|
465
|
-
*/
|
|
466
|
-
var state = (stateOverride === undefined ? interfaces_1.ParserState.SchemeStart : stateOverride);
|
|
467
|
-
if (baseURL === undefined)
|
|
468
|
-
baseURL = null;
|
|
469
|
-
var encoding = (encodingOverride === undefined ||
|
|
470
|
-
encodingOverride === "replacement" || encodingOverride === "UTF-16BE" ||
|
|
471
|
-
encodingOverride === "UTF-16LE" ? "UTF-8" : encodingOverride);
|
|
472
|
-
/**
|
|
473
|
-
* 8. Let buffer be the empty string.
|
|
474
|
-
* 9. Let the @ flag, [] flag, and passwordTokenSeenFlag be unset.
|
|
475
|
-
* 10. Let pointer be a pointer to first code point in input.
|
|
476
|
-
*/
|
|
477
|
-
var buffer = "";
|
|
478
|
-
var atFlag = false;
|
|
479
|
-
var arrayFlag = false;
|
|
480
|
-
var passwordTokenSeenFlag = false;
|
|
481
|
-
var EOF = "";
|
|
482
|
-
var walker = new util_1.StringWalker(input);
|
|
483
|
-
/**
|
|
484
|
-
* 11. Keep running the following state machine by switching on state. If
|
|
485
|
-
* after a run pointer points to the EOF code point, go to the next step.
|
|
486
|
-
* Otherwise, increase pointer by one and continue with the state machine.
|
|
487
|
-
*/
|
|
488
|
-
while (true) {
|
|
489
|
-
switch (state) {
|
|
490
|
-
case interfaces_1.ParserState.SchemeStart:
|
|
491
|
-
/**
|
|
492
|
-
* 1. If c is an ASCII alpha, append c, lowercased, to buffer, and set
|
|
493
|
-
* state to scheme state.
|
|
494
|
-
* 2. Otherwise, if state override is not given, set state to no scheme
|
|
495
|
-
* state, and decrease pointer by one.
|
|
496
|
-
* 3. Otherwise, validation error, return failure.
|
|
497
|
-
*/
|
|
498
|
-
if (infra_1.codePoint.ASCIIAlpha.test(walker.c())) {
|
|
499
|
-
buffer += walker.c().toLowerCase();
|
|
500
|
-
state = interfaces_1.ParserState.Scheme;
|
|
501
|
-
}
|
|
502
|
-
else if (stateOverride === undefined) {
|
|
503
|
-
state = interfaces_1.ParserState.NoScheme;
|
|
504
|
-
walker.pointer--;
|
|
505
|
-
}
|
|
506
|
-
else {
|
|
507
|
-
validationError("Invalid scheme start character.");
|
|
508
|
-
return null;
|
|
509
|
-
}
|
|
510
|
-
break;
|
|
511
|
-
case interfaces_1.ParserState.Scheme:
|
|
512
|
-
/**
|
|
513
|
-
* 1. If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E
|
|
514
|
-
* (.), append c, lowercased, to buffer.
|
|
515
|
-
*/
|
|
516
|
-
if (infra_1.codePoint.ASCIIAlphanumeric.test(walker.c()) ||
|
|
517
|
-
walker.c() === '+' || walker.c() === '-' || walker.c() === '.') {
|
|
518
|
-
buffer += walker.c().toLowerCase();
|
|
519
|
-
}
|
|
520
|
-
else if (walker.c() === ':') {
|
|
521
|
-
/**
|
|
522
|
-
* 2. Otherwise, if c is U+003A (:), then:
|
|
523
|
-
* 2.1. If state override is given, then:
|
|
524
|
-
* 2.1.1. If url’s scheme is a special scheme and buffer is not a
|
|
525
|
-
* special scheme, then return.
|
|
526
|
-
* 2.1.2. If url’s scheme is not a special scheme and buffer is a
|
|
527
|
-
* special scheme, then return.
|
|
528
|
-
* 2.1.3. If url includes credentials or has a non-null port, and
|
|
529
|
-
* buffer is "file", then return.
|
|
530
|
-
* 2.1.4. If url’s scheme is "file" and its host is an empty host or
|
|
531
|
-
* null, then return.
|
|
532
|
-
*/
|
|
533
|
-
if (stateOverride !== undefined) {
|
|
534
|
-
if (isSpecialScheme(url.scheme) && !isSpecialScheme(buffer))
|
|
535
|
-
return url;
|
|
536
|
-
if (!isSpecialScheme(url.scheme) && isSpecialScheme(buffer))
|
|
537
|
-
return url;
|
|
538
|
-
if ((includesCredentials(url) || url.port !== null) && buffer === "file")
|
|
539
|
-
return url;
|
|
540
|
-
if (url.scheme === "file" && (url.host === "" || url.host === null))
|
|
541
|
-
return url;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* 2.2. Set url’s scheme to buffer.
|
|
545
|
-
*/
|
|
546
|
-
url.scheme = buffer;
|
|
547
|
-
/**
|
|
548
|
-
* 2.3. If state override is given, then:
|
|
549
|
-
* 2.3.1. If url’s port is url’s scheme’s default port, then set
|
|
550
|
-
* url’s port to null.
|
|
551
|
-
* 2.3.2. Return.
|
|
552
|
-
*/
|
|
553
|
-
if (stateOverride !== undefined) {
|
|
554
|
-
if (url.port === defaultPort(url.scheme)) {
|
|
555
|
-
url.port = null;
|
|
556
|
-
}
|
|
557
|
-
return url;
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* 2.4. Set buffer to the empty string.
|
|
561
|
-
*/
|
|
562
|
-
buffer = "";
|
|
563
|
-
if (url.scheme === "file") {
|
|
564
|
-
/**
|
|
565
|
-
* 2.5. If url’s scheme is "file", then:
|
|
566
|
-
* 2.5.1. If remaining does not start with "//", validation error.
|
|
567
|
-
* 2.5.2. Set state to file state.
|
|
568
|
-
*/
|
|
569
|
-
if (!walker.remaining().startsWith("//")) {
|
|
570
|
-
validationError("Invalid file URL scheme, '//' expected.");
|
|
571
|
-
}
|
|
572
|
-
state = interfaces_1.ParserState.File;
|
|
573
|
-
}
|
|
574
|
-
else if (isSpecial(url) && baseURL !== null && baseURL.scheme === url.scheme) {
|
|
575
|
-
/**
|
|
576
|
-
* 2.6. Otherwise, if url is special, base is non-null, and base’s
|
|
577
|
-
* scheme is equal to url’s scheme, set state to special relative
|
|
578
|
-
* or authority state.
|
|
579
|
-
*/
|
|
580
|
-
state = interfaces_1.ParserState.SpecialRelativeOrAuthority;
|
|
581
|
-
}
|
|
582
|
-
else if (isSpecial(url)) {
|
|
583
|
-
/**
|
|
584
|
-
* 2.7. Otherwise, if url is special, set state to special
|
|
585
|
-
* authority slashes state.
|
|
586
|
-
*/
|
|
587
|
-
state = interfaces_1.ParserState.SpecialAuthoritySlashes;
|
|
588
|
-
}
|
|
589
|
-
else if (walker.remaining().startsWith("/")) {
|
|
590
|
-
/**
|
|
591
|
-
* 2.8. Otherwise, if remaining starts with an U+002F (/), set state
|
|
592
|
-
* to path or authority state and increase pointer by one.
|
|
593
|
-
*/
|
|
594
|
-
state = interfaces_1.ParserState.PathOrAuthority;
|
|
595
|
-
walker.pointer++;
|
|
596
|
-
}
|
|
597
|
-
else {
|
|
598
|
-
/**
|
|
599
|
-
* 2.9. Otherwise, set url’s cannot-be-a-base-URL flag, append an
|
|
600
|
-
* empty string to url’s path, and set state to
|
|
601
|
-
* cannot-be-a-base-URL path state.
|
|
602
|
-
*/
|
|
603
|
-
url._cannotBeABaseURLFlag = true;
|
|
604
|
-
url.path.push("");
|
|
605
|
-
state = interfaces_1.ParserState.CannotBeABaseURLPath;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
else if (stateOverride === undefined) {
|
|
609
|
-
/**
|
|
610
|
-
* 3. Otherwise, if state override is not given, set buffer to the
|
|
611
|
-
* empty string, state to no scheme state, and start over (from the
|
|
612
|
-
* first code point in input).
|
|
613
|
-
*/
|
|
614
|
-
buffer = "";
|
|
615
|
-
state = interfaces_1.ParserState.NoScheme;
|
|
616
|
-
walker.pointer = 0;
|
|
617
|
-
continue;
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
/**
|
|
621
|
-
* 4. Otherwise, validation error, return failure.
|
|
622
|
-
*/
|
|
623
|
-
validationError("Invalid input string.");
|
|
624
|
-
return null;
|
|
625
|
-
}
|
|
626
|
-
break;
|
|
627
|
-
case interfaces_1.ParserState.NoScheme:
|
|
628
|
-
/**
|
|
629
|
-
* 1. If base is null, or base’s cannot-be-a-base-URL flag is set
|
|
630
|
-
* and c is not U+0023 (#), validation error, return failure.
|
|
631
|
-
* 2. Otherwise, if base’s cannot-be-a-base-URL flag is set and
|
|
632
|
-
* c is U+0023 (#), set url’s scheme to base’s scheme, url’s path to
|
|
633
|
-
* a copy of base’s path, url’s query to base’s query, url’s
|
|
634
|
-
* fragment to the empty string, set url’s cannot-be-a-base-URL
|
|
635
|
-
* flag, and set state to fragment state.
|
|
636
|
-
* 3. Otherwise, if base’s scheme is not "file", set state to
|
|
637
|
-
* relative state and decrease pointer by one.
|
|
638
|
-
* 4. Otherwise, set state to file state and decrease pointer by one.
|
|
639
|
-
*/
|
|
640
|
-
if (baseURL === null || (baseURL._cannotBeABaseURLFlag && walker.c() !== '#')) {
|
|
641
|
-
validationError("Invalid input string.");
|
|
642
|
-
return null;
|
|
643
|
-
}
|
|
644
|
-
else if (baseURL._cannotBeABaseURLFlag && walker.c() === '#') {
|
|
645
|
-
url.scheme = baseURL.scheme;
|
|
646
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
647
|
-
url.query = baseURL.query;
|
|
648
|
-
url.fragment = "";
|
|
649
|
-
url._cannotBeABaseURLFlag = true;
|
|
650
|
-
state = interfaces_1.ParserState.Fragment;
|
|
651
|
-
}
|
|
652
|
-
else if (baseURL.scheme !== "file") {
|
|
653
|
-
state = interfaces_1.ParserState.Relative;
|
|
654
|
-
walker.pointer--;
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
state = interfaces_1.ParserState.File;
|
|
658
|
-
walker.pointer--;
|
|
659
|
-
}
|
|
660
|
-
break;
|
|
661
|
-
case interfaces_1.ParserState.SpecialRelativeOrAuthority:
|
|
662
|
-
/**
|
|
663
|
-
* If c is U+002F (/) and remaining starts with U+002F (/), then set
|
|
664
|
-
* state to special authority ignore slashes state and increase
|
|
665
|
-
* pointer by one.
|
|
666
|
-
* Otherwise, validation error, set state to relative state and
|
|
667
|
-
* decrease pointer by one.
|
|
668
|
-
*/
|
|
669
|
-
if (walker.c() === '/' && walker.remaining().startsWith('/')) {
|
|
670
|
-
state = interfaces_1.ParserState.SpecialAuthorityIgnoreSlashes;
|
|
671
|
-
walker.pointer++;
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
validationError("Invalid input string.");
|
|
675
|
-
state = interfaces_1.ParserState.Relative;
|
|
676
|
-
walker.pointer--;
|
|
677
|
-
}
|
|
678
|
-
break;
|
|
679
|
-
case interfaces_1.ParserState.PathOrAuthority:
|
|
680
|
-
/**
|
|
681
|
-
* If c is U+002F (/), then set state to authority state.
|
|
682
|
-
* Otherwise, set state to path state, and decrease pointer by one.
|
|
683
|
-
*/
|
|
684
|
-
if (walker.c() === '/') {
|
|
685
|
-
state = interfaces_1.ParserState.Authority;
|
|
686
|
-
}
|
|
687
|
-
else {
|
|
688
|
-
state = interfaces_1.ParserState.Path;
|
|
689
|
-
walker.pointer--;
|
|
690
|
-
}
|
|
691
|
-
break;
|
|
692
|
-
case interfaces_1.ParserState.Relative:
|
|
693
|
-
/**
|
|
694
|
-
* Set url’s scheme to base’s scheme, and then, switching on c:
|
|
695
|
-
*/
|
|
696
|
-
if (baseURL === null) {
|
|
697
|
-
throw new Error("Invalid parser state. Base URL is null.");
|
|
698
|
-
}
|
|
699
|
-
url.scheme = baseURL.scheme;
|
|
700
|
-
switch (walker.c()) {
|
|
701
|
-
case EOF: // EOF
|
|
702
|
-
/**
|
|
703
|
-
* Set url’s username to base’s username, url’s password to base’s
|
|
704
|
-
* password, url’s host to base’s host, url’s port to base’s port,
|
|
705
|
-
* url’s path to a copy of base’s path, and url’s query to base’s
|
|
706
|
-
* query.
|
|
707
|
-
*/
|
|
708
|
-
url.username = baseURL.username;
|
|
709
|
-
url.password = baseURL.password;
|
|
710
|
-
url.host = baseURL.host;
|
|
711
|
-
url.port = baseURL.port;
|
|
712
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
713
|
-
url.query = baseURL.query;
|
|
714
|
-
break;
|
|
715
|
-
case '/':
|
|
716
|
-
/**
|
|
717
|
-
* Set state to relative slash state.
|
|
718
|
-
*/
|
|
719
|
-
state = interfaces_1.ParserState.RelativeSlash;
|
|
720
|
-
break;
|
|
721
|
-
case '?':
|
|
722
|
-
/**
|
|
723
|
-
* Set url’s username to base’s username, url’s password to base’s
|
|
724
|
-
* password, url’s host to base’s host, url’s port to base’s port,
|
|
725
|
-
* url’s path to a copy of base’s path, url’s query to the empty
|
|
726
|
-
* string, and state to query state.
|
|
727
|
-
*/
|
|
728
|
-
url.username = baseURL.username;
|
|
729
|
-
url.password = baseURL.password;
|
|
730
|
-
url.host = baseURL.host;
|
|
731
|
-
url.port = baseURL.port;
|
|
732
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
733
|
-
url.query = "";
|
|
734
|
-
state = interfaces_1.ParserState.Query;
|
|
735
|
-
break;
|
|
736
|
-
case '#':
|
|
737
|
-
/**
|
|
738
|
-
* Set url’s username to base’s username, url’s password to base’s
|
|
739
|
-
* password, url’s host to base’s host, url’s port to base’s port,
|
|
740
|
-
* url’s path to a copy of base’s path, url’s query to base’s
|
|
741
|
-
* query, url’s fragment to the empty string, and state to
|
|
742
|
-
* fragment state.
|
|
743
|
-
*/
|
|
744
|
-
url.username = baseURL.username;
|
|
745
|
-
url.password = baseURL.password;
|
|
746
|
-
url.host = baseURL.host;
|
|
747
|
-
url.port = baseURL.port;
|
|
748
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
749
|
-
url.query = baseURL.query;
|
|
750
|
-
url.fragment = "";
|
|
751
|
-
state = interfaces_1.ParserState.Fragment;
|
|
752
|
-
break;
|
|
753
|
-
default:
|
|
754
|
-
/**
|
|
755
|
-
* If url is special and c is U+005C (\), validation error,
|
|
756
|
-
* set state to relative slash state.
|
|
757
|
-
* Otherwise, run these steps:
|
|
758
|
-
* 1. Set url’s username to base’s username, url’s password to
|
|
759
|
-
* base’s password, url’s host to base’s host, url’s port to
|
|
760
|
-
* base’s port, url’s path to a copy of base’s path, and then
|
|
761
|
-
* remove url’s path’s last item, if any.
|
|
762
|
-
* 2. Set state to path state, and decrease pointer by one.
|
|
763
|
-
*/
|
|
764
|
-
if (isSpecial(url) && walker.c() === '\\') {
|
|
765
|
-
validationError("Invalid input string.");
|
|
766
|
-
state = interfaces_1.ParserState.RelativeSlash;
|
|
767
|
-
}
|
|
768
|
-
else {
|
|
769
|
-
url.username = baseURL.username;
|
|
770
|
-
url.password = baseURL.password;
|
|
771
|
-
url.host = baseURL.host;
|
|
772
|
-
url.port = baseURL.port;
|
|
773
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
774
|
-
if (url.path.length !== 0)
|
|
775
|
-
url.path.splice(url.path.length - 1, 1);
|
|
776
|
-
state = interfaces_1.ParserState.Path;
|
|
777
|
-
walker.pointer--;
|
|
778
|
-
}
|
|
779
|
-
break;
|
|
780
|
-
}
|
|
781
|
-
break;
|
|
782
|
-
case interfaces_1.ParserState.RelativeSlash:
|
|
783
|
-
/**
|
|
784
|
-
* 1. If url is special and c is U+002F (/) or U+005C (\), then:
|
|
785
|
-
* 1.1. If c is U+005C (\), validation error.
|
|
786
|
-
* 1.2. Set state to special authority ignore slashes state.
|
|
787
|
-
* 2. Otherwise, if c is U+002F (/), then set state to authority state.
|
|
788
|
-
* 3. Otherwise, set url’s username to base’s username, url’s password
|
|
789
|
-
* to base’s password, url’s host to base’s host, url’s port to base’s
|
|
790
|
-
* port, state to path state, and then, decrease pointer by one.
|
|
791
|
-
*/
|
|
792
|
-
if (isSpecial(url) && (walker.c() === '/' || walker.c() === '\\')) {
|
|
793
|
-
if (walker.c() === '\\') {
|
|
794
|
-
validationError("Invalid input string.");
|
|
795
|
-
}
|
|
796
|
-
state = interfaces_1.ParserState.SpecialAuthorityIgnoreSlashes;
|
|
797
|
-
}
|
|
798
|
-
else if (walker.c() === '/') {
|
|
799
|
-
state = interfaces_1.ParserState.Authority;
|
|
800
|
-
}
|
|
801
|
-
else {
|
|
802
|
-
if (baseURL === null) {
|
|
803
|
-
throw new Error("Invalid parser state. Base URL is null.");
|
|
804
|
-
}
|
|
805
|
-
url.username = baseURL.username;
|
|
806
|
-
url.password = baseURL.password;
|
|
807
|
-
url.host = baseURL.host;
|
|
808
|
-
url.port = baseURL.port;
|
|
809
|
-
state = interfaces_1.ParserState.Path;
|
|
810
|
-
walker.pointer--;
|
|
811
|
-
}
|
|
812
|
-
break;
|
|
813
|
-
case interfaces_1.ParserState.SpecialAuthoritySlashes:
|
|
814
|
-
/**
|
|
815
|
-
* If c is U+002F (/) and remaining starts with U+002F (/), then set
|
|
816
|
-
* state to special authority ignore slashes state and increase
|
|
817
|
-
* pointer by one.
|
|
818
|
-
* Otherwise, validation error, set state to special authority ignore
|
|
819
|
-
* slashes state, and decrease pointer by one.
|
|
820
|
-
*/
|
|
821
|
-
if (walker.c() === '/' && walker.remaining().startsWith('/')) {
|
|
822
|
-
state = interfaces_1.ParserState.SpecialAuthorityIgnoreSlashes;
|
|
823
|
-
walker.pointer++;
|
|
824
|
-
}
|
|
825
|
-
else {
|
|
826
|
-
validationError("Expected '//'.");
|
|
827
|
-
state = interfaces_1.ParserState.SpecialAuthorityIgnoreSlashes;
|
|
828
|
-
walker.pointer--;
|
|
829
|
-
}
|
|
830
|
-
break;
|
|
831
|
-
case interfaces_1.ParserState.SpecialAuthorityIgnoreSlashes:
|
|
832
|
-
/**
|
|
833
|
-
* If c is neither U+002F (/) nor U+005C (\), then set state to
|
|
834
|
-
* authority state and decrease pointer by one.
|
|
835
|
-
* Otherwise, validation error.
|
|
836
|
-
*/
|
|
837
|
-
if (walker.c() !== '/' && walker.c() !== '\\') {
|
|
838
|
-
state = interfaces_1.ParserState.Authority;
|
|
839
|
-
walker.pointer--;
|
|
840
|
-
}
|
|
841
|
-
else {
|
|
842
|
-
validationError("Unexpected '/' or '\\'.");
|
|
843
|
-
}
|
|
844
|
-
break;
|
|
845
|
-
case interfaces_1.ParserState.Authority:
|
|
846
|
-
/**
|
|
847
|
-
* 1. If c is U+0040 (@), then:
|
|
848
|
-
*/
|
|
849
|
-
if (walker.c() === '@') {
|
|
850
|
-
/**
|
|
851
|
-
* 1.1. Validation error.
|
|
852
|
-
* 1.2. If the @ flag is set, prepend "%40" to buffer.
|
|
853
|
-
* 1.3. Set the @ flag.
|
|
854
|
-
* 1.4. For each codePoint in buffer:
|
|
855
|
-
*/
|
|
856
|
-
validationError("Unexpected '@'.");
|
|
857
|
-
if (atFlag)
|
|
858
|
-
buffer = '%40' + buffer;
|
|
859
|
-
atFlag = true;
|
|
860
|
-
try {
|
|
861
|
-
for (var buffer_1 = (e_2 = void 0, __values(buffer)), buffer_1_1 = buffer_1.next(); !buffer_1_1.done; buffer_1_1 = buffer_1.next()) {
|
|
862
|
-
var codePoint = buffer_1_1.value;
|
|
863
|
-
/**
|
|
864
|
-
* 1.4.1. If codePoint is U+003A (:) and passwordTokenSeenFlag is
|
|
865
|
-
* unset, then set passwordTokenSeenFlag and continue.
|
|
866
|
-
* 1.4.2. Let encodedCodePoints be the result of running UTF-8
|
|
867
|
-
* percent encode codePoint using the userinfo percent-encode set.
|
|
868
|
-
* 1.4.3. If passwordTokenSeenFlag is set, then append
|
|
869
|
-
* encodedCodePoints to url’s password.
|
|
870
|
-
* 1.4.4. Otherwise, append encodedCodePoints to url’s username.
|
|
871
|
-
*/
|
|
872
|
-
if (codePoint === ':' && !passwordTokenSeenFlag) {
|
|
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
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
886
|
-
finally {
|
|
887
|
-
try {
|
|
888
|
-
if (buffer_1_1 && !buffer_1_1.done && (_a = buffer_1.return)) _a.call(buffer_1);
|
|
889
|
-
}
|
|
890
|
-
finally { if (e_2) throw e_2.error; }
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* 1.5. Set buffer to the empty string.
|
|
894
|
-
*/
|
|
895
|
-
buffer = "";
|
|
896
|
-
}
|
|
897
|
-
else if (walker.c() === EOF || walker.c() === '/' || walker.c() === '?' || walker.c() === '#' ||
|
|
898
|
-
(isSpecial(url) && walker.c() === '\\')) {
|
|
899
|
-
/**
|
|
900
|
-
* 2. Otherwise, if one of the following is true
|
|
901
|
-
* - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
|
|
902
|
-
* - url is special and c is U+005C (\)
|
|
903
|
-
* then:
|
|
904
|
-
* 2.1. If @ flag is set and buffer is the empty string, validation
|
|
905
|
-
* error, return failure.
|
|
906
|
-
* 2.2. Decrease pointer by the number of code points in buffer plus
|
|
907
|
-
* one, set buffer to the empty string, and set state to host state.
|
|
908
|
-
*/
|
|
909
|
-
if (atFlag && buffer === "") {
|
|
910
|
-
validationError("Invalid input string.");
|
|
911
|
-
return null;
|
|
912
|
-
}
|
|
913
|
-
walker.pointer -= (buffer.length + 1);
|
|
914
|
-
buffer = "";
|
|
915
|
-
state = interfaces_1.ParserState.Host;
|
|
916
|
-
}
|
|
917
|
-
else {
|
|
918
|
-
/**
|
|
919
|
-
* 3. Otherwise, append c to buffer.
|
|
920
|
-
*/
|
|
921
|
-
buffer += walker.c();
|
|
922
|
-
}
|
|
923
|
-
break;
|
|
924
|
-
case interfaces_1.ParserState.Host:
|
|
925
|
-
case interfaces_1.ParserState.Hostname:
|
|
926
|
-
if (stateOverride !== undefined && url.scheme === "file") {
|
|
927
|
-
/**
|
|
928
|
-
* 1. If state override is given and url’s scheme is "file", then
|
|
929
|
-
* decrease pointer by one and set state to file host state.
|
|
930
|
-
*/
|
|
931
|
-
walker.pointer--;
|
|
932
|
-
state = interfaces_1.ParserState.FileHost;
|
|
933
|
-
}
|
|
934
|
-
else if (walker.c() === ':' && !arrayFlag) {
|
|
935
|
-
/**
|
|
936
|
-
* 2. Otherwise, if c is U+003A (:) and the [] flag is unset, then:
|
|
937
|
-
* 2.1. If buffer is the empty string, validation error, return
|
|
938
|
-
* failure.
|
|
939
|
-
* 2.2. Let host be the result of host parsing buffer with url is
|
|
940
|
-
* not special.
|
|
941
|
-
* 2.3. If host is failure, then return failure.
|
|
942
|
-
* 2.4. Set url’s host to host, buffer to the empty string, and
|
|
943
|
-
* state to port state.
|
|
944
|
-
* 2.5. If state override is given and state override is hostname
|
|
945
|
-
* state, then return.
|
|
946
|
-
*/
|
|
947
|
-
if (buffer === "") {
|
|
948
|
-
validationError("Invalid input string.");
|
|
949
|
-
return null;
|
|
950
|
-
}
|
|
951
|
-
var host = hostParser(buffer, !isSpecial(url));
|
|
952
|
-
if (host === null)
|
|
953
|
-
return null;
|
|
954
|
-
url.host = host;
|
|
955
|
-
buffer = "";
|
|
956
|
-
state = interfaces_1.ParserState.Port;
|
|
957
|
-
if (stateOverride === interfaces_1.ParserState.Hostname)
|
|
958
|
-
return url;
|
|
959
|
-
}
|
|
960
|
-
else if (walker.c() === EOF || walker.c() === '/' || walker.c() === '?' || walker.c() === '#' ||
|
|
961
|
-
(isSpecial(url) && walker.c() === '\\')) {
|
|
962
|
-
/**
|
|
963
|
-
* 3. Otherwise, if one of the following is true
|
|
964
|
-
* - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
|
|
965
|
-
* - url is special and c is U+005C (\)
|
|
966
|
-
* then decrease pointer by one, and then:
|
|
967
|
-
* 3.1. If url is special and buffer is the empty string, validation
|
|
968
|
-
* error, return failure.
|
|
969
|
-
* 3.2. Otherwise, if state override is given, buffer is the empty
|
|
970
|
-
* string, and either url includes credentials or url’s port is
|
|
971
|
-
* non-null, validation error, return.
|
|
972
|
-
* 3.3. Let host be the result of host parsing buffer with url is
|
|
973
|
-
* not special.
|
|
974
|
-
* 3.4. If host is failure, then return failure.
|
|
975
|
-
* 3.5. Set url’s host to host, buffer to the empty string, and
|
|
976
|
-
* state to path start state.
|
|
977
|
-
* 3.6. If state override is given, then return.
|
|
978
|
-
*/
|
|
979
|
-
walker.pointer--;
|
|
980
|
-
if (isSpecial(url) && buffer === "") {
|
|
981
|
-
validationError("Invalid input string.");
|
|
982
|
-
return null;
|
|
983
|
-
}
|
|
984
|
-
else if (stateOverride !== undefined && buffer === "" &&
|
|
985
|
-
(includesCredentials(url) || url.port !== null)) {
|
|
986
|
-
validationError("Invalid input string.");
|
|
987
|
-
return url;
|
|
988
|
-
}
|
|
989
|
-
var host = hostParser(buffer, !isSpecial(url));
|
|
990
|
-
if (host === null)
|
|
991
|
-
return null;
|
|
992
|
-
url.host = host;
|
|
993
|
-
buffer = "";
|
|
994
|
-
state = interfaces_1.ParserState.PathStart;
|
|
995
|
-
if (stateOverride !== undefined)
|
|
996
|
-
return url;
|
|
997
|
-
}
|
|
998
|
-
else {
|
|
999
|
-
/**
|
|
1000
|
-
* 4. Otherwise:
|
|
1001
|
-
* 4.1. If c is U+005B ([), then set the [] flag.
|
|
1002
|
-
* 4.2. If c is U+005D (]), then unset the [] flag.
|
|
1003
|
-
* 4.3. Append c to buffer.
|
|
1004
|
-
*/
|
|
1005
|
-
if (walker.c() === '[')
|
|
1006
|
-
arrayFlag = true;
|
|
1007
|
-
if (walker.c() === ']')
|
|
1008
|
-
arrayFlag = false;
|
|
1009
|
-
buffer += walker.c();
|
|
1010
|
-
}
|
|
1011
|
-
break;
|
|
1012
|
-
case interfaces_1.ParserState.Port:
|
|
1013
|
-
if (infra_1.codePoint.ASCIIDigit.test(walker.c())) {
|
|
1014
|
-
/**
|
|
1015
|
-
* 1. If c is an ASCII digit, append c to buffer.
|
|
1016
|
-
*/
|
|
1017
|
-
buffer += walker.c();
|
|
1018
|
-
}
|
|
1019
|
-
else if (walker.c() === EOF || walker.c() === '/' || walker.c() === '?' || walker.c() === '#' ||
|
|
1020
|
-
(isSpecial(url) && walker.c() === '\\') || stateOverride) {
|
|
1021
|
-
/**
|
|
1022
|
-
* 2. Otherwise, if one of the following is true
|
|
1023
|
-
* - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#)
|
|
1024
|
-
* - url is special and c is U+005C (\)
|
|
1025
|
-
* - state override is given
|
|
1026
|
-
* then:
|
|
1027
|
-
*/
|
|
1028
|
-
if (buffer !== "") {
|
|
1029
|
-
/**
|
|
1030
|
-
* 2.1. If buffer is not the empty string, then:
|
|
1031
|
-
* 2.1.1. Let port be the mathematical integer value that is
|
|
1032
|
-
* represented by buffer in radix-10 using ASCII digits for digits
|
|
1033
|
-
* with values 0 through 9.
|
|
1034
|
-
* 2.1.2. If port is greater than 2**16 − 1, validation error,
|
|
1035
|
-
* return failure.
|
|
1036
|
-
* 2.1.3. Set url’s port to null, if port is url’s scheme’s default
|
|
1037
|
-
* port, and to port otherwise.
|
|
1038
|
-
* 2.1.4. Set buffer to the empty string.
|
|
1039
|
-
*/
|
|
1040
|
-
if (buffer !== "") {
|
|
1041
|
-
var port = parseInt(buffer, 10);
|
|
1042
|
-
if (port > Math.pow(2, 16) - 1) {
|
|
1043
|
-
validationError("Invalid port number.");
|
|
1044
|
-
return null;
|
|
1045
|
-
}
|
|
1046
|
-
url.port = (port === defaultPort(url.scheme) ? null : port);
|
|
1047
|
-
buffer = "";
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
/**
|
|
1051
|
-
* 2.2. If state override is given, then return.
|
|
1052
|
-
* 2.3. Set state to path start state, and decrease pointer by one.
|
|
1053
|
-
*/
|
|
1054
|
-
if (stateOverride !== undefined) {
|
|
1055
|
-
return url;
|
|
1056
|
-
}
|
|
1057
|
-
state = interfaces_1.ParserState.PathStart;
|
|
1058
|
-
walker.pointer--;
|
|
1059
|
-
}
|
|
1060
|
-
else {
|
|
1061
|
-
/**
|
|
1062
|
-
* 3. Otherwise, validation error, return failure.
|
|
1063
|
-
*/
|
|
1064
|
-
validationError("Invalid input string.");
|
|
1065
|
-
return null;
|
|
1066
|
-
}
|
|
1067
|
-
break;
|
|
1068
|
-
case interfaces_1.ParserState.File:
|
|
1069
|
-
/**
|
|
1070
|
-
* 1. Set url’s scheme to "file".
|
|
1071
|
-
*/
|
|
1072
|
-
url.scheme = "file";
|
|
1073
|
-
if (walker.c() === '/' || walker.c() === '\\') {
|
|
1074
|
-
/**
|
|
1075
|
-
* 2. If c is U+002F (/) or U+005C (\), then:
|
|
1076
|
-
* 2.1. If c is U+005C (\), validation error.
|
|
1077
|
-
* 2.2. Set state to file slash state.
|
|
1078
|
-
*/
|
|
1079
|
-
if (walker.c() === '\\') {
|
|
1080
|
-
validationError("Invalid input string.");
|
|
1081
|
-
}
|
|
1082
|
-
state = interfaces_1.ParserState.FileSlash;
|
|
1083
|
-
}
|
|
1084
|
-
else if (baseURL !== null && baseURL.scheme === "file") {
|
|
1085
|
-
/**
|
|
1086
|
-
* 3. Otherwise, if base is non-null and base’s scheme is "file",
|
|
1087
|
-
* switch on c:
|
|
1088
|
-
*/
|
|
1089
|
-
switch (walker.c()) {
|
|
1090
|
-
case EOF:
|
|
1091
|
-
/**
|
|
1092
|
-
* Set url’s host to base’s host, url’s path to a copy of base’s
|
|
1093
|
-
* path, and url’s query to base’s query.
|
|
1094
|
-
*/
|
|
1095
|
-
url.host = baseURL.host;
|
|
1096
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
1097
|
-
url.query = baseURL.query;
|
|
1098
|
-
break;
|
|
1099
|
-
case '?':
|
|
1100
|
-
/**
|
|
1101
|
-
* Set url’s host to base’s host, url’s path to a copy of base’s
|
|
1102
|
-
* path, url’s query to the empty string, and state to query
|
|
1103
|
-
* state.
|
|
1104
|
-
*/
|
|
1105
|
-
url.host = baseURL.host;
|
|
1106
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
1107
|
-
url.query = "";
|
|
1108
|
-
state = interfaces_1.ParserState.Query;
|
|
1109
|
-
break;
|
|
1110
|
-
case '#':
|
|
1111
|
-
/**
|
|
1112
|
-
* Set url’s host to base’s host, url’s path to a copy of base’s
|
|
1113
|
-
* path, url’s query to base’s query, url’s fragment to the
|
|
1114
|
-
* empty string, and state to fragment state.
|
|
1115
|
-
*/
|
|
1116
|
-
url.host = baseURL.host;
|
|
1117
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
1118
|
-
url.query = baseURL.query;
|
|
1119
|
-
url.fragment = "";
|
|
1120
|
-
state = interfaces_1.ParserState.Fragment;
|
|
1121
|
-
break;
|
|
1122
|
-
default:
|
|
1123
|
-
/**
|
|
1124
|
-
* 1. If the substring from pointer in input does not start
|
|
1125
|
-
* with a Windows drive letter, then set url’s host to base’s
|
|
1126
|
-
* host, url’s path to a copy of base’s path, and then shorten
|
|
1127
|
-
* url’s path.
|
|
1128
|
-
* _Note:_ is a (platform-independent) Windows drive letter
|
|
1129
|
-
* quirk.
|
|
1130
|
-
* 2. Otherwise, validation error.
|
|
1131
|
-
* 3. Set state to path state, and decrease pointer by one.
|
|
1132
|
-
*/
|
|
1133
|
-
if (!startsWithAWindowsDriveLetter(walker.substring())) {
|
|
1134
|
-
url.host = baseURL.host;
|
|
1135
|
-
url.path = infra_1.list.clone(baseURL.path);
|
|
1136
|
-
shorten(url);
|
|
1137
|
-
}
|
|
1138
|
-
else {
|
|
1139
|
-
validationError("Unexpected windows drive letter in input string.");
|
|
1140
|
-
}
|
|
1141
|
-
state = interfaces_1.ParserState.Path;
|
|
1142
|
-
walker.pointer--;
|
|
1143
|
-
break;
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
else {
|
|
1147
|
-
/**
|
|
1148
|
-
* 4. Otherwise, set state to path state, and decrease pointer by
|
|
1149
|
-
* one.
|
|
1150
|
-
*/
|
|
1151
|
-
state = interfaces_1.ParserState.Path;
|
|
1152
|
-
walker.pointer--;
|
|
1153
|
-
}
|
|
1154
|
-
break;
|
|
1155
|
-
case interfaces_1.ParserState.FileSlash:
|
|
1156
|
-
if (walker.c() === '/' || walker.c() === '\\') {
|
|
1157
|
-
/**
|
|
1158
|
-
* 1. If c is U+002F (/) or U+005C (\), then:
|
|
1159
|
-
* 1.1. If c is U+005C (\), validation error.
|
|
1160
|
-
* 1.2. Set state to file host state.
|
|
1161
|
-
*/
|
|
1162
|
-
if (walker.c() === '\\') {
|
|
1163
|
-
validationError("Invalid input string.");
|
|
1164
|
-
}
|
|
1165
|
-
state = interfaces_1.ParserState.FileHost;
|
|
1166
|
-
}
|
|
1167
|
-
else {
|
|
1168
|
-
/**
|
|
1169
|
-
* 2. Otherwise:
|
|
1170
|
-
* 2.1. If base is non-null, base’s scheme is "file", and the
|
|
1171
|
-
* substring from pointer in input does not start with a Windows
|
|
1172
|
-
* drive letter, then:
|
|
1173
|
-
* 2.1.1. If base’s path[0] is a normalized Windows drive letter,
|
|
1174
|
-
* then append base’s path[0] to url’s path.
|
|
1175
|
-
* _Note:_ is a (platform-independent) Windows drive letter
|
|
1176
|
-
* quirk. Both url’s and base’s host are null under these conditions
|
|
1177
|
-
* and therefore not copied.
|
|
1178
|
-
* 2.1.2. Otherwise, set url’s host to base’s host.
|
|
1179
|
-
* 2.2. Set state to path state, and decrease pointer by one.
|
|
1180
|
-
*/
|
|
1181
|
-
if (baseURL !== null && baseURL.scheme === "file" &&
|
|
1182
|
-
!startsWithAWindowsDriveLetter(walker.substring())) {
|
|
1183
|
-
if (isNormalizedWindowsDriveLetter(baseURL.path[0])) {
|
|
1184
|
-
url.path.push(baseURL.path[0]);
|
|
1185
|
-
}
|
|
1186
|
-
else {
|
|
1187
|
-
url.host = baseURL.host;
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
state = interfaces_1.ParserState.Path;
|
|
1191
|
-
walker.pointer--;
|
|
1192
|
-
}
|
|
1193
|
-
break;
|
|
1194
|
-
case interfaces_1.ParserState.FileHost:
|
|
1195
|
-
if (walker.c() === EOF || walker.c() === '/' || walker.c() === '\\' ||
|
|
1196
|
-
walker.c() === '?' || walker.c() === '#') {
|
|
1197
|
-
/**
|
|
1198
|
-
* 1. If c is the EOF code point, U+002F (/), U+005C (\), U+003F (?),
|
|
1199
|
-
* or U+0023 (#), then decrease pointer by one and then:
|
|
1200
|
-
*/
|
|
1201
|
-
walker.pointer--;
|
|
1202
|
-
if (stateOverride === undefined && isWindowsDriveLetter(buffer)) {
|
|
1203
|
-
/**
|
|
1204
|
-
* 1.1. If state override is not given and buffer is a Windows drive
|
|
1205
|
-
* letter, validation error, set state to path state.
|
|
1206
|
-
* _Note:_ is a (platform-independent) Windows drive letter
|
|
1207
|
-
* quirk. buffer is not reset here and instead used in the path state.
|
|
1208
|
-
*/
|
|
1209
|
-
validationError("Unexpected windows drive letter in input string.");
|
|
1210
|
-
state = interfaces_1.ParserState.Path;
|
|
1211
|
-
}
|
|
1212
|
-
else if (buffer === "") {
|
|
1213
|
-
/**
|
|
1214
|
-
* 1.2. Otherwise, if buffer is the empty string, then:
|
|
1215
|
-
* 1.2.1. Set url’s host to the empty string.
|
|
1216
|
-
* 1.2.2. If state override is given, then return.
|
|
1217
|
-
* 1.2.3. Set state to path start state.
|
|
1218
|
-
*/
|
|
1219
|
-
url.host = "";
|
|
1220
|
-
if (stateOverride !== undefined)
|
|
1221
|
-
return url;
|
|
1222
|
-
state = interfaces_1.ParserState.PathStart;
|
|
1223
|
-
}
|
|
1224
|
-
else {
|
|
1225
|
-
/**
|
|
1226
|
-
* 1.3. Otherwise, run these steps:
|
|
1227
|
-
* 1.3.1. Let host be the result of host parsing buffer with url
|
|
1228
|
-
* is not special.
|
|
1229
|
-
* 1.3.2. If host is failure, then return failure.
|
|
1230
|
-
* 1.3.3. If host is "localhost", then set host to the empty
|
|
1231
|
-
* string.
|
|
1232
|
-
* 1.3.4. Set url’s host to host.
|
|
1233
|
-
* 1.3.5. If state override is given, then return.
|
|
1234
|
-
* 1.3.6. Set buffer to the empty string and state to path start
|
|
1235
|
-
* state.
|
|
1236
|
-
*/
|
|
1237
|
-
var host = hostParser(buffer, !isSpecial(url));
|
|
1238
|
-
if (host === null)
|
|
1239
|
-
return null;
|
|
1240
|
-
if (host === "localhost")
|
|
1241
|
-
host = "";
|
|
1242
|
-
url.host = host;
|
|
1243
|
-
if (stateOverride !== undefined)
|
|
1244
|
-
return url;
|
|
1245
|
-
buffer = "";
|
|
1246
|
-
state = interfaces_1.ParserState.PathStart;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
else {
|
|
1250
|
-
/**
|
|
1251
|
-
* 2. Otherwise, append c to buffer.
|
|
1252
|
-
*/
|
|
1253
|
-
buffer += walker.c();
|
|
1254
|
-
}
|
|
1255
|
-
break;
|
|
1256
|
-
case interfaces_1.ParserState.PathStart:
|
|
1257
|
-
if (isSpecial(url)) {
|
|
1258
|
-
/**
|
|
1259
|
-
* 1. If url is special, then:
|
|
1260
|
-
* 1.1. If c is U+005C (\), validation error.
|
|
1261
|
-
* 1.2. Set state to path state.
|
|
1262
|
-
* 1.3. If c is neither U+002F (/) nor U+005C (\), then decrease
|
|
1263
|
-
* pointer by one.
|
|
1264
|
-
*/
|
|
1265
|
-
if (walker.c() === '\\') {
|
|
1266
|
-
validationError("Invalid input string.");
|
|
1267
|
-
}
|
|
1268
|
-
state = interfaces_1.ParserState.Path;
|
|
1269
|
-
if (walker.c() !== '/' && walker.c() !== '\\')
|
|
1270
|
-
walker.pointer--;
|
|
1271
|
-
}
|
|
1272
|
-
else if (stateOverride === undefined && walker.c() === '?') {
|
|
1273
|
-
/**
|
|
1274
|
-
* 2. Otherwise, if state override is not given and c is U+003F (?),
|
|
1275
|
-
* set url’s query to the empty string and state to query state.
|
|
1276
|
-
*/
|
|
1277
|
-
url.query = "";
|
|
1278
|
-
state = interfaces_1.ParserState.Query;
|
|
1279
|
-
}
|
|
1280
|
-
else if (stateOverride === undefined && walker.c() === '#') {
|
|
1281
|
-
/**
|
|
1282
|
-
* 3. Otherwise, if state override is not given and c is U+0023 (#),
|
|
1283
|
-
* set url’s fragment to the empty string and state to fragment
|
|
1284
|
-
* state.
|
|
1285
|
-
*/
|
|
1286
|
-
url.fragment = "";
|
|
1287
|
-
state = interfaces_1.ParserState.Fragment;
|
|
1288
|
-
}
|
|
1289
|
-
else if (walker.c() !== EOF) {
|
|
1290
|
-
/**
|
|
1291
|
-
* 4. Otherwise, if c is not the EOF code point:
|
|
1292
|
-
* 4.1. Set state to path state.
|
|
1293
|
-
* 4.2. If c is not U+002F (/), then decrease pointer by one.
|
|
1294
|
-
*/
|
|
1295
|
-
state = interfaces_1.ParserState.Path;
|
|
1296
|
-
if (walker.c() !== '/')
|
|
1297
|
-
walker.pointer--;
|
|
1298
|
-
}
|
|
1299
|
-
break;
|
|
1300
|
-
case interfaces_1.ParserState.Path:
|
|
1301
|
-
if ((walker.c() === EOF || walker.c() === '/') ||
|
|
1302
|
-
(isSpecial(url) && walker.c() === '\\') ||
|
|
1303
|
-
(stateOverride === undefined && (walker.c() === '?' || walker.c() === '#'))) {
|
|
1304
|
-
/**
|
|
1305
|
-
* 1. If one of the following is true
|
|
1306
|
-
* - c is the EOF code point or U+002F (/)
|
|
1307
|
-
* - url is special and c is U+005C (\)
|
|
1308
|
-
* - state override is not given and c is U+003F (?) or U+0023 (#)
|
|
1309
|
-
* then:
|
|
1310
|
-
*/
|
|
1311
|
-
if (isSpecial(url) && walker.c() === '\\') {
|
|
1312
|
-
/**
|
|
1313
|
-
* 1.1 If url is special and c is U+005C (\), validation error.
|
|
1314
|
-
*/
|
|
1315
|
-
validationError("Invalid input string.");
|
|
1316
|
-
}
|
|
1317
|
-
if (isDoubleDotPathSegment(buffer)) {
|
|
1318
|
-
/**
|
|
1319
|
-
* 1.2. If buffer is a double-dot path segment, shorten url’s path,
|
|
1320
|
-
* and then if neither c is U+002F (/), nor url is special and c is
|
|
1321
|
-
* U+005C (\), append the empty string to url’s path.
|
|
1322
|
-
*/
|
|
1323
|
-
shorten(url);
|
|
1324
|
-
if (walker.c() !== '/' && !(isSpecial(url) && walker.c() === '\\')) {
|
|
1325
|
-
url.path.push("");
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
else if (isSingleDotPathSegment(buffer) && walker.c() !== '/' &&
|
|
1329
|
-
!(isSpecial(url) && walker.c() === '\\')) {
|
|
1330
|
-
/**
|
|
1331
|
-
* 1.3. Otherwise, if buffer is a single-dot path segment and if
|
|
1332
|
-
* neither c is U+002F (/), nor url is special and c is U+005C (\),
|
|
1333
|
-
* append the empty string to url’s path.
|
|
1334
|
-
*/
|
|
1335
|
-
url.path.push("");
|
|
1336
|
-
}
|
|
1337
|
-
else if (!isSingleDotPathSegment(buffer)) {
|
|
1338
|
-
/**
|
|
1339
|
-
* 1.4. Otherwise, if buffer is not a single-dot path segment, then:
|
|
1340
|
-
*/
|
|
1341
|
-
if (url.scheme === "file" && url.path.length === 0 &&
|
|
1342
|
-
isWindowsDriveLetter(buffer)) {
|
|
1343
|
-
/**
|
|
1344
|
-
* 1.4.1. If url’s scheme is "file", url’s path is empty, and
|
|
1345
|
-
* buffer is a Windows drive letter, then:
|
|
1346
|
-
* 1.4.1.1. If url’s host is neither the empty string nor null,
|
|
1347
|
-
* validation error, set url’s host to the empty string.
|
|
1348
|
-
* 1.4.1.2. Replace the second code point in buffer with U+003A (:).
|
|
1349
|
-
* _Note:_ is a (platform-independent) Windows drive letter quirk.
|
|
1350
|
-
*/
|
|
1351
|
-
if (url.host !== null && url.host !== "") {
|
|
1352
|
-
validationError("Invalid input string.");
|
|
1353
|
-
url.host = "";
|
|
1354
|
-
}
|
|
1355
|
-
var bufferCodePoints = Array.from(buffer);
|
|
1356
|
-
buffer = bufferCodePoints.slice(0, 1) + ':' + bufferCodePoints.slice(2);
|
|
1357
|
-
}
|
|
1358
|
-
/**
|
|
1359
|
-
* 1.4.2. Append buffer to url’s path.
|
|
1360
|
-
*/
|
|
1361
|
-
url.path.push(buffer);
|
|
1362
|
-
}
|
|
1363
|
-
/**
|
|
1364
|
-
* 1.5. Set buffer to the empty string.
|
|
1365
|
-
*/
|
|
1366
|
-
buffer = "";
|
|
1367
|
-
/**
|
|
1368
|
-
* 1.6. If url’s scheme is "file" and c is the EOF code point,
|
|
1369
|
-
* U+003F (?), or U+0023 (#), then while url’s path’s size is
|
|
1370
|
-
* greater than 1 and url’s path[0] is the empty string, validation
|
|
1371
|
-
* error, remove the first item from url’s path.
|
|
1372
|
-
*/
|
|
1373
|
-
if (url.scheme === "file" && (walker.c() === EOF || walker.c() === '?' || walker.c() === '#')) {
|
|
1374
|
-
while (url.path.length > 1 && url.path[0] === "") {
|
|
1375
|
-
validationError("Invalid input string.");
|
|
1376
|
-
url.path.splice(0, 1);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
/**
|
|
1380
|
-
* 1.7. If c is U+003F (?), then set url’s query to the empty string
|
|
1381
|
-
* and state to query state.
|
|
1382
|
-
* 1.8. If c is U+0023 (#), then set url’s fragment to the empty
|
|
1383
|
-
* string and state to fragment state.
|
|
1384
|
-
*/
|
|
1385
|
-
if (walker.c() === '?') {
|
|
1386
|
-
url.query = "";
|
|
1387
|
-
state = interfaces_1.ParserState.Query;
|
|
1388
|
-
}
|
|
1389
|
-
if (walker.c() === '#') {
|
|
1390
|
-
url.fragment = "";
|
|
1391
|
-
state = interfaces_1.ParserState.Fragment;
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
else {
|
|
1395
|
-
/**
|
|
1396
|
-
* 2. Otherwise, run these steps:
|
|
1397
|
-
* 2.1. If c is not a URL code point and not U+0025 (%), validation
|
|
1398
|
-
* error.
|
|
1399
|
-
* 2.2. If c is U+0025 (%) and remaining does not start with two
|
|
1400
|
-
* ASCII hex digits, validation error.
|
|
1401
|
-
* 2.3. UTF-8 percent encode c using the path percent-encode set,
|
|
1402
|
-
* and append the result to buffer.
|
|
1403
|
-
*/
|
|
1404
|
-
if (!_urlCodePoints.test(walker.c()) && walker.c() !== '%') {
|
|
1405
|
-
validationError("Character is not a URL code point or a percent encoded character.");
|
|
1406
|
-
}
|
|
1407
|
-
if (walker.c() === '%' && !/^[0-9a-fA-F][0-9a-fA-F]/.test(walker.remaining())) {
|
|
1408
|
-
validationError("Percent encoded character must be followed by two hex digits.");
|
|
1409
|
-
}
|
|
1410
|
-
buffer += utf8PercentEncode(walker.c(), _pathPercentEncodeSet);
|
|
1411
|
-
}
|
|
1412
|
-
break;
|
|
1413
|
-
case interfaces_1.ParserState.CannotBeABaseURLPath:
|
|
1414
|
-
/**
|
|
1415
|
-
* 1. If c is U+003F (?), then set url’s query to the empty string and
|
|
1416
|
-
* state to query state.
|
|
1417
|
-
* 2. Otherwise, if c is U+0023 (#), then set url’s fragment to the
|
|
1418
|
-
* empty string and state to fragment state.
|
|
1419
|
-
* 3. Otherwise:
|
|
1420
|
-
* 3.1. If c is not the EOF code point, not a URL code point, and not
|
|
1421
|
-
* U+0025 (%), validation error.
|
|
1422
|
-
* 3.2. If c is U+0025 (%) and remaining does not start with two ASCII
|
|
1423
|
-
* hex digits, validation error.
|
|
1424
|
-
* 3.3. If c is not the EOF code point, UTF-8 percent encode c using
|
|
1425
|
-
* the C0 control percent-encode set, and append the result to url’s
|
|
1426
|
-
* path[0].
|
|
1427
|
-
*/
|
|
1428
|
-
if (walker.c() === '?') {
|
|
1429
|
-
url.query = "";
|
|
1430
|
-
state = interfaces_1.ParserState.Query;
|
|
1431
|
-
}
|
|
1432
|
-
else if (walker.c() === '#') {
|
|
1433
|
-
url.fragment = "";
|
|
1434
|
-
state = interfaces_1.ParserState.Fragment;
|
|
1435
|
-
}
|
|
1436
|
-
else {
|
|
1437
|
-
if (walker.c() !== EOF && !_urlCodePoints.test(walker.c()) && walker.c() !== '%') {
|
|
1438
|
-
validationError("Character is not a URL code point or a percent encoded character.");
|
|
1439
|
-
}
|
|
1440
|
-
if (walker.c() === '%' && !/^[0-9a-fA-F][0-9a-fA-F]/.test(walker.remaining())) {
|
|
1441
|
-
validationError("Percent encoded character must be followed by two hex digits.");
|
|
1442
|
-
}
|
|
1443
|
-
if (walker.c() !== EOF) {
|
|
1444
|
-
url.path[0] += utf8PercentEncode(walker.c(), _c0ControlPercentEncodeSet);
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
break;
|
|
1448
|
-
case interfaces_1.ParserState.Query:
|
|
1449
|
-
/**
|
|
1450
|
-
* 1. If encoding is not UTF-8 and one of the following is true
|
|
1451
|
-
* - url is not special
|
|
1452
|
-
* - url’s scheme is "ws" or "wss"
|
|
1453
|
-
* then set encoding to UTF-8.
|
|
1454
|
-
*/
|
|
1455
|
-
if (encoding !== "UTF-8" && (!isSpecial(url) ||
|
|
1456
|
-
url.scheme === "ws" || url.scheme === "wss")) {
|
|
1457
|
-
encoding = "UTF-8";
|
|
1458
|
-
}
|
|
1459
|
-
if (stateOverride === undefined && walker.c() === '#') {
|
|
1460
|
-
/**
|
|
1461
|
-
* 2. If state override is not given and c is U+0023 (#), then set
|
|
1462
|
-
* url’s fragment to the empty string and state to fragment state.
|
|
1463
|
-
*/
|
|
1464
|
-
url.fragment = "";
|
|
1465
|
-
state = interfaces_1.ParserState.Fragment;
|
|
1466
|
-
}
|
|
1467
|
-
else if (walker.c() !== EOF) {
|
|
1468
|
-
/**
|
|
1469
|
-
* 3. Otherwise, if c is not the EOF code point:
|
|
1470
|
-
* 3.1. If c is not a URL code point and not U+0025 (%), validation
|
|
1471
|
-
* error.
|
|
1472
|
-
*/
|
|
1473
|
-
if (!_urlCodePoints.test(walker.c()) && walker.c() !== '%') {
|
|
1474
|
-
validationError("Character is not a URL code point or a percent encoded character.");
|
|
1475
|
-
}
|
|
1476
|
-
/**
|
|
1477
|
-
* 3.2. If c is U+0025 (%) and remaining does not start with two
|
|
1478
|
-
* ASCII hex digits, validation error.
|
|
1479
|
-
*/
|
|
1480
|
-
if (walker.c() === '%' && !/^[0-9a-fA-F][0-9a-fA-F]/.test(walker.remaining())) {
|
|
1481
|
-
validationError("Percent encoded character must be followed by two hex digits.");
|
|
1482
|
-
}
|
|
1483
|
-
/**
|
|
1484
|
-
* 3.3. Let bytes be the result of encoding c using encoding.
|
|
1485
|
-
*/
|
|
1486
|
-
if (encoding.toUpperCase() !== "UTF-8") {
|
|
1487
|
-
throw new Error("Only UTF-8 encoding is supported.");
|
|
1488
|
-
}
|
|
1489
|
-
var bytes = util_1.utf8Encode(walker.c());
|
|
1490
|
-
/**
|
|
1491
|
-
* 3.4. If bytes starts with `&#` and ends with 0x3B (;), then:
|
|
1492
|
-
*/
|
|
1493
|
-
if (bytes.length >= 3 && bytes[0] === 38 && bytes[1] === 35 &&
|
|
1494
|
-
bytes[bytes.length - 1] === 59) {
|
|
1495
|
-
/**
|
|
1496
|
-
* 3.4.1. Replace `&#` at the start of bytes with `%26%23`.
|
|
1497
|
-
* 3.4.2. Replace 0x3B (;) at the end of bytes with `%3B`.
|
|
1498
|
-
* 3.4.4. Append bytes, isomorphic decoded, to url’s query.
|
|
1499
|
-
* _Note:_ can happen when encoding code points using a
|
|
1500
|
-
* non-UTF-8 encoding.
|
|
1501
|
-
*/
|
|
1502
|
-
bytes = bytes.subarray(2, bytes.length - 1);
|
|
1503
|
-
url.query += "%26%23" + infra_1.byteSequence.isomorphicDecode(bytes) + "%3B";
|
|
1504
|
-
}
|
|
1505
|
-
else {
|
|
1506
|
-
try {
|
|
1507
|
-
/**
|
|
1508
|
-
* 3.5. Otherwise, for each byte in bytes:
|
|
1509
|
-
* 3.5.1. If one of the following is true
|
|
1510
|
-
* - byte is less than 0x21 (!)
|
|
1511
|
-
* - byte is greater than 0x7E (~)
|
|
1512
|
-
* - byte is 0x22 ("), 0x23 (#), 0x3C (<), or 0x3E (>)
|
|
1513
|
-
* - byte is 0x27 (') and url is special
|
|
1514
|
-
* then append byte, percent encoded, to url’s query.
|
|
1515
|
-
* 3.5.2. Otherwise, append a code point whose value is byte to
|
|
1516
|
-
* url’s query.
|
|
1517
|
-
*/
|
|
1518
|
-
for (var bytes_1 = (e_3 = void 0, __values(bytes)), bytes_1_1 = bytes_1.next(); !bytes_1_1.done; bytes_1_1 = bytes_1.next()) {
|
|
1519
|
-
var byte = bytes_1_1.value;
|
|
1520
|
-
if (byte < 0x21 || byte > 0x7E || byte === 0x22 ||
|
|
1521
|
-
byte === 0x23 || byte === 0x3C || byte === 0x3E ||
|
|
1522
|
-
(byte === 0x27 && isSpecial(url))) {
|
|
1523
|
-
url.query += percentEncode(byte);
|
|
1524
|
-
}
|
|
1525
|
-
else {
|
|
1526
|
-
url.query += String.fromCharCode(byte);
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1531
|
-
finally {
|
|
1532
|
-
try {
|
|
1533
|
-
if (bytes_1_1 && !bytes_1_1.done && (_b = bytes_1.return)) _b.call(bytes_1);
|
|
1534
|
-
}
|
|
1535
|
-
finally { if (e_3) throw e_3.error; }
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
break;
|
|
1540
|
-
case interfaces_1.ParserState.Fragment:
|
|
1541
|
-
/**
|
|
1542
|
-
* Switching on c:
|
|
1543
|
-
* - The EOF code point
|
|
1544
|
-
* Do nothing.
|
|
1545
|
-
* - U+0000 NULL
|
|
1546
|
-
* Validation error.
|
|
1547
|
-
* - Otherwise
|
|
1548
|
-
* 1. If c is not a URL code point and not U+0025 (%), validation
|
|
1549
|
-
* error.
|
|
1550
|
-
* 2. If c is U+0025 (%) and remaining does not start with two ASCII
|
|
1551
|
-
* hex digits, validation error.
|
|
1552
|
-
* 3. UTF-8 percent encode c using the fragment percent-encode set and
|
|
1553
|
-
* append the result to url’s fragment.
|
|
1554
|
-
*/
|
|
1555
|
-
if (walker.c() === EOF) {
|
|
1556
|
-
//
|
|
1557
|
-
}
|
|
1558
|
-
else if (walker.c() === "\u0000") {
|
|
1559
|
-
validationError("NULL character in input string.");
|
|
1560
|
-
}
|
|
1561
|
-
else {
|
|
1562
|
-
if (!_urlCodePoints.test(walker.c()) && walker.c() !== '%') {
|
|
1563
|
-
validationError("Unexpected character in fragment string.");
|
|
1564
|
-
}
|
|
1565
|
-
if (walker.c() === '%' && !/^[A-Za-z0-9][A-Za-z0-9]/.test(walker.remaining())) {
|
|
1566
|
-
validationError("Unexpected character in fragment string.");
|
|
1567
|
-
}
|
|
1568
|
-
url.fragment += utf8PercentEncode(walker.c(), _fragmentPercentEncodeSet);
|
|
1569
|
-
}
|
|
1570
|
-
break;
|
|
1571
|
-
}
|
|
1572
|
-
if (walker.eof)
|
|
1573
|
-
break;
|
|
1574
|
-
else
|
|
1575
|
-
walker.pointer++;
|
|
1576
|
-
}
|
|
1577
|
-
/**
|
|
1578
|
-
* 12. Return url.
|
|
1579
|
-
*/
|
|
1580
|
-
return url;
|
|
1581
|
-
}
|
|
1582
|
-
exports.basicURLParser = basicURLParser;
|
|
1583
|
-
/**
|
|
1584
|
-
* Sets a URL's username.
|
|
1585
|
-
*
|
|
1586
|
-
* @param url - a URL
|
|
1587
|
-
* @param username - username string
|
|
1588
|
-
*/
|
|
1589
|
-
function setTheUsername(url, username) {
|
|
1590
|
-
var e_4, _a;
|
|
1591
|
-
/**
|
|
1592
|
-
* 1. Set url’s username to the empty string.
|
|
1593
|
-
* 2. For each code point in username, UTF-8 percent encode it using the
|
|
1594
|
-
* userinfo percent-encode set, and append the result to url’s username.
|
|
1595
|
-
*/
|
|
1596
|
-
var result = "";
|
|
1597
|
-
try {
|
|
1598
|
-
for (var username_1 = __values(username), username_1_1 = username_1.next(); !username_1_1.done; username_1_1 = username_1.next()) {
|
|
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; }
|
|
1609
|
-
}
|
|
1610
|
-
url.username = result;
|
|
1611
|
-
}
|
|
1612
|
-
exports.setTheUsername = setTheUsername;
|
|
1613
|
-
/**
|
|
1614
|
-
* Sets a URL's password.
|
|
1615
|
-
*
|
|
1616
|
-
* @param url - a URL
|
|
1617
|
-
* @param username - password string
|
|
1618
|
-
*/
|
|
1619
|
-
function setThePassword(url, password) {
|
|
1620
|
-
var e_5, _a;
|
|
1621
|
-
/**
|
|
1622
|
-
* 1. Set url’s password to the empty string.
|
|
1623
|
-
* 2. For each code point in password, UTF-8 percent encode it using the
|
|
1624
|
-
* userinfo percent-encode set, and append the result to url’s password.
|
|
1625
|
-
*/
|
|
1626
|
-
var result = "";
|
|
1627
|
-
try {
|
|
1628
|
-
for (var password_1 = __values(password), password_1_1 = password_1.next(); !password_1_1.done; password_1_1 = password_1.next()) {
|
|
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; }
|
|
1639
|
-
}
|
|
1640
|
-
url.password = result;
|
|
1641
|
-
}
|
|
1642
|
-
exports.setThePassword = setThePassword;
|
|
1643
|
-
/**
|
|
1644
|
-
* Determines if the string represents a single dot path.
|
|
1645
|
-
*
|
|
1646
|
-
* @param str - a string
|
|
1647
|
-
*/
|
|
1648
|
-
function isSingleDotPathSegment(str) {
|
|
1649
|
-
return str === '.' || str.toLowerCase() === "%2e";
|
|
1650
|
-
}
|
|
1651
|
-
exports.isSingleDotPathSegment = isSingleDotPathSegment;
|
|
1652
|
-
/**
|
|
1653
|
-
* Determines if the string represents a double dot path.
|
|
1654
|
-
*
|
|
1655
|
-
* @param str - a string
|
|
1656
|
-
*/
|
|
1657
|
-
function isDoubleDotPathSegment(str) {
|
|
1658
|
-
var lowerStr = str.toLowerCase();
|
|
1659
|
-
return lowerStr === ".." || lowerStr === ".%2e" ||
|
|
1660
|
-
lowerStr === "%2e." || lowerStr === "%2e%2e";
|
|
1661
|
-
}
|
|
1662
|
-
exports.isDoubleDotPathSegment = isDoubleDotPathSegment;
|
|
1663
|
-
/**
|
|
1664
|
-
* Shorten's URL's path.
|
|
1665
|
-
*
|
|
1666
|
-
* @param url - an URL
|
|
1667
|
-
*/
|
|
1668
|
-
function shorten(url) {
|
|
1669
|
-
/**
|
|
1670
|
-
* 1. Let path be url’s path.
|
|
1671
|
-
* 2. If path is empty, then return.
|
|
1672
|
-
* 3. If url’s scheme is "file", path’s size is 1, and path[0] is a
|
|
1673
|
-
* normalized Windows drive letter, then return.
|
|
1674
|
-
* 4. Remove path’s last item.
|
|
1675
|
-
*/
|
|
1676
|
-
var path = url.path;
|
|
1677
|
-
if (path.length === 0)
|
|
1678
|
-
return;
|
|
1679
|
-
if (url.scheme === "file" && path.length === 1 &&
|
|
1680
|
-
isNormalizedWindowsDriveLetter(path[0]))
|
|
1681
|
-
return;
|
|
1682
|
-
url.path.splice(url.path.length - 1, 1);
|
|
1683
|
-
}
|
|
1684
|
-
exports.shorten = shorten;
|
|
1685
|
-
/**
|
|
1686
|
-
* Determines if a string is a normalized Windows drive letter.
|
|
1687
|
-
*
|
|
1688
|
-
* @param str - a string
|
|
1689
|
-
*/
|
|
1690
|
-
function isNormalizedWindowsDriveLetter(str) {
|
|
1691
|
-
/**
|
|
1692
|
-
* A normalized Windows drive letter is a Windows drive letter of which the
|
|
1693
|
-
* second code point is U+003A (:).
|
|
1694
|
-
*/
|
|
1695
|
-
return str.length >= 2 && infra_1.codePoint.ASCIIAlpha.test(str[0]) &&
|
|
1696
|
-
str[1] === ':';
|
|
1697
|
-
}
|
|
1698
|
-
exports.isNormalizedWindowsDriveLetter = isNormalizedWindowsDriveLetter;
|
|
1699
|
-
/**
|
|
1700
|
-
* Determines if a string is a Windows drive letter.
|
|
1701
|
-
*
|
|
1702
|
-
* @param str - a string
|
|
1703
|
-
*/
|
|
1704
|
-
function isWindowsDriveLetter(str) {
|
|
1705
|
-
/**
|
|
1706
|
-
* A Windows drive letter is two code points, of which the first is an ASCII
|
|
1707
|
-
* alpha and the second is either U+003A (:) or U+007C (|).
|
|
1708
|
-
*/
|
|
1709
|
-
return str.length >= 2 && infra_1.codePoint.ASCIIAlpha.test(str[0]) &&
|
|
1710
|
-
(str[1] === ':' || str[1] === '|');
|
|
1711
|
-
}
|
|
1712
|
-
exports.isWindowsDriveLetter = isWindowsDriveLetter;
|
|
1713
|
-
/**
|
|
1714
|
-
* Determines if a string starts with a Windows drive letter.
|
|
1715
|
-
*
|
|
1716
|
-
* @param str - a string
|
|
1717
|
-
*/
|
|
1718
|
-
function startsWithAWindowsDriveLetter(str) {
|
|
1719
|
-
/**
|
|
1720
|
-
* A string starts with a Windows drive letter if all of the following are
|
|
1721
|
-
* true:
|
|
1722
|
-
* - its length is greater than or equal to 2
|
|
1723
|
-
* - its first two code points are a Windows drive letter
|
|
1724
|
-
* - its length is 2 or its third code point is U+002F (/), U+005C (\),
|
|
1725
|
-
* U+003F (?), or U+0023 (#).
|
|
1726
|
-
*/
|
|
1727
|
-
return str.length >= 2 && isWindowsDriveLetter(str) &&
|
|
1728
|
-
(str.length === 2 || (str[2] === '/' || str[2] === '\\' ||
|
|
1729
|
-
str[2] === '?' || str[2] === '#'));
|
|
1730
|
-
}
|
|
1731
|
-
exports.startsWithAWindowsDriveLetter = startsWithAWindowsDriveLetter;
|
|
1732
|
-
/**
|
|
1733
|
-
* Parses a host string.
|
|
1734
|
-
*
|
|
1735
|
-
* @param input - input string
|
|
1736
|
-
* @param isNotSpecial - `true` if the source URL is not special; otherwise
|
|
1737
|
-
* `false`.
|
|
1738
|
-
*/
|
|
1739
|
-
function hostParser(input, isNotSpecial) {
|
|
1740
|
-
if (isNotSpecial === void 0) { isNotSpecial = false; }
|
|
1741
|
-
/**
|
|
1742
|
-
* 1. If isNotSpecial is not given, then set isNotSpecial to false.
|
|
1743
|
-
* 2. If input starts with U+005B ([), then:
|
|
1744
|
-
* 2.1. If input does not end with U+005D (]), validation error, return
|
|
1745
|
-
* failure.
|
|
1746
|
-
* 2.2. Return the result of IPv6 parsing input with its leading U+005B ([)
|
|
1747
|
-
* and trailing U+005D (]) removed.
|
|
1748
|
-
*/
|
|
1749
|
-
if (input.startsWith('[')) {
|
|
1750
|
-
if (!input.endsWith(']')) {
|
|
1751
|
-
validationError("Expected ']' after '['.");
|
|
1752
|
-
return null;
|
|
1753
|
-
}
|
|
1754
|
-
return iPv6Parser(input.substring(1, input.length - 1));
|
|
1755
|
-
}
|
|
1756
|
-
/**
|
|
1757
|
-
* 3. If isNotSpecial is true, then return the result of opaque-host parsing
|
|
1758
|
-
* input.
|
|
1759
|
-
*/
|
|
1760
|
-
if (isNotSpecial) {
|
|
1761
|
-
return opaqueHostParser(input);
|
|
1762
|
-
}
|
|
1763
|
-
/**
|
|
1764
|
-
* 4. Let domain be the result of running UTF-8 decode without BOM on the
|
|
1765
|
-
* string percent decoding of input.
|
|
1766
|
-
* _Note:_ Alternatively UTF-8 decode without BOM or fail can be used,
|
|
1767
|
-
* coupled with an early return for failure, as domain to ASCII fails
|
|
1768
|
-
* on U+FFFD REPLACEMENT CHARACTER.
|
|
1769
|
-
*/
|
|
1770
|
-
var domain = util_1.utf8Decode(stringPercentDecode(input));
|
|
1771
|
-
/**
|
|
1772
|
-
* 5. Let asciiDomain be the result of running domain to ASCII on domain.
|
|
1773
|
-
* 6. If asciiDomain is failure, validation error, return failure.
|
|
1774
|
-
* 7. If asciiDomain contains a forbidden host code point, validation error,
|
|
1775
|
-
* return failure.
|
|
1776
|
-
*/
|
|
1777
|
-
var asciiDomain = domainToASCII(domain);
|
|
1778
|
-
if (asciiDomain === null) {
|
|
1779
|
-
validationError("Invalid domain.");
|
|
1780
|
-
return null;
|
|
1781
|
-
}
|
|
1782
|
-
if (_forbiddenHostCodePoint.test(asciiDomain)) {
|
|
1783
|
-
validationError("Invalid domain.");
|
|
1784
|
-
return null;
|
|
1785
|
-
}
|
|
1786
|
-
/**
|
|
1787
|
-
* 8. Let ipv4Host be the result of IPv4 parsing asciiDomain.
|
|
1788
|
-
* 9. If ipv4Host is an IPv4 address or failure, return ipv4Host.
|
|
1789
|
-
* 10. Return asciiDomain.
|
|
1790
|
-
*/
|
|
1791
|
-
var ipv4Host = iPv4Parser(asciiDomain);
|
|
1792
|
-
if (ipv4Host === null || util_1.isNumber(ipv4Host))
|
|
1793
|
-
return ipv4Host;
|
|
1794
|
-
return asciiDomain;
|
|
1795
|
-
}
|
|
1796
|
-
exports.hostParser = hostParser;
|
|
1797
|
-
/**
|
|
1798
|
-
* Parses a string containing an IP v4 address.
|
|
1799
|
-
*
|
|
1800
|
-
* @param input - input string
|
|
1801
|
-
* @param isNotSpecial - `true` if the source URL is not special; otherwise
|
|
1802
|
-
* `false`.
|
|
1803
|
-
*/
|
|
1804
|
-
function iPv4NumberParser(input, validationErrorFlag) {
|
|
1805
|
-
if (validationErrorFlag === void 0) { validationErrorFlag = { value: false }; }
|
|
1806
|
-
/**
|
|
1807
|
-
* 1. Let R be 10.
|
|
1808
|
-
*/
|
|
1809
|
-
var R = 10;
|
|
1810
|
-
if (input.startsWith("0x") || input.startsWith("0X")) {
|
|
1811
|
-
/**
|
|
1812
|
-
* 2. If input contains at least two code points and the first two code
|
|
1813
|
-
* points are either "0x" or "0X", then:
|
|
1814
|
-
* 2.1. Set validationErrorFlag.
|
|
1815
|
-
* 2.2. Remove the first two code points from input.
|
|
1816
|
-
* 2.3. Set R to 16.
|
|
1817
|
-
*/
|
|
1818
|
-
validationErrorFlag.value = true;
|
|
1819
|
-
input = input.substr(2);
|
|
1820
|
-
R = 16;
|
|
1821
|
-
}
|
|
1822
|
-
else if (input.length >= 2 && input[0] === '0') {
|
|
1823
|
-
/**
|
|
1824
|
-
* 3. Otherwise, if input contains at least two code points and the first
|
|
1825
|
-
* code point is U+0030 (0), then:
|
|
1826
|
-
* 3.1. Set validationErrorFlag.
|
|
1827
|
-
* 3.2. Remove the first code point from input.
|
|
1828
|
-
* 3.3. Set R to 8.
|
|
1829
|
-
*/
|
|
1830
|
-
validationErrorFlag.value = true;
|
|
1831
|
-
input = input.substr(1);
|
|
1832
|
-
R = 8;
|
|
1833
|
-
}
|
|
1834
|
-
/**
|
|
1835
|
-
* 4. If input is the empty string, then return zero.
|
|
1836
|
-
* 5. If input contains a code point that is not a radix-R digit, then
|
|
1837
|
-
* return failure.
|
|
1838
|
-
*/
|
|
1839
|
-
if (input === "")
|
|
1840
|
-
return 0;
|
|
1841
|
-
var radixRDigits = (R === 10 ? /^[0-9]+$/ : (R === 16 ? /^[0-9A-Fa-f]+$/ : /^[0-7]+$/));
|
|
1842
|
-
if (!radixRDigits.test(input))
|
|
1843
|
-
return null;
|
|
1844
|
-
/**
|
|
1845
|
-
* 6. Return the mathematical integer value that is represented by input in
|
|
1846
|
-
* radix-R notation, using ASCII hex digits for digits with values
|
|
1847
|
-
* 0 through 15.
|
|
1848
|
-
*/
|
|
1849
|
-
return parseInt(input, R);
|
|
1850
|
-
}
|
|
1851
|
-
exports.iPv4NumberParser = iPv4NumberParser;
|
|
1852
|
-
/**
|
|
1853
|
-
* Parses a string containing an IP v4 address.
|
|
1854
|
-
*
|
|
1855
|
-
* @param input - input string
|
|
1856
|
-
*/
|
|
1857
|
-
function iPv4Parser(input) {
|
|
1858
|
-
var e_6, _a, e_7, _b;
|
|
1859
|
-
/**
|
|
1860
|
-
* 1. Let validationErrorFlag be unset.
|
|
1861
|
-
* 2. Let parts be input split on U+002E (.).
|
|
1862
|
-
*/
|
|
1863
|
-
var validationErrorFlag = { value: false };
|
|
1864
|
-
var parts = input.split('.');
|
|
1865
|
-
/**
|
|
1866
|
-
* 3. If the last item in parts is the empty string, then:
|
|
1867
|
-
* 3.1. Set validationErrorFlag.
|
|
1868
|
-
* 3.2. If parts has more than one item, then remove the last item from
|
|
1869
|
-
* parts.
|
|
1870
|
-
*/
|
|
1871
|
-
if (parts[parts.length - 1] === "") {
|
|
1872
|
-
validationErrorFlag.value = true;
|
|
1873
|
-
if (parts.length > 1)
|
|
1874
|
-
parts.pop();
|
|
1875
|
-
}
|
|
1876
|
-
/**
|
|
1877
|
-
* 4. If parts has more than four items, return input.
|
|
1878
|
-
*/
|
|
1879
|
-
if (parts.length > 4)
|
|
1880
|
-
return input;
|
|
1881
|
-
/**
|
|
1882
|
-
* 5. Let numbers be the empty list.
|
|
1883
|
-
* 6. For each part in parts:
|
|
1884
|
-
* 6.1. If part is the empty string, return input.
|
|
1885
|
-
* 6.2. Let n be the result of parsing part using validationErrorFlag.
|
|
1886
|
-
* 6.3. If n is failure, return input.
|
|
1887
|
-
* 6.4. Append n to numbers.
|
|
1888
|
-
*/
|
|
1889
|
-
var numbers = [];
|
|
1890
|
-
try {
|
|
1891
|
-
for (var parts_1 = __values(parts), parts_1_1 = parts_1.next(); !parts_1_1.done; parts_1_1 = parts_1.next()) {
|
|
1892
|
-
var part = parts_1_1.value;
|
|
1893
|
-
if (part === "")
|
|
1894
|
-
return input;
|
|
1895
|
-
var n = iPv4NumberParser(part, validationErrorFlag);
|
|
1896
|
-
if (n === null)
|
|
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; }
|
|
1907
|
-
}
|
|
1908
|
-
/**
|
|
1909
|
-
* 7. If validationErrorFlag is set, validation error.
|
|
1910
|
-
* 8. If any item in numbers is greater than 255, validation error.
|
|
1911
|
-
* 9. If any but the last item in numbers is greater than 255, return
|
|
1912
|
-
* failure.
|
|
1913
|
-
* 10. If the last item in numbers is greater than or equal to
|
|
1914
|
-
* 256**(5 − the number of items in numbers), validation error, return failure.
|
|
1915
|
-
*/
|
|
1916
|
-
if (validationErrorFlag.value)
|
|
1917
|
-
validationError("Invalid IP v4 address.");
|
|
1918
|
-
for (var i = 0; i < numbers.length; i++) {
|
|
1919
|
-
var item = numbers[i];
|
|
1920
|
-
if (item > 255) {
|
|
1921
|
-
validationError("Invalid IP v4 address.");
|
|
1922
|
-
if (i < numbers.length - 1)
|
|
1923
|
-
return null;
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {
|
|
1927
|
-
validationError("Invalid IP v4 address.");
|
|
1928
|
-
return null;
|
|
1929
|
-
}
|
|
1930
|
-
/**
|
|
1931
|
-
* 11. Let ipv4 be the last item in numbers.
|
|
1932
|
-
* 12. Remove the last item from numbers.
|
|
1933
|
-
*/
|
|
1934
|
-
var ipv4 = numbers[numbers.length - 1];
|
|
1935
|
-
numbers.pop();
|
|
1936
|
-
/**
|
|
1937
|
-
* 13. Let counter be zero.
|
|
1938
|
-
* 14. For each n in numbers:
|
|
1939
|
-
* 14.2. Increment ipv4 by n × 256**(3 − counter).
|
|
1940
|
-
* 14.2. Increment counter by 1.
|
|
1941
|
-
*/
|
|
1942
|
-
var counter = 0;
|
|
1943
|
-
try {
|
|
1944
|
-
for (var numbers_1 = __values(numbers), numbers_1_1 = numbers_1.next(); !numbers_1_1.done; numbers_1_1 = numbers_1.next()) {
|
|
1945
|
-
var n = numbers_1_1.value;
|
|
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; }
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* 15. Return ipv4.
|
|
1959
|
-
*/
|
|
1960
|
-
return ipv4;
|
|
1961
|
-
}
|
|
1962
|
-
exports.iPv4Parser = iPv4Parser;
|
|
1963
|
-
/**
|
|
1964
|
-
* Parses a string containing an IP v6 address.
|
|
1965
|
-
*
|
|
1966
|
-
* @param input - input string
|
|
1967
|
-
*/
|
|
1968
|
-
function iPv6Parser(input) {
|
|
1969
|
-
var _a;
|
|
1970
|
-
/**
|
|
1971
|
-
* 1. Let address be a new IPv6 address whose IPv6 pieces are all 0.
|
|
1972
|
-
* 2. Let pieceIndex be 0.
|
|
1973
|
-
* 3. Let compress be null.
|
|
1974
|
-
* 4. Let pointer be a pointer into input, initially 0 (pointing to the
|
|
1975
|
-
* first code point).
|
|
1976
|
-
*/
|
|
1977
|
-
var EOF = "";
|
|
1978
|
-
var address = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
1979
|
-
var pieceIndex = 0;
|
|
1980
|
-
var compress = null;
|
|
1981
|
-
var walker = new util_1.StringWalker(input);
|
|
1982
|
-
/**
|
|
1983
|
-
* 5. If c is U+003A (:), then:
|
|
1984
|
-
* 5.1. If remaining does not start with U+003A (:), validation error,
|
|
1985
|
-
* return failure.
|
|
1986
|
-
* 5.2. Increase pointer by 2.
|
|
1987
|
-
* 5.3. Increase pieceIndex by 1 and then set compress to pieceIndex.
|
|
1988
|
-
*/
|
|
1989
|
-
if (walker.c() === ':') {
|
|
1990
|
-
if (!walker.remaining().startsWith(':')) {
|
|
1991
|
-
validationError("Invalid IP v6 address.");
|
|
1992
|
-
return null;
|
|
1993
|
-
}
|
|
1994
|
-
walker.pointer += 2;
|
|
1995
|
-
pieceIndex += 1;
|
|
1996
|
-
compress = pieceIndex;
|
|
1997
|
-
}
|
|
1998
|
-
/**
|
|
1999
|
-
* 6. While c is not the EOF code point:
|
|
2000
|
-
*/
|
|
2001
|
-
while (walker.c() !== EOF) {
|
|
2002
|
-
/**
|
|
2003
|
-
* 6.1. If pieceIndex is 8, validation error, return failure.
|
|
2004
|
-
*/
|
|
2005
|
-
if (pieceIndex === 8) {
|
|
2006
|
-
validationError("Invalid IP v6 address.");
|
|
2007
|
-
return null;
|
|
2008
|
-
}
|
|
2009
|
-
/**
|
|
2010
|
-
* 6.2. If c is U+003A (:), then:
|
|
2011
|
-
* 6.2.1. If compress is non-null, validation error, return failure.
|
|
2012
|
-
* 6.2.2. Increase pointer and pieceIndex by 1, set compress to pieceIndex,
|
|
2013
|
-
* and then continue.
|
|
2014
|
-
*/
|
|
2015
|
-
if (walker.c() === ':') {
|
|
2016
|
-
if (compress !== null) {
|
|
2017
|
-
validationError("Invalid IP v6 address.");
|
|
2018
|
-
return null;
|
|
2019
|
-
}
|
|
2020
|
-
walker.pointer++;
|
|
2021
|
-
pieceIndex++;
|
|
2022
|
-
compress = pieceIndex;
|
|
2023
|
-
continue;
|
|
2024
|
-
}
|
|
2025
|
-
/**
|
|
2026
|
-
* 6.3. Let value and length be 0.
|
|
2027
|
-
* 6.4. While length is less than 4 and c is an ASCII hex digit, set value
|
|
2028
|
-
* to value × 0x10 + c interpreted as hexadecimal number, and increase
|
|
2029
|
-
* pointer and length by 1.
|
|
2030
|
-
*/
|
|
2031
|
-
var value = 0;
|
|
2032
|
-
var length = 0;
|
|
2033
|
-
while (length < 4 && infra_1.codePoint.ASCIIHexDigit.test(walker.c())) {
|
|
2034
|
-
value = value * 0x10 + parseInt(walker.c(), 16);
|
|
2035
|
-
walker.pointer++;
|
|
2036
|
-
length++;
|
|
2037
|
-
}
|
|
2038
|
-
/**
|
|
2039
|
-
* 6.5. If c is U+002E (.), then:
|
|
2040
|
-
*/
|
|
2041
|
-
if (walker.c() === '.') {
|
|
2042
|
-
/**
|
|
2043
|
-
* 6.5.1. If length is 0, validation error, return failure.
|
|
2044
|
-
* 6.5.2. Decrease pointer by length.
|
|
2045
|
-
* 6.5.3. If pieceIndex is greater than 6, validation error, return
|
|
2046
|
-
* failure.
|
|
2047
|
-
* 6.5.4. Let numbersSeen be 0.
|
|
2048
|
-
*/
|
|
2049
|
-
if (length === 0) {
|
|
2050
|
-
validationError("Invalid IP v6 address.");
|
|
2051
|
-
return null;
|
|
2052
|
-
}
|
|
2053
|
-
walker.pointer -= length;
|
|
2054
|
-
if (pieceIndex > 6) {
|
|
2055
|
-
validationError("Invalid IP v6 address.");
|
|
2056
|
-
return null;
|
|
2057
|
-
}
|
|
2058
|
-
var numbersSeen = 0;
|
|
2059
|
-
/**
|
|
2060
|
-
* 6.5.5. While c is not the EOF code point:
|
|
2061
|
-
*/
|
|
2062
|
-
while (walker.c() !== EOF) {
|
|
2063
|
-
/**
|
|
2064
|
-
* 6.5.5.1. Let ipv4Piece be null.
|
|
2065
|
-
*/
|
|
2066
|
-
var ipv4Piece = null;
|
|
2067
|
-
/**
|
|
2068
|
-
* 6.5.5.2. If numbersSeen is greater than 0, then:
|
|
2069
|
-
* 6.5.5.2.1. If c is a U+002E (.) and numbersSeen is less than 4, then
|
|
2070
|
-
* increase pointer by 1.
|
|
2071
|
-
* 6.5.5.2.1. Otherwise, validation error, return failure.
|
|
2072
|
-
*/
|
|
2073
|
-
if (numbersSeen > 0) {
|
|
2074
|
-
if (walker.c() === '.' && numbersSeen < 4) {
|
|
2075
|
-
walker.pointer++;
|
|
2076
|
-
}
|
|
2077
|
-
else {
|
|
2078
|
-
validationError("Invalid IP v6 address.");
|
|
2079
|
-
return null;
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
/**
|
|
2083
|
-
* 6.5.5.3. If c is not an ASCII digit, validation error, return
|
|
2084
|
-
* failure.
|
|
2085
|
-
*/
|
|
2086
|
-
if (!infra_1.codePoint.ASCIIDigit.test(walker.c())) {
|
|
2087
|
-
validationError("Invalid IP v6 address.");
|
|
2088
|
-
return null;
|
|
2089
|
-
}
|
|
2090
|
-
/**
|
|
2091
|
-
* 6.5.5.4. While c is an ASCII digit:
|
|
2092
|
-
*/
|
|
2093
|
-
while (infra_1.codePoint.ASCIIDigit.test(walker.c())) {
|
|
2094
|
-
/**
|
|
2095
|
-
* 6.5.5.4.1. Let number be c interpreted as decimal number.
|
|
2096
|
-
*/
|
|
2097
|
-
var number = parseInt(walker.c(), 10);
|
|
2098
|
-
/**
|
|
2099
|
-
* 6.5.5.4.2. If ipv4Piece is null, then set ipv4Piece to number.
|
|
2100
|
-
* Otherwise, if ipv4Piece is 0, validation error, return failure.
|
|
2101
|
-
* Otherwise, set ipv4Piece to ipv4Piece × 10 + number.
|
|
2102
|
-
*/
|
|
2103
|
-
if (ipv4Piece === null) {
|
|
2104
|
-
ipv4Piece = number;
|
|
2105
|
-
}
|
|
2106
|
-
else if (ipv4Piece === 0) {
|
|
2107
|
-
validationError("Invalid IP v6 address.");
|
|
2108
|
-
return null;
|
|
2109
|
-
}
|
|
2110
|
-
else {
|
|
2111
|
-
ipv4Piece = ipv4Piece * 10 + number;
|
|
2112
|
-
}
|
|
2113
|
-
/**
|
|
2114
|
-
* 6.5.5.4.3. If ipv4Piece is greater than 255, validation error, return failure.
|
|
2115
|
-
* 6.5.5.4.4. Increase pointer by 1.
|
|
2116
|
-
*/
|
|
2117
|
-
if (ipv4Piece > 255) {
|
|
2118
|
-
validationError("Invalid IP v6 address.");
|
|
2119
|
-
return null;
|
|
2120
|
-
}
|
|
2121
|
-
walker.pointer++;
|
|
2122
|
-
}
|
|
2123
|
-
/**
|
|
2124
|
-
* 6.5.5.5. Set address[pieceIndex] to address[pieceIndex] × 0x100 + ipv4Piece.
|
|
2125
|
-
* 6.5.5.6. Increase numbersSeen by 1.
|
|
2126
|
-
* 6.5.5.7. If numbersSeen is 2 or 4, then increase pieceIndex by 1.
|
|
2127
|
-
*/
|
|
2128
|
-
if (ipv4Piece === null) {
|
|
2129
|
-
validationError("Invalid IP v6 address.");
|
|
2130
|
-
return null;
|
|
2131
|
-
}
|
|
2132
|
-
address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;
|
|
2133
|
-
numbersSeen++;
|
|
2134
|
-
if (numbersSeen === 2 || numbersSeen === 4)
|
|
2135
|
-
pieceIndex++;
|
|
2136
|
-
}
|
|
2137
|
-
/**
|
|
2138
|
-
* 6.5.6. If numbersSeen is not 4, validation error, return failure.
|
|
2139
|
-
*/
|
|
2140
|
-
if (numbersSeen !== 4) {
|
|
2141
|
-
validationError("Invalid IP v6 address.");
|
|
2142
|
-
return null;
|
|
2143
|
-
}
|
|
2144
|
-
/**
|
|
2145
|
-
* 6.5.7. Break.
|
|
2146
|
-
*/
|
|
2147
|
-
break;
|
|
2148
|
-
}
|
|
2149
|
-
else if (walker.c() === ':') {
|
|
2150
|
-
/**
|
|
2151
|
-
* 6.6. Otherwise, if c is U+003A (:):
|
|
2152
|
-
* 6.6.1. Increase pointer by 1.
|
|
2153
|
-
* 6.6.2. If c is the EOF code point, validation error, return failure.
|
|
2154
|
-
*/
|
|
2155
|
-
walker.pointer++;
|
|
2156
|
-
if (walker.c() === EOF) {
|
|
2157
|
-
validationError("Invalid IP v6 address.");
|
|
2158
|
-
return null;
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
else if (walker.c() !== EOF) {
|
|
2162
|
-
/**
|
|
2163
|
-
* 6.7. Otherwise, if c is not the EOF code point, validation error,
|
|
2164
|
-
* return failure.
|
|
2165
|
-
*/
|
|
2166
|
-
validationError("Invalid IP v6 address.");
|
|
2167
|
-
return null;
|
|
2168
|
-
}
|
|
2169
|
-
/**
|
|
2170
|
-
* 6.8. Set address[pieceIndex] to value.
|
|
2171
|
-
* 6.9. Increase pieceIndex by 1.
|
|
2172
|
-
*/
|
|
2173
|
-
address[pieceIndex] = value;
|
|
2174
|
-
pieceIndex++;
|
|
2175
|
-
}
|
|
2176
|
-
/**
|
|
2177
|
-
* 7. If compress is non-null, then:
|
|
2178
|
-
* 7.1. Let swaps be pieceIndex − compress.
|
|
2179
|
-
* 7.2. Set pieceIndex to 7.
|
|
2180
|
-
* 7.3. While pieceIndex is not 0 and swaps is greater than 0, swap
|
|
2181
|
-
* address[pieceIndex] with address[compress + swaps − 1], and then decrease
|
|
2182
|
-
* both pieceIndex and swaps by 1.
|
|
2183
|
-
*/
|
|
2184
|
-
if (compress !== null) {
|
|
2185
|
-
var swaps = pieceIndex - compress;
|
|
2186
|
-
pieceIndex = 7;
|
|
2187
|
-
while (pieceIndex !== 0 && swaps > 0) {
|
|
2188
|
-
_a = __read([address[compress + swaps - 1], address[pieceIndex]], 2), address[pieceIndex] = _a[0], address[compress + swaps - 1] = _a[1];
|
|
2189
|
-
pieceIndex--;
|
|
2190
|
-
swaps--;
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
else if (compress === null && pieceIndex !== 8) {
|
|
2194
|
-
/**
|
|
2195
|
-
* 8. Otherwise, if compress is null and pieceIndex is not 8,
|
|
2196
|
-
* validation error, return failure.
|
|
2197
|
-
*/
|
|
2198
|
-
validationError("Invalid IP v6 address.");
|
|
2199
|
-
return null;
|
|
2200
|
-
}
|
|
2201
|
-
/**
|
|
2202
|
-
* 9. Return address.
|
|
2203
|
-
*/
|
|
2204
|
-
return address;
|
|
2205
|
-
}
|
|
2206
|
-
exports.iPv6Parser = iPv6Parser;
|
|
2207
|
-
/**
|
|
2208
|
-
* Parses an opaque host string.
|
|
2209
|
-
*
|
|
2210
|
-
* @param input - a string
|
|
2211
|
-
*/
|
|
2212
|
-
function opaqueHostParser(input) {
|
|
2213
|
-
var e_8, _a;
|
|
2214
|
-
/**
|
|
2215
|
-
* 1. If input contains a forbidden host code point excluding U+0025 (%),
|
|
2216
|
-
* validation error, return failure.
|
|
2217
|
-
* 2. Let output be the empty string.
|
|
2218
|
-
* 3. For each code point in input, UTF-8 percent encode it using the C0
|
|
2219
|
-
* control percent-encode set, and append the result to output.
|
|
2220
|
-
* 4. Return output.
|
|
2221
|
-
*/
|
|
2222
|
-
var forbiddenChars = /[\x00\t\f\r #/:?@\[\\\]]/;
|
|
2223
|
-
if (forbiddenChars.test(input)) {
|
|
2224
|
-
validationError("Invalid host string.");
|
|
2225
|
-
return null;
|
|
2226
|
-
}
|
|
2227
|
-
var output = "";
|
|
2228
|
-
try {
|
|
2229
|
-
for (var input_1 = __values(input), input_1_1 = input_1.next(); !input_1_1.done; input_1_1 = input_1.next()) {
|
|
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; }
|
|
2240
|
-
}
|
|
2241
|
-
return output;
|
|
2242
|
-
}
|
|
2243
|
-
exports.opaqueHostParser = opaqueHostParser;
|
|
2244
|
-
/**
|
|
2245
|
-
* Resolves a Blob URL from the user agent's Blob URL store.
|
|
2246
|
-
* function is not implemented.
|
|
2247
|
-
* See: https://w3c.github.io/FileAPI/#blob-url-resolve
|
|
2248
|
-
*
|
|
2249
|
-
* @param url - an url
|
|
2250
|
-
*/
|
|
2251
|
-
function resolveABlobURL(url) {
|
|
2252
|
-
return null;
|
|
2253
|
-
}
|
|
2254
|
-
exports.resolveABlobURL = resolveABlobURL;
|
|
2255
|
-
/**
|
|
2256
|
-
* Percent encodes a byte.
|
|
2257
|
-
*
|
|
2258
|
-
* @param value - a byte
|
|
2259
|
-
*/
|
|
2260
|
-
function percentEncode(value) {
|
|
2261
|
-
/**
|
|
2262
|
-
* To percent encode a byte into a percent-encoded byte, return a string
|
|
2263
|
-
* consisting of U+0025 (%), followed by two ASCII upper hex digits
|
|
2264
|
-
* representing byte.
|
|
2265
|
-
*/
|
|
2266
|
-
return '%' + ('00' + value.toString(16).toUpperCase()).slice(-2);
|
|
2267
|
-
}
|
|
2268
|
-
exports.percentEncode = percentEncode;
|
|
2269
|
-
/**
|
|
2270
|
-
* Percent decodes a byte sequence input.
|
|
2271
|
-
*
|
|
2272
|
-
* @param input - a byte sequence
|
|
2273
|
-
*/
|
|
2274
|
-
function percentDecode(input) {
|
|
2275
|
-
var isHexDigit = function (byte) {
|
|
2276
|
-
return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) ||
|
|
2277
|
-
(byte >= 0x61 && byte <= 0x66);
|
|
2278
|
-
};
|
|
2279
|
-
/**
|
|
2280
|
-
* 1. Let output be an empty byte sequence.
|
|
2281
|
-
* 2. For each byte byte in input:
|
|
2282
|
-
*/
|
|
2283
|
-
var output = new Uint8Array(input.length);
|
|
2284
|
-
var n = 0;
|
|
2285
|
-
for (var i = 0; i < input.length; i++) {
|
|
2286
|
-
var byte = input[i];
|
|
2287
|
-
/**
|
|
2288
|
-
* 2.1. If byte is not 0x25 (%), then append byte to output.
|
|
2289
|
-
* 2.2. Otherwise, if byte is 0x25 (%) and the next two bytes after byte
|
|
2290
|
-
* in input are not in the ranges 0x30 (0) to 0x39 (9), 0x41 (A)
|
|
2291
|
-
* to 0x46 (F), and 0x61 (a) to 0x66 (f), all inclusive, append byte
|
|
2292
|
-
* to output.
|
|
2293
|
-
* 2.3. Otherwise:
|
|
2294
|
-
* 2.3.1. Let bytePoint be the two bytes after byte in input, decoded,
|
|
2295
|
-
* and then interpreted as hexadecimal number.
|
|
2296
|
-
* 2.3.2. Append a byte whose value is bytePoint to output.
|
|
2297
|
-
* 2.3.3. Skip the next two bytes in input.
|
|
2298
|
-
*/
|
|
2299
|
-
if (byte !== 0x25) {
|
|
2300
|
-
output[n] = byte;
|
|
2301
|
-
n++;
|
|
2302
|
-
}
|
|
2303
|
-
else if (byte === 0x25 && i >= input.length - 2) {
|
|
2304
|
-
output[n] = byte;
|
|
2305
|
-
n++;
|
|
2306
|
-
}
|
|
2307
|
-
else if (byte === 0x25 && (!isHexDigit(input[i + 1]) || !isHexDigit(input[i + 2]))) {
|
|
2308
|
-
output[n] = byte;
|
|
2309
|
-
n++;
|
|
2310
|
-
}
|
|
2311
|
-
else {
|
|
2312
|
-
var bytePoint = parseInt(util_1.utf8Decode(Uint8Array.of(input[i + 1], input[i + 2])), 16);
|
|
2313
|
-
output[n] = bytePoint;
|
|
2314
|
-
n++;
|
|
2315
|
-
i += 2;
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
return output.subarray(0, n);
|
|
2319
|
-
}
|
|
2320
|
-
exports.percentDecode = percentDecode;
|
|
2321
|
-
/**
|
|
2322
|
-
* String percent decodes a string.
|
|
2323
|
-
*
|
|
2324
|
-
* @param input - a string
|
|
2325
|
-
*/
|
|
2326
|
-
function stringPercentDecode(input) {
|
|
2327
|
-
/**
|
|
2328
|
-
* 1. Let bytes be the UTF-8 encoding of input.
|
|
2329
|
-
* 2. Return the percent decoding of bytes.
|
|
2330
|
-
*/
|
|
2331
|
-
return percentDecode(util_1.utf8Encode(input));
|
|
2332
|
-
}
|
|
2333
|
-
exports.stringPercentDecode = stringPercentDecode;
|
|
2334
|
-
/**
|
|
2335
|
-
* UTF-8 percent encodes a code point, using a percent encode set.
|
|
2336
|
-
*
|
|
2337
|
-
* @param codePoint - a code point
|
|
2338
|
-
* @param percentEncodeSet - a percent encode set
|
|
2339
|
-
*/
|
|
2340
|
-
function utf8PercentEncode(codePoint, percentEncodeSet) {
|
|
2341
|
-
var e_9, _a;
|
|
2342
|
-
/**
|
|
2343
|
-
* 1. If codePoint is not in percentEncodeSet, then return codePoint.
|
|
2344
|
-
* 2. Let bytes be the result of running UTF-8 encode on codePoint.
|
|
2345
|
-
* 3. Percent encode each byte in bytes, and then return the results
|
|
2346
|
-
* concatenated, in the same order.
|
|
2347
|
-
*/
|
|
2348
|
-
if (!percentEncodeSet.test(codePoint))
|
|
2349
|
-
return codePoint;
|
|
2350
|
-
var bytes = util_1.utf8Encode(codePoint);
|
|
2351
|
-
var result = "";
|
|
2352
|
-
try {
|
|
2353
|
-
for (var bytes_2 = __values(bytes), bytes_2_1 = bytes_2.next(); !bytes_2_1.done; bytes_2_1 = bytes_2.next()) {
|
|
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; }
|
|
2364
|
-
}
|
|
2365
|
-
return result;
|
|
2366
|
-
}
|
|
2367
|
-
exports.utf8PercentEncode = utf8PercentEncode;
|
|
2368
|
-
/**
|
|
2369
|
-
* Determines if two hosts are considered equal.
|
|
2370
|
-
*
|
|
2371
|
-
* @param hostA - a host
|
|
2372
|
-
* @param hostB - a host
|
|
2373
|
-
*/
|
|
2374
|
-
function hostEquals(hostA, hostB) {
|
|
2375
|
-
return hostA === hostB;
|
|
2376
|
-
}
|
|
2377
|
-
exports.hostEquals = hostEquals;
|
|
2378
|
-
/**
|
|
2379
|
-
* Determines if two URLs are considered equal.
|
|
2380
|
-
*
|
|
2381
|
-
* @param urlA - a URL
|
|
2382
|
-
* @param urlB - a URL
|
|
2383
|
-
* @param excludeFragmentsFlag - whether to ignore fragments while comparing
|
|
2384
|
-
*/
|
|
2385
|
-
function urlEquals(urlA, urlB, excludeFragmentsFlag) {
|
|
2386
|
-
if (excludeFragmentsFlag === void 0) { excludeFragmentsFlag = false; }
|
|
2387
|
-
/**
|
|
2388
|
-
* 1. Let serializedA be the result of serializing A, with the exclude
|
|
2389
|
-
* fragment flag set if the exclude fragments flag is set.
|
|
2390
|
-
* 2. Let serializedB be the result of serializing B, with the exclude
|
|
2391
|
-
* fragment flag set if the exclude fragments flag is set.
|
|
2392
|
-
* 3. Return true if serializedA is serializedB, and false otherwise.
|
|
2393
|
-
*/
|
|
2394
|
-
return urlSerializer(urlA, excludeFragmentsFlag) ===
|
|
2395
|
-
urlSerializer(urlB, excludeFragmentsFlag);
|
|
2396
|
-
}
|
|
2397
|
-
exports.urlEquals = urlEquals;
|
|
2398
|
-
/**
|
|
2399
|
-
* Parses an `application/x-www-form-urlencoded` string.
|
|
2400
|
-
*
|
|
2401
|
-
* @param input - a string
|
|
2402
|
-
*/
|
|
2403
|
-
function urlEncodedStringParser(input) {
|
|
2404
|
-
/**
|
|
2405
|
-
* The application/x-www-form-urlencoded string parser takes a string input,
|
|
2406
|
-
* UTF-8 encodes it, and then returns the result of
|
|
2407
|
-
* application/x-www-form-urlencoded parsing it.
|
|
2408
|
-
*/
|
|
2409
|
-
return urlEncodedParser(util_1.utf8Encode(input));
|
|
2410
|
-
}
|
|
2411
|
-
exports.urlEncodedStringParser = urlEncodedStringParser;
|
|
2412
|
-
/**
|
|
2413
|
-
* Parses `application/x-www-form-urlencoded` bytes.
|
|
2414
|
-
*
|
|
2415
|
-
* @param input - a byte sequence
|
|
2416
|
-
*/
|
|
2417
|
-
function urlEncodedParser(input) {
|
|
2418
|
-
var e_10, _a, e_11, _b;
|
|
2419
|
-
/**
|
|
2420
|
-
* 1. Let sequences be the result of splitting input on 0x26 (&).
|
|
2421
|
-
*/
|
|
2422
|
-
var sequences = [];
|
|
2423
|
-
var currentSequence = [];
|
|
2424
|
-
try {
|
|
2425
|
-
for (var input_2 = __values(input), input_2_1 = input_2.next(); !input_2_1.done; input_2_1 = input_2.next()) {
|
|
2426
|
-
var byte = input_2_1.value;
|
|
2427
|
-
if (byte === 0x26) {
|
|
2428
|
-
sequences.push(Uint8Array.from(currentSequence));
|
|
2429
|
-
currentSequence = [];
|
|
2430
|
-
}
|
|
2431
|
-
else {
|
|
2432
|
-
currentSequence.push(byte);
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
}
|
|
2436
|
-
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
2437
|
-
finally {
|
|
2438
|
-
try {
|
|
2439
|
-
if (input_2_1 && !input_2_1.done && (_a = input_2.return)) _a.call(input_2);
|
|
2440
|
-
}
|
|
2441
|
-
finally { if (e_10) throw e_10.error; }
|
|
2442
|
-
}
|
|
2443
|
-
if (currentSequence.length !== 0) {
|
|
2444
|
-
sequences.push(Uint8Array.from(currentSequence));
|
|
2445
|
-
}
|
|
2446
|
-
/**
|
|
2447
|
-
* 2. Let output be an initially empty list of name-value tuples where both name and value hold a string.
|
|
2448
|
-
*/
|
|
2449
|
-
var output = [];
|
|
2450
|
-
try {
|
|
2451
|
-
/**
|
|
2452
|
-
* 3. For each byte sequence bytes in sequences:
|
|
2453
|
-
*/
|
|
2454
|
-
for (var sequences_1 = __values(sequences), sequences_1_1 = sequences_1.next(); !sequences_1_1.done; sequences_1_1 = sequences_1.next()) {
|
|
2455
|
-
var bytes = sequences_1_1.value;
|
|
2456
|
-
/**
|
|
2457
|
-
* 3.1. If bytes is the empty byte sequence, then continue.
|
|
2458
|
-
*/
|
|
2459
|
-
if (bytes.length === 0)
|
|
2460
|
-
continue;
|
|
2461
|
-
/**
|
|
2462
|
-
* 3.2. If bytes contains a 0x3D (=), then let name be the bytes from the
|
|
2463
|
-
* start of bytes up to but excluding its first 0x3D (=), and let value be
|
|
2464
|
-
* the bytes, if any, after the first 0x3D (=) up to the end of bytes.
|
|
2465
|
-
* If 0x3D (=) is the first byte, then name will be the empty byte
|
|
2466
|
-
* sequence. If it is the last, then value will be the empty byte sequence.
|
|
2467
|
-
* 3.3. Otherwise, let name have the value of bytes and let value be the
|
|
2468
|
-
* empty byte sequence.
|
|
2469
|
-
*/
|
|
2470
|
-
var index = bytes.indexOf(0x3D);
|
|
2471
|
-
var name = (index !== -1 ? bytes.slice(0, index) : bytes);
|
|
2472
|
-
var value = (index !== -1 ? bytes.slice(index + 1) : new Uint8Array());
|
|
2473
|
-
/**
|
|
2474
|
-
* 3.4. Replace any 0x2B (+) in name and value with 0x20 (SP).
|
|
2475
|
-
*/
|
|
2476
|
-
for (var i = 0; i < name.length; i++)
|
|
2477
|
-
if (name[i] === 0x2B)
|
|
2478
|
-
name[i] = 0x20;
|
|
2479
|
-
for (var i = 0; i < value.length; i++)
|
|
2480
|
-
if (value[i] === 0x2B)
|
|
2481
|
-
value[i] = 0x20;
|
|
2482
|
-
/**
|
|
2483
|
-
* 3.5. Let nameString and valueString be the result of running UTF-8
|
|
2484
|
-
* decode without BOM on the percent decoding of name and value,
|
|
2485
|
-
* respectively.
|
|
2486
|
-
*/
|
|
2487
|
-
var nameString = util_1.utf8Decode(name);
|
|
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; }
|
|
2501
|
-
}
|
|
2502
|
-
/**
|
|
2503
|
-
* 4. Return output.
|
|
2504
|
-
*/
|
|
2505
|
-
return output;
|
|
2506
|
-
}
|
|
2507
|
-
exports.urlEncodedParser = urlEncodedParser;
|
|
2508
|
-
/**
|
|
2509
|
-
* Serializes `application/x-www-form-urlencoded` bytes.
|
|
2510
|
-
*
|
|
2511
|
-
* @param input - a byte sequence
|
|
2512
|
-
*/
|
|
2513
|
-
function urlEncodedByteSerializer(input) {
|
|
2514
|
-
var e_12, _a;
|
|
2515
|
-
/**
|
|
2516
|
-
* 1. Let output be the empty string.
|
|
2517
|
-
* 2. For each byte in input, depending on byte:
|
|
2518
|
-
* 0x20 (SP)
|
|
2519
|
-
* Append U+002B (+) to output.
|
|
2520
|
-
*
|
|
2521
|
-
* 0x2A (*)
|
|
2522
|
-
* 0x2D (-)
|
|
2523
|
-
* 0x2E (.)
|
|
2524
|
-
* 0x30 (0) to 0x39 (9)
|
|
2525
|
-
* 0x41 (A) to 0x5A (Z)
|
|
2526
|
-
* 0x5F (_)
|
|
2527
|
-
* 0x61 (a) to 0x7A (z)
|
|
2528
|
-
* Append a code point whose value is byte to output.
|
|
2529
|
-
*
|
|
2530
|
-
* Otherwise
|
|
2531
|
-
* Append byte, percent encoded, to output.
|
|
2532
|
-
* 3. Return output.
|
|
2533
|
-
*/
|
|
2534
|
-
var output = "";
|
|
2535
|
-
try {
|
|
2536
|
-
for (var input_3 = __values(input), input_3_1 = input_3.next(); !input_3_1.done; input_3_1 = input_3.next()) {
|
|
2537
|
-
var byte = input_3_1.value;
|
|
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
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
2552
|
-
finally {
|
|
2553
|
-
try {
|
|
2554
|
-
if (input_3_1 && !input_3_1.done && (_a = input_3.return)) _a.call(input_3);
|
|
2555
|
-
}
|
|
2556
|
-
finally { if (e_12) throw e_12.error; }
|
|
2557
|
-
}
|
|
2558
|
-
return output;
|
|
2559
|
-
}
|
|
2560
|
-
exports.urlEncodedByteSerializer = urlEncodedByteSerializer;
|
|
2561
|
-
/**
|
|
2562
|
-
* Serializes `application/x-www-form-urlencoded` tuples.
|
|
2563
|
-
*
|
|
2564
|
-
* @param input - input tuple of name/value pairs
|
|
2565
|
-
* @param encodingOverride: encoding override
|
|
2566
|
-
*/
|
|
2567
|
-
function urlEncodedSerializer(tuples, encodingOverride) {
|
|
2568
|
-
var e_13, _a;
|
|
2569
|
-
/**
|
|
2570
|
-
* 1. Let encoding be UTF-8.
|
|
2571
|
-
* 2. If encoding override is given, set encoding to the result of getting
|
|
2572
|
-
* an output encoding from encoding override.
|
|
2573
|
-
*/
|
|
2574
|
-
var encoding = (encodingOverride === undefined ||
|
|
2575
|
-
encodingOverride === "replacement" || encodingOverride === "UTF-16BE" ||
|
|
2576
|
-
encodingOverride === "UTF-16LE" ? "UTF-8" : encodingOverride);
|
|
2577
|
-
if (encoding.toUpperCase() !== "UTF-8") {
|
|
2578
|
-
throw new Error("Only UTF-8 encoding is supported.");
|
|
2579
|
-
}
|
|
2580
|
-
/**
|
|
2581
|
-
* 3. Let output be the empty string.
|
|
2582
|
-
*/
|
|
2583
|
-
var output = "";
|
|
2584
|
-
try {
|
|
2585
|
-
/**
|
|
2586
|
-
* 4. For each tuple in tuples:
|
|
2587
|
-
*/
|
|
2588
|
-
for (var tuples_1 = __values(tuples), tuples_1_1 = tuples_1.next(); !tuples_1_1.done; tuples_1_1 = tuples_1.next()) {
|
|
2589
|
-
var tuple = tuples_1_1.value;
|
|
2590
|
-
/**
|
|
2591
|
-
* 4.1. Let name be the result of serializing the result of encoding
|
|
2592
|
-
* tuple’s name, using encoding.
|
|
2593
|
-
*/
|
|
2594
|
-
var name = urlEncodedByteSerializer(util_1.utf8Encode(tuple[0]));
|
|
2595
|
-
/**
|
|
2596
|
-
* 4.2. Let value be tuple’s value.
|
|
2597
|
-
*/
|
|
2598
|
-
var value = tuple[1];
|
|
2599
|
-
/**
|
|
2600
|
-
* TODO:
|
|
2601
|
-
* 4.3. If value is a file, then set value to value’s filename.
|
|
2602
|
-
*/
|
|
2603
|
-
/**
|
|
2604
|
-
* 4.4. Set value to the result of serializing the result of encoding
|
|
2605
|
-
* value, using encoding.
|
|
2606
|
-
*/
|
|
2607
|
-
value = urlEncodedByteSerializer(util_1.utf8Encode(value));
|
|
2608
|
-
/**
|
|
2609
|
-
* 4.5. If tuple is not the first pair in tuples, then append U+0026 (&)
|
|
2610
|
-
* to output.
|
|
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; }
|
|
2626
|
-
}
|
|
2627
|
-
/**
|
|
2628
|
-
* 5. Return output.
|
|
2629
|
-
*/
|
|
2630
|
-
return output;
|
|
2631
|
-
}
|
|
2632
|
-
exports.urlEncodedSerializer = urlEncodedSerializer;
|
|
2633
|
-
/**
|
|
2634
|
-
* Returns a URL's origin.
|
|
2635
|
-
*
|
|
2636
|
-
* @param url - a URL
|
|
2637
|
-
*/
|
|
2638
|
-
function origin(url) {
|
|
2639
|
-
/**
|
|
2640
|
-
* A URL’s origin is the origin returned by running these steps, switching
|
|
2641
|
-
* on URL’s scheme:
|
|
2642
|
-
* "blob"
|
|
2643
|
-
* 1. If URL’s blob URL entry is non-null, then return URL’s blob URL
|
|
2644
|
-
* entry’s environment’s origin.
|
|
2645
|
-
* 2. Let url be the result of parsing URL’s path[0].
|
|
2646
|
-
* 3. Return a new opaque origin, if url is failure, and url’s origin
|
|
2647
|
-
* otherwise.
|
|
2648
|
-
* "ftp"
|
|
2649
|
-
* "http"
|
|
2650
|
-
* "https"
|
|
2651
|
-
* "ws"
|
|
2652
|
-
* "wss"
|
|
2653
|
-
* Return a tuple consisting of URL’s scheme, URL’s host, URL’s port, and
|
|
2654
|
-
* null.
|
|
2655
|
-
* "file"
|
|
2656
|
-
* Unfortunate as it is, is left as an exercise to the reader. When in
|
|
2657
|
-
* doubt, return a new opaque origin.
|
|
2658
|
-
* Otherwise
|
|
2659
|
-
* Return a new opaque origin.
|
|
2660
|
-
*/
|
|
2661
|
-
switch (url.scheme) {
|
|
2662
|
-
case "blob":
|
|
2663
|
-
if (url._blobURLEntry !== null) {
|
|
2664
|
-
// TODO: return URL’s blob URL entry’s environment’s origin.
|
|
2665
|
-
}
|
|
2666
|
-
var parsedURL = basicURLParser(url.path[0]);
|
|
2667
|
-
if (parsedURL === null)
|
|
2668
|
-
return interfaces_1.OpaqueOrigin;
|
|
2669
|
-
else
|
|
2670
|
-
return origin(parsedURL);
|
|
2671
|
-
case "ftp":
|
|
2672
|
-
case "http":
|
|
2673
|
-
case "https":
|
|
2674
|
-
case "ws":
|
|
2675
|
-
case "wss":
|
|
2676
|
-
return [url.scheme, url.host === null ? "" : url.host, url.port, null];
|
|
2677
|
-
case "file":
|
|
2678
|
-
return interfaces_1.OpaqueOrigin;
|
|
2679
|
-
default:
|
|
2680
|
-
return interfaces_1.OpaqueOrigin;
|
|
2681
|
-
}
|
|
2682
|
-
}
|
|
2683
|
-
exports.origin = origin;
|
|
2684
|
-
/**
|
|
2685
|
-
* Converts a domain string to ASCII.
|
|
2686
|
-
*
|
|
2687
|
-
* @param domain - a domain string
|
|
2688
|
-
*/
|
|
2689
|
-
function domainToASCII(domain, beStrict) {
|
|
2690
|
-
if (beStrict === void 0) { beStrict = false; }
|
|
2691
|
-
/**
|
|
2692
|
-
* 1. If beStrict is not given, set it to false.
|
|
2693
|
-
* 2. Let result be the result of running Unicode ToASCII with domain_name
|
|
2694
|
-
* set to domain, UseSTD3ASCIIRules set to beStrict, CheckHyphens set to
|
|
2695
|
-
* false, CheckBidi set to true, CheckJoiners set to true,
|
|
2696
|
-
* Transitional_Processing set to false, and VerifyDnsLength set to beStrict.
|
|
2697
|
-
* 3. If result is a failure value, validation error, return failure.
|
|
2698
|
-
* 4. Return result.
|
|
2699
|
-
*/
|
|
2700
|
-
// Use node.js function
|
|
2701
|
-
var result = url_1.domainToASCII(domain);
|
|
2702
|
-
if (result === "") {
|
|
2703
|
-
validationError("Invalid domain name.");
|
|
2704
|
-
return null;
|
|
2705
|
-
}
|
|
2706
|
-
return result;
|
|
2707
|
-
}
|
|
2708
|
-
exports.domainToASCII = domainToASCII;
|
|
2709
|
-
/**
|
|
2710
|
-
* Converts a domain string to Unicode.
|
|
2711
|
-
*
|
|
2712
|
-
* @param domain - a domain string
|
|
2713
|
-
*/
|
|
2714
|
-
function domainToUnicode(domain, beStrict) {
|
|
2715
|
-
if (beStrict === void 0) { beStrict = false; }
|
|
2716
|
-
/**
|
|
2717
|
-
* 1. Let result be the result of running Unicode ToUnicode with domain_name
|
|
2718
|
-
* set to domain, CheckHyphens set to false, CheckBidi set to true,
|
|
2719
|
-
* CheckJoiners set to true, UseSTD3ASCIIRules set to false, and
|
|
2720
|
-
* Transitional_Processing set to false.
|
|
2721
|
-
* 2. Signify validation errors for any returned errors, and then,
|
|
2722
|
-
* return result.
|
|
2723
|
-
*/
|
|
2724
|
-
// Use node.js function
|
|
2725
|
-
var result = url_1.domainToUnicode(domain);
|
|
2726
|
-
if (result === "") {
|
|
2727
|
-
validationError("Invalid domain name.");
|
|
2728
|
-
}
|
|
2729
|
-
return result;
|
|
2730
|
-
}
|
|
2731
|
-
exports.domainToUnicode = domainToUnicode;
|
|
2732
|
-
/**
|
|
2733
|
-
* Serializes an origin.
|
|
2734
|
-
* function is from the HTML spec:
|
|
2735
|
-
* https://html.spec.whatwg.org/#ascii-serialisation-of-an-origin
|
|
2736
|
-
*
|
|
2737
|
-
* @param origin - an origin
|
|
2738
|
-
*/
|
|
2739
|
-
function asciiSerializationOfAnOrigin(origin) {
|
|
2740
|
-
/**
|
|
2741
|
-
* 1. If origin is an opaque origin, then return "null".
|
|
2742
|
-
* 2. Otherwise, let result be origin's scheme.
|
|
2743
|
-
* 3. Append "://" to result.
|
|
2744
|
-
* 4. Append origin's host, serialized, to result.
|
|
2745
|
-
* 5. If origin's port is non-null, append a U+003A COLON character (:),
|
|
2746
|
-
* and origin's port, serialized, to result.
|
|
2747
|
-
* 6. Return result.
|
|
2748
|
-
*/
|
|
2749
|
-
if (origin[0] === "" && origin[1] === "" && origin[2] === null && origin[3] === null) {
|
|
2750
|
-
return "null";
|
|
2751
|
-
}
|
|
2752
|
-
var result = origin[0] + "://" + hostSerializer(origin[1]);
|
|
2753
|
-
if (origin[2] !== null)
|
|
2754
|
-
result += ":" + origin[2].toString();
|
|
2755
|
-
return result;
|
|
2756
|
-
}
|
|
2757
|
-
exports.asciiSerializationOfAnOrigin = asciiSerializationOfAnOrigin;
|
|
2758
|
-
//# sourceMappingURL=URLAlgorithm.js.map
|