Socket
Socket
Sign inDemoInstall

domutils

Package Overview
Dependencies
3
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.2 to 1.7.0

16

lib/querying.js

@@ -85,16 +85,12 @@ var isTag = require("domelementtype").isTag;

var result = [];
var stack = [rootElems];
var stack = rootElems.slice();
while(stack.length){
var elems = stack.pop();
for(var i = 0, j = elems.length; i < j; i++){
if(!isTag(elems[i])) continue;
if(test(elems[i])) result.push(elems[i]);
var elem = stack.shift();
if(!isTag(elem)) continue;
if (elem.children && elem.children.length > 0) {
stack.unshift.apply(stack, elem.children);
}
while(j-- > 0){
if(elems[j].children && elems[j].children.length > 0){
stack.push(elems[j].children);
}
}
if(test(elem)) result.push(elem);
}
return result;
}
{
"name": "domutils",
"version": "1.6.2",
"version": "1.7.0",
"description": "utilities for working with htmlparser2's dom",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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