@oozcitak/dom
Advanced tools
Comparing version 1.11.0 to 1.12.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const interfaces_1 = require("../dom/interfaces"); | ||
const LocalNameSet_1 = require("./LocalNameSet"); | ||
const DOMException_1 = require("../dom/DOMException"); | ||
@@ -70,24 +69,16 @@ const algorithm_1 = require("../algorithm"); | ||
return this._serializeElement(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.Document: | ||
return this._serializeDocument(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.Comment: | ||
return this._serializeComment(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.Text: | ||
return this._serializeText(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.DocumentFragment: | ||
return this._serializeDocumentFragment(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.DocumentType: | ||
return this._serializeDocumentType(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.ProcessingInstruction: | ||
return this._serializeProcessingInstruction(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.CData: | ||
return this._serializeCData(node, requireWellFormed); | ||
break; | ||
default: | ||
@@ -472,3 +463,3 @@ throw new Error(`Unknown node type: ${node.nodeType}`); | ||
let result = ""; | ||
const localNameSet = requireWellFormed ? new LocalNameSet_1.LocalNameSet() : undefined; | ||
const localNameSet = requireWellFormed ? {} : undefined; | ||
/** | ||
@@ -489,3 +480,3 @@ * 3. Loop: For each attribute attr in element's attributes, in the order | ||
*/ | ||
if (requireWellFormed && localNameSet && localNameSet.has(attr.namespaceURI, attr.localName)) { | ||
if (requireWellFormed && localNameSet && (attr.localName in localNameSet)) { | ||
throw new Error("Element contains duplicate attributes (well-formed required)."); | ||
@@ -500,3 +491,3 @@ } | ||
if (requireWellFormed && localNameSet) | ||
localNameSet.set(attr.namespaceURI, attr.localName); | ||
localNameSet[attr.localName] = true; | ||
/** 3.5. If attribute namespace is not null, then run these sub-steps: */ | ||
@@ -508,3 +499,2 @@ /** | ||
*/ | ||
result += " "; | ||
/** | ||
@@ -530,3 +520,3 @@ * 3.8. If the require well-formed flag is set (its value is true), and | ||
*/ | ||
result += attr.localName + "=\"" + | ||
result += " " + attr.localName + "=\"" + | ||
this._serializeAttributeValue(attr.value, requireWellFormed) + "\""; | ||
@@ -533,0 +523,0 @@ } |
@@ -79,24 +79,16 @@ "use strict"; | ||
return this._serializeElement(node, namespace, prefixMap, prefixIndex, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.Document: | ||
return this._serializeDocument(node, namespace, prefixMap, prefixIndex, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.Comment: | ||
return this._serializeComment(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.Text: | ||
return this._serializeText(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.DocumentFragment: | ||
return this._serializeDocumentFragment(node, namespace, prefixMap, prefixIndex, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.DocumentType: | ||
return this._serializeDocumentType(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.ProcessingInstruction: | ||
return this._serializeProcessingInstruction(node, requireWellFormed); | ||
break; | ||
case interfaces_1.NodeType.CData: | ||
return this._serializeCData(node, requireWellFormed); | ||
break; | ||
default: | ||
@@ -103,0 +95,0 @@ throw new Error(`Unknown node type: ${node.nodeType}`); |
{ | ||
"name": "@oozcitak/dom", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"keywords": [ | ||
@@ -28,3 +28,3 @@ "dom", | ||
"dependencies": { | ||
"@oozcitak/util": "5.0.0", | ||
"@oozcitak/util": "7.0.0", | ||
"@oozcitak/infra": "1.0.4", | ||
@@ -35,10 +35,9 @@ "@oozcitak/url": "1.0.0" | ||
"@types/benchmark": "*", | ||
"@types/chalk": "*", | ||
"@types/dedent": "*", | ||
"@types/jest": "^24.0.24", | ||
"@types/jest": "*", | ||
"@types/jsdom": "*", | ||
"@types/node": "^12.12.22", | ||
"@types/node": "*", | ||
"@types/xmldom": "*", | ||
"benchmark": "*", | ||
"chalk": "^3.0.0", | ||
"chalk": "*", | ||
"dedent": "*", | ||
@@ -50,4 +49,4 @@ "fast-xml-parser": "*", | ||
"ts-jest": "*", | ||
"ts-node": "^8.5.4", | ||
"typescript": "^3.7.4", | ||
"ts-node": "*", | ||
"typescript": "*", | ||
"xmldom": "*" | ||
@@ -54,0 +53,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17
1127072
22230
+ Added@oozcitak/util@7.0.0(transitive)
- Removed@oozcitak/util@5.0.0(transitive)
Updated@oozcitak/util@7.0.0