You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

doctype-to-string

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doctype-to-string - npm Package Compare versions

Comparing version

to
0.1.2

Readme.md

@@ -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;
}

6

package.json
{
"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": {