(type, node, opts)
| 736 | var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS)); |
| 737 | |
| 738 | function is(type, node, opts) { |
| 739 | if (!node) return false; |
| 740 | |
| 741 | var matches = isType(node.type, type); |
| 742 | if (!matches) return false; |
| 743 | |
| 744 | if (typeof opts === "undefined") { |
| 745 | return true; |
| 746 | } else { |
| 747 | return t.shallowEqual(node, opts); |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | function isType(nodeType, targetType) { |
| 752 | if (nodeType === targetType) return true; |
no test coverage detected