Socket
Socket
Sign inDemoInstall

escomplex-ast-moz

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

6

package.json
{
"name": "escomplex-ast-moz",
"version": "0.1.4",
"version": "0.1.5",
"description": "Mozilla-format AST walker for escomplex.",

@@ -29,4 +29,4 @@ "homepage": "https://github.com/philbooth/escomplex-ast-moz",

"dependencies": {
"check-types": "0.7.x",
"escomplex-traits": "0.1.x"
"check-types": "1.1.x",
"escomplex-traits": "0.2.x"
},

@@ -33,0 +33,0 @@ "devDependencies": {

@@ -16,9 +16,9 @@ /*globals exports, require */

check.verifyObject(tree, 'Invalid syntax tree');
check.verifyArray(tree.body, 'Invalid syntax tree body');
check.verifyObject(settings, 'Invalid settings');
check.verifyObject(callbacks, 'Invalid callbacks');
check.verifyFunction(callbacks.processNode, 'Invalid processNode callback');
check.verifyFunction(callbacks.createScope, 'Invalid createScope callback');
check.verifyFunction(callbacks.popScope, 'Invalid popScope callback');
check.verify.object(tree, 'Invalid syntax tree');
check.verify.array(tree.body, 'Invalid syntax tree body');
check.verify.object(settings, 'Invalid settings');
check.verify.object(callbacks, 'Invalid callbacks');
check.verify.fn(callbacks.processNode, 'Invalid processNode callback');
check.verify.fn(callbacks.createScope, 'Invalid createScope callback');
check.verify.fn(callbacks.popScope, 'Invalid popScope callback');

@@ -38,6 +38,6 @@ syntaxes = syntaxDefinitions.get(settings);

if (check.isObject(node)) {
if (check.object(node)) {
syntax = syntaxes[node.type];
if (check.isObject(syntax)) {
if (check.object(syntax)) {
callbacks.processNode(node, syntax);

@@ -61,7 +61,7 @@

if (check.isArray(syntax.children)) {
if (check.array(syntax.children)) {
syntax.children.forEach(function (child) {
visitChild(
node[child],
check.isFunction(syntax.assignableName) ? syntax.assignableName(node) : ''
check.fn(syntax.assignableName) ? syntax.assignableName(node) : ''
);

@@ -73,3 +73,3 @@ });

function visitChild (child, assignedName) {
var visitor = check.isArray(child) ? visitNodes : visitNode;
var visitor = check.array(child) ? visitNodes : visitNode;
visitor(child, assignedName);

@@ -76,0 +76,0 @@ }

@@ -8,7 +8,7 @@ /*globals require, module */

module.exports = function (object, defaultName) {
if (check.isObject(object) && check.isUnemptyString(object.name)) {
if (check.object(object) && check.unemptyString(object.name)) {
return object.name;
}
if (check.isUnemptyString(defaultName)) {
if (check.unemptyString(defaultName)) {
return defaultName;

@@ -15,0 +15,0 @@ }

@@ -14,3 +14,3 @@ /*globals require, exports */

function (node) {
if (check.isString(node.value)) {
if (check.string(node.value)) {
// Avoid conflicts between string literals and identifiers.

@@ -17,0 +17,0 @@ return '"' + node.value + '"';

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