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
*/
export function inType(types) {
if (!Array.isArray(types)) types = [types];
export function inType() {
var path = this;
while (path) {
for (var type of (types: Array)) {
for (var type of (arguments: Array)) {
if (path.node.type === type) return true;
}
path = path.parentPath;