doctype-to-string
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -11,4 +11,10 @@ 'use strict'; | ||
} | ||
// Checking with instanceof DocumentType might be neater, but how to get a | ||
// reference to DocumentType without assuming it to be available globally? | ||
// To play nice with custom DOM implementations, we resort to duck-typing. | ||
if (!doctype || doctype.nodeType !== doctype.DOCUMENT_TYPE_NODE || typeof doctype.name !== 'string' || typeof doctype.publicId !== 'string' || typeof doctype.systemId !== 'string') { | ||
throw new TypeError('Expected a DocumentType'); | ||
} | ||
var doctypeString = '<!DOCTYPE ' + doctype.name + (doctype.publicId ? ' PUBLIC "' + doctype.publicId + '"' : '') + (doctype.systemId ? (doctype.publicId ? '' : ' SYSTEM') + (' "' + doctype.systemId + '"') : '') + '>'; | ||
return doctypeString; | ||
} |
{ | ||
"name": "doctype-to-string", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Convert a DOM DocumentType into a string, e.g. \"<!DOCTYPE html>\"", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://code.treora.com/gerben/doctype-to-string" | ||
}, | ||
"main": "lib", | ||
@@ -6,0 +10,0 @@ "scripts": { |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2272
3
17
1
20
0