Socket
Socket
Sign inDemoInstall

min-document

Package Overview
Dependencies
1
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.9.2 to 2.10.0

20

dom-element.js

@@ -25,2 +25,3 @@ var dispatchEvent = require("./event/dispatch-event.js")

this.namespaceURI = ns
this._attributes = {}

@@ -96,2 +97,21 @@ if (this.tagName === 'INPUT') {

DOMElement.prototype.setAttribute =
function _Element_setAttribute(name, value) {
this._attributes[name] = value
}
DOMElement.prototype.getAttribute =
function _Element_getAttribute(name) {
if (typeof this._attributes[name] !== "string") {
return null
}
return this._attributes[name]
}
DOMElement.prototype.removeAttribute =
function _Element_removeAttribute(name) {
delete this._attributes[name]
}
DOMElement.prototype.removeEventListener = removeEventListener

@@ -98,0 +118,0 @@ DOMElement.prototype.addEventListener = addEventListener

2

package.json
{
"name": "min-document",
"version": "2.9.2",
"version": "2.10.0",
"description": "A minimal DOM implementation",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -279,2 +279,12 @@ var test = require("tape")

test("can set and get attributes", function (assert) {
var elem = document.createElement("div")
assert.equal(elem.getAttribute("foo"), null)
elem.setAttribute("foo", "bar")
assert.equal(elem.getAttribute("foo"), "bar")
elem.removeAttribute("foo")
assert.equal(elem.getAttribute("foo"), null)
assert.end()
})
function elemString(element) {

@@ -281,0 +291,0 @@ var html = String(element) || "[]"

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc