Sha256: 4dd0c7d2976577ce12ba852e228eca428e84b938e602a20a1486bfbf0d730a7f
Contents?: true
Size: 1.9 KB
Versions: 3
Compression:
Stored size: 1.9 KB
Contents
"use strict"; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } var _transformationHelpersReact = require("../../../transformation/helpers/react"); var react = _interopRequireWildcard(_transformationHelpersReact); var _types = require("../../../types"); var t = _interopRequireWildcard(_types); var ReferencedIdentifier = { types: ["Identifier", "JSXIdentifier"], checkPath: function checkPath(_ref, opts) { var node = _ref.node; var parent = _ref.parent; if (!t.isIdentifier(node, opts)) { if (t.isJSXIdentifier(node, opts)) { if (react.isCompatTag(node.name)) return false; } else { // not a JSXIdentifier or an Identifier return false; } } // check if node is referenced return t.isReferenced(node, parent); } }; exports.ReferencedIdentifier = ReferencedIdentifier; var Expression = { types: ["Expression"], checkPath: function checkPath(path) { if (path.isIdentifier()) { return path.isReferencedIdentifier(); } else { return t.isExpression(path.node); } } }; exports.Expression = Expression; var Scope = { types: ["Scopable"], checkPath: function checkPath(path) { return t.isScope(path.node, path.parent); } }; exports.Scope = Scope; var Referenced = { checkPath: function checkPath(path) { return t.isReferenced(path.node, path.parent); } }; exports.Referenced = Referenced; var BlockScoped = { checkPath: function checkPath(path) { return t.isBlockScoped(path.node); } }; exports.BlockScoped = BlockScoped; var Var = { types: ["VariableDeclaration"], checkPath: function checkPath(path) { return t.isVar(path.node); } }; exports.Var = Var;
Version data entries
3 entries across 3 versions & 1 rubygems