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

@html-eslint/parser

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@html-eslint/parser - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

14

lib/ast-converter/ast-converter.js

@@ -27,2 +27,5 @@ /**

const converted = this.convertedStack.pop();
if (!converted) {
return;
}
if (this.convertedStack.isEmpty()) {

@@ -33,3 +36,8 @@ this.ast = converted;

while(this.convertedStack.top() === null) {
this.convertedStack.pop();
}
const parent = this.convertedStack.top();
!Array.isArray(parent.childNodes) && (parent.childNodes = []);

@@ -41,4 +49,6 @@ parent.childNodes.push(converted);

const esNode = NodeConverter.toNode(node);
esNode.childNodes = [];
this.convertedStack.push(NodeConverter.toNode(node));
if (esNode) {
esNode.childNodes = [];
}
this.convertedStack.push(esNode);
}

@@ -45,0 +55,0 @@ }

19

lib/ast-converter/node-converter.js
const utils = require("./utils");
const NodeConverter = {
toNode({
childNodes,
parentNode, // eslint-disable-line no-unused-vars
nodeName,
attrs,
sourceCodeLocation,
...extra
}) {
toNode(node) {
if (utils.isEmptyHTMLNode(node)) {
return null;
}
const {childNodes,
parentNode, // eslint-disable-line no-unused-vars
nodeName,
attrs,
sourceCodeLocation,
...extra
} = node;
const type = utils.toType(nodeName);

@@ -13,0 +16,0 @@ return {

@@ -77,2 +77,5 @@ function getLocFromChildNodes(childNodes) {

},
isEmptyHTMLNode(node) {
return !node || (node.nodeName !== "#document" && !node.sourceCodeLocation);
}
};
{
"name": "@html-eslint/parser",
"version": "0.2.0",
"version": "0.3.0",
"description": "Parser for @html-eslint/eslint-plugin",

@@ -24,3 +24,3 @@ "author": "yeonjuan",

"scripts": {
"test": "jest --coverage --verbose --updateSnapshot"
"test": "jest --coverage --updateSnapshot"
},

@@ -33,3 +33,3 @@ "bugs": {

},
"gitHead": "1bac029775d06cac9f8f4a3c1d606295ef13913d"
"gitHead": "229d0fa2f80eb6f34da26fe45768beea16bec53f"
}
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