Comparing version 1.2.7 to 1.2.8
{ | ||
"name": "astq", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "Abstract Syntax Tree (AST) Query Engine", | ||
@@ -5,0 +5,0 @@ "main": "lib/astq.browser.js", |
{ | ||
"name": "astq", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "Abstract Syntax Tree (AST) Query Engine", | ||
@@ -26,3 +26,3 @@ "keywords": [ "abstract", "syntax", "tree", "query", "engine", "adaptable" ], | ||
"pegjs": "~0.8.0", | ||
"asty": "~1.0.7", | ||
"asty": "~1.0.8", | ||
"cache-lru": "~1.0.3" | ||
@@ -35,9 +35,9 @@ }, | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-browserify": "~3.4.0", | ||
"grunt-browserify": "~3.5.0", | ||
"grunt-jscs": "~1.5.0", | ||
"grunt-mocha-test": "~0.12.7", | ||
"mocha": "~2.1.0", | ||
"chai": "~2.0.0", | ||
"chai": "~2.1.0", | ||
"babelify": "~5.0.3", | ||
"minifyify": "~6.2.2", | ||
"minifyify": "~6.3.0", | ||
"browserify-header": "~0.9.1", | ||
@@ -44,0 +44,0 @@ "browserify-derequire": "~0.9.2", |
@@ -25,4 +25,4 @@ /* | ||
let ASTQAdapterASTY = { | ||
taste (node) { | ||
export default class ASTQAdapterASTY { | ||
static taste (node) { | ||
return ( | ||
@@ -32,16 +32,16 @@ typeof node === "object" | ||
) | ||
}, | ||
getParentNode (node) { | ||
} | ||
static getParentNode (node) { | ||
return node.parent() | ||
}, | ||
getChildNodes (node) { | ||
} | ||
static getChildNodes (node) { | ||
return node.childs() | ||
}, | ||
getNodeType (node) { | ||
} | ||
static getNodeType (node) { | ||
return node.type() | ||
}, | ||
getNodeAttrNames (node) { | ||
} | ||
static getNodeAttrNames (node) { | ||
return node.attrs() | ||
}, | ||
getNodeAttrValue (node, attr) { | ||
} | ||
static getNodeAttrValue (node, attr) { | ||
return node.get(attr) | ||
@@ -51,3 +51,1 @@ } | ||
export default ASTQAdapterASTY | ||
@@ -27,4 +27,4 @@ /* | ||
let ASTQAdapterMozAST = { | ||
taste (node) { | ||
export default class ASTQAdapterMozAST { | ||
static taste (node) { | ||
return ( | ||
@@ -35,7 +35,7 @@ typeof node === "object" | ||
) | ||
}, | ||
getParentNode (/* node */) { | ||
} | ||
static getParentNode (/* node */) { | ||
throw new Error("Mozilla SpiderMonkey AST does not support parent node traversal") | ||
}, | ||
getChildNodes (node) { | ||
} | ||
static getChildNodes (node) { | ||
let childs = [] | ||
@@ -56,7 +56,7 @@ for (let field in node) { | ||
return childs | ||
}, | ||
getNodeType (node) { | ||
} | ||
static getNodeType (node) { | ||
return node.type | ||
}, | ||
getNodeAttrNames (node) { | ||
} | ||
static getNodeAttrNames (node) { | ||
let names = [] | ||
@@ -70,4 +70,4 @@ for (let field in node) | ||
return names | ||
}, | ||
getNodeAttrValue (node, attr) { | ||
} | ||
static getNodeAttrValue (node, attr) { | ||
if ( node.hasOwnProperty(attr) | ||
@@ -83,3 +83,1 @@ && typeof node[attr] !== "object" | ||
export default ASTQAdapterMozAST | ||
@@ -25,4 +25,4 @@ /* | ||
let ASTQAdapterXMLDOM = { | ||
taste (node) { | ||
export default class ASTQAdapterXMLDOM { | ||
static taste (node) { | ||
/* global Node: true */ | ||
@@ -36,17 +36,17 @@ return ( | ||
) | ||
}, | ||
getParentNode (node) { | ||
} | ||
static getParentNode (node) { | ||
return node.parentNode | ||
}, | ||
getChildNodes (node) { | ||
} | ||
static getChildNodes (node) { | ||
return node.childNodes | ||
}, | ||
getNodeType (node) { | ||
} | ||
static getNodeType (node) { | ||
return node.nodeName | ||
}, | ||
getNodeAttrNames (node) { | ||
} | ||
static getNodeAttrNames (node) { | ||
return Array.prototype.slice.call(node.attributes, 0) | ||
.map((n) => n.nodeName) | ||
}, | ||
getNodeAttrValue (node, attr) { | ||
} | ||
static getNodeAttrValue (node, attr) { | ||
return node.getAttribute(attr) | ||
@@ -56,3 +56,1 @@ } | ||
export default ASTQAdapterXMLDOM | ||
@@ -110,1 +110,2 @@ /* | ||
export default stdfuncs | ||
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
445627
6677
Updatedasty@~1.0.8