Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

min-document

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-document - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

12

index.js

@@ -29,12 +29,17 @@ var DOMText = require("./dom-text.js")

function ownerDocument(that, node) {
node.ownerDocument = that
return node
}
function createTextNode(value) {
return new DOMText(value)
return ownerDocument(this, new DOMText(value))
}
function createElement(tagName) {
return new DOMElement(tagName)
return ownerDocument(this, new DOMElement(tagName))
}
function createDocumentFragment() {
return new DocumentFragment()
return ownerDocument(this, new DocumentFragment())
}

@@ -46,2 +51,3 @@

/*

@@ -48,0 +54,0 @@ * getElementById returns the Element whose ID is given by elementId.

{
"name": "min-document",
"version": "2.1.0",
"version": "2.2.0",
"description": "A minimal DOM implementation",

@@ -23,3 +23,3 @@ "keywords": [],

"devDependencies": {
"tape": "~1.0.2"
"tape": "^2.12.1"
},

@@ -26,0 +26,0 @@ "licenses": [

@@ -107,2 +107,14 @@ var test = require("tape")

assert.end()
})
test("owner document is set", function (assert) {
var textnode = document.createTextNode("hello")
var domnode = document.createElement("div")
var fragment = document.createDocumentFragment()
assert.equal(textnode.ownerDocument, document)
assert.equal(domnode.ownerDocument, document)
assert.equal(fragment.ownerDocument, document)
assert.end()
})
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