move util.isPattern to traverse.isPattern

This commit is contained in:
Sebastian McKenzie
2014-10-13 20:12:28 +11:00
parent 2d3a82a8d6
commit 7bb53314a8
2 changed files with 4 additions and 4 deletions

View File

@@ -82,6 +82,10 @@ traverse.isFunction = function (node) {
return _.contains(traverse.FUNCTION_TYPES, node.type);
};
traverse.isPattern = function (node) {
return node.type === "ArrayPattern" || node.type === "ObjectPattern";
};
traverse.Delete = {};
traverse.hasType = function (tree, type, blacklistTypes) {

View File

@@ -20,10 +20,6 @@ exports.ensureBlock = function (node) {
node.body = b.blockStatement(block);
};
exports.isPattern = function (node) {
return node.type === "ArrayPattern" || node.type === "ObjectPattern";
};
exports.isAbsolute = function (loc) {
if (!loc) return false;
if (loc[0] === "/") return true; // unix