Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 0.1.1 to 0.1.2

Readme.md

6

lib/index.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc