Socket
Socket
Sign inDemoInstall

esquery

Package Overview
Dependencies
1
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

26

esquery.js

@@ -86,2 +86,18 @@ /* vim: set sw=4 sts=4 : */

case 'has':
var a, collector = [];
for (i = 0, l = selector.selectors.length; i < l; ++i) {
a = [];
estraverse.traverse(node, {
enter: function (node, parent) {
if (parent != null) { a.unshift(parent); }
if (matches(node, selector.selectors[i], a)) {
collector.push(node);
}
},
leave: function () { a.shift(); }
});
}
return collector.length !== 0;
case 'child':

@@ -111,3 +127,3 @@ if (matches(node, selector.right, ancestry)) {

switch (selector.value.type) {
case 'regexp': return selector.value.value.test(p);
case 'regexp': return typeof p === 'string' && selector.value.value.test(p);
case 'literal': return '' + selector.value.value === '' + p;

@@ -167,4 +183,8 @@ case 'type': return selector.value.value === typeof p;

return node.type.slice(-10) === 'Expression' ||
node.type === 'Literal' ||
node.type === 'Identifier';
node.type.slice(-7) === 'Literal' ||
(
node.type === 'Identifier' &&
(ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')
) ||
node.type === 'MetaProperty';
case 'function':

@@ -171,0 +191,0 @@ return node.type.slice(0, 8) === 'Function' ||

4

package.json
{
"name": "esquery",
"preferGlobal": false,
"version": "1.0.0",
"version": "1.0.1",
"author": "Joel Feenstra <jrfeenst+esquery@gmail.com>",

@@ -33,3 +33,3 @@ "description": "A query library for ECMAScript AST using a CSS selector like query language.",

},
"license": "BSD",
"license": "BSD-3-Clause",
"engines": {

@@ -36,0 +36,0 @@ "node": ">=0.6"

Sorry, the diff of this file is too big to display

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