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 3.0.2 to 3.0.3

10

dist/esm/matcher.js
import NodeType from './nodes/type';
function isTag(node) {
return node.nodeType === NodeType.ELEMENT_NODE;
return node && node.nodeType === NodeType.ELEMENT_NODE;
}
function getAttributeValue(elem, name) {
return elem.getAttribute(name);
return isTag(elem) ? elem.getAttribute(name) : undefined;
}
function getName(elem) {
return (elem.rawTagName || '').toLowerCase();
return ((elem && elem.rawTagName) || '').toLowerCase();
}
function getChildren(node) {
return node.childNodes;
return node && node.childNodes;
}
function getParent(node) {
return node.parentNode;
return node ? node.parentNode : null;
}

@@ -17,0 +17,0 @@ function getText(node) {

@@ -98,15 +98,15 @@ var __extends = (this && this.__extends) || (function () {

function isTag(node) {
return node.nodeType === type_2.default.ELEMENT_NODE;
return node && node.nodeType === type_2.default.ELEMENT_NODE;
}
function getAttributeValue(elem, name) {
return elem.getAttribute(name);
return isTag(elem) ? elem.getAttribute(name) : undefined;
}
function getName(elem) {
return (elem.rawTagName || '').toLowerCase();
return ((elem && elem.rawTagName) || '').toLowerCase();
}
function getChildren(node) {
return node.childNodes;
return node && node.childNodes;
}
function getParent(node) {
return node.parentNode;
return node ? node.parentNode : null;
}

@@ -113,0 +113,0 @@ function getText(node) {

@@ -8,15 +8,15 @@ "use strict";

function isTag(node) {
return node.nodeType === type_1.default.ELEMENT_NODE;
return node && node.nodeType === type_1.default.ELEMENT_NODE;
}
function getAttributeValue(elem, name) {
return elem.getAttribute(name);
return isTag(elem) ? elem.getAttribute(name) : undefined;
}
function getName(elem) {
return (elem.rawTagName || '').toLowerCase();
return ((elem && elem.rawTagName) || '').toLowerCase();
}
function getChildren(node) {
return node.childNodes;
return node && node.childNodes;
}
function getParent(node) {
return node.parentNode;
return node ? node.parentNode : null;
}

@@ -23,0 +23,0 @@ function getText(node) {

{
"name": "node-html-parser",
"version": "3.0.2",
"version": "3.0.3",
"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