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.8.1 to 2.9.0

23

document.js

@@ -0,1 +1,3 @@

var domWalk = require("dom-walk")
var DOMText = require("./dom-text.js")

@@ -72,18 +74,13 @@ var DOMElement = require("./dom-element.js")

if (parent.className === classNames) {
return [parent]
}
var elems = []
var arr = parent.childNodes
var result = null
domWalk(parent, function (node) {
var classes = node.className.split(" ")
if (!arr) {
return result
}
if (classes.indexOf(classNames) !== -1) {
elems.push(node)
}
})
for (var i = 0, len = arr.length; !result && i < len; i++) {
result = getElementsByClassName(classNames, arr[i])
}
return result
return elems
}
{
"name": "min-document",
"version": "2.8.1",
"version": "2.9.0",
"description": "A minimal DOM implementation",

@@ -19,3 +19,5 @@ "keywords": [],

},
"dependencies": {},
"dependencies": {
"dom-walk": "^0.1.0"
},
"devDependencies": {

@@ -22,0 +24,0 @@ "run-browser": "git://github.com/Raynos/run-browser",

@@ -128,2 +128,18 @@ var test = require("tape")

test("can getElementsByClassName for many elements", function (assert) {
function h(className) {
var div = document.createElement("div")
div.className = className
return div
}
document.body.appendChild(h("multi-class-bar"))
document.body.appendChild(h("multi-class-bar"))
var elems = document.getElementsByClassName("multi-class-bar")
assert.equal(elems.length, 2)
assert.end()
})
test("can create/manipulate textnodes", function (assert) {

@@ -130,0 +146,0 @@ var textnode = document.createTextNode("hello")

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