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

node-html-parser

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-html-parser - npm Package Compare versions

Comparing version 1.4.5 to 1.4.6

17

dist/esm/matcher.js

@@ -164,3 +164,2 @@ /**

if (tagName && tagName !== '*') {
let reg;
if (tagName.startsWith('#')) {

@@ -171,21 +170,9 @@ // source += 'if (el.id != ' + JSON.stringify(tagName.substr(1)) + ') return false;';// 1

else {
reg = /^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/.exec(tagName);
const reg = /\[\s*([\w-]+)(\s*=\s*(((?<quote>'|")\s*(.*)(\k<quote>))|(\S*)))?\s*\]/.exec(tagName);
if (reg) {
attr_key = reg[1];
let method = reg[2];
if (method !== '=' && method !== '!=') {
// eslint-disable-next-line no-template-curly-in-string
throw new Error('Selector not supported, Expect [key${op}value].op must be =,!=');
}
if (method === '=') {
method = '==';
}
value = reg[7] || reg[8];
value = reg[6] || reg[8];
// source += `let attrs = el.attributes;for (let key in attrs){const val = attrs[key]; if (key == "${attr_key}" && val == "${value}"){return true;}} return false;`;// 2
function_name += '2';
}
else if ((reg = /^\[(.*?)\]/.exec(tagName))) {
attr_key = reg[1];
function_name += '5';
}
else {

@@ -192,0 +179,0 @@ // source += 'if (el.tagName != ' + JSON.stringify(tagName) + ') return false;';// 3

@@ -315,3 +315,2 @@ var __extends = (this && this.__extends) || (function () {

if (tagName && tagName !== '*') {
var reg = void 0;
if (tagName.startsWith('#')) {

@@ -322,21 +321,9 @@ // source += 'if (el.id != ' + JSON.stringify(tagName.substr(1)) + ') return false;';// 1

else {
reg = /^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/.exec(tagName);
var reg = /\[\s*([\w-]+)(\s*=\s*(((?<quote>'|")\s*(.*)(\k<quote>))|(\S*)))?\s*\]/.exec(tagName);
if (reg) {
attr_key = reg[1];
var method = reg[2];
if (method !== '=' && method !== '!=') {
// eslint-disable-next-line no-template-curly-in-string
throw new Error('Selector not supported, Expect [key${op}value].op must be =,!=');
}
if (method === '=') {
method = '==';
}
value = reg[7] || reg[8];
value = reg[6] || reg[8];
// source += `let attrs = el.attributes;for (let key in attrs){const val = attrs[key]; if (key == "${attr_key}" && val == "${value}"){return true;}} return false;`;// 2
function_name += '2';
}
else if ((reg = /^\[(.*?)\]/.exec(tagName))) {
attr_key = reg[1];
function_name += '5';
}
else {

@@ -343,0 +330,0 @@ // source += 'if (el.tagName != ' + JSON.stringify(tagName) + ') return false;';// 3

@@ -166,3 +166,2 @@ "use strict";

if (tagName && tagName !== '*') {
var reg = void 0;
if (tagName.startsWith('#')) {

@@ -173,21 +172,9 @@ // source += 'if (el.id != ' + JSON.stringify(tagName.substr(1)) + ') return false;';// 1

else {
reg = /^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/.exec(tagName);
var reg = /\[\s*([\w-]+)(\s*=\s*(((?<quote>'|")\s*(.*)(\k<quote>))|(\S*)))?\s*\]/.exec(tagName);
if (reg) {
attr_key = reg[1];
var method = reg[2];
if (method !== '=' && method !== '!=') {
// eslint-disable-next-line no-template-curly-in-string
throw new Error('Selector not supported, Expect [key${op}value].op must be =,!=');
}
if (method === '=') {
method = '==';
}
value = reg[7] || reg[8];
value = reg[6] || reg[8];
// source += `let attrs = el.attributes;for (let key in attrs){const val = attrs[key]; if (key == "${attr_key}" && val == "${value}"){return true;}} return false;`;// 2
function_name += '2';
}
else if ((reg = /^\[(.*?)\]/.exec(tagName))) {
attr_key = reg[1];
function_name += '5';
}
else {

@@ -194,0 +181,0 @@ // source += 'if (el.tagName != ' + JSON.stringify(tagName) + ') return false;';// 3

2

package.json
{
"name": "node-html-parser",
"version": "1.4.5",
"version": "1.4.6",
"description": "A very fast HTML parser, generating a simplified DOM, with basic element query support.",

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

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