escomplex-ast-moz
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"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 + '"'; |
21769
+ Addedcheck-types@1.1.1(transitive)
+ Addedescomplex-traits@0.2.0(transitive)
- Removedcheck-types@0.7.2(transitive)
- Removedescomplex-traits@0.1.2(transitive)
Updatedcheck-types@1.1.x
Updatedescomplex-traits@0.2.x