babel-plugin-flow-type-getter
Advanced tools
Comparing version 1.0.1 to 1.0.2
23
index.js
@@ -172,14 +172,3 @@ const babylon = require('babylon'); | ||
const { left, right, operator } = path.node; | ||
// console.log('right = ', JSON.stringify(right)) | ||
// console.log('bool check : ', | ||
// left.type == 'UnaryExpression', | ||
// left.operator != null, | ||
// left.operator == 'typeof', | ||
// left.argument != null, | ||
// left.argument.type == 'MemberExpression', | ||
// (operator == '==' || operator == '==='), | ||
// class_names_list.find(cn => cn == left.argument.object.name) != null, | ||
// right != null, | ||
// right.value != null | ||
// ) | ||
if( | ||
@@ -204,10 +193,12 @@ left.type == 'UnaryExpression' && | ||
CallExpression(path) { | ||
const obj_name = path.node.callee.object.name; | ||
const prop_name = path.node.callee.property.name; | ||
const { object, property } = path.node.callee; | ||
const { arguments } = path.node; | ||
if( | ||
obj_name == 'Array' && | ||
prop_name == 'isArray' && | ||
object && object.name && | ||
property && property.name && | ||
object.name == 'Array' && | ||
property.name == 'isArray' && | ||
arguments && | ||
arguments[0].object && | ||
class_names_list.find(cn => cn == arguments[0].object.name) != null | ||
@@ -214,0 +205,0 @@ ) { |
{ | ||
"name": "babel-plugin-flow-type-getter", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Access flow types from uninstantiated classes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
53709
1713