move util.isPattern to traverse.isPattern
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user