change NodePath#inType to use arguments instead of types

This commit is contained in:
Sebastian McKenzie 2015-06-13 18:50:19 +01:00
parent ce03457b19
commit 4934ea56a0

View File

@ -44,12 +44,10 @@ export function getAncestry() {
* Description * Description
*/ */
export function inType(types) { export function inType() {
if (!Array.isArray(types)) types = [types];
var path = this; var path = this;
while (path) { while (path) {
for (var type of (types: Array)) { for (var type of (arguments: Array)) {
if (path.node.type === type) return true; if (path.node.type === type) return true;
} }
path = path.parentPath; path = path.parentPath;