UNPKG

astx

Version:

super powerful structural search and replace for JavaScript and TypeScript to automate your refactoring

24 lines (19 loc) 762 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = compileVariableDeclaratorMatcher; var _Placeholder = _interopRequireDefault(require("./Placeholder")); function compileVariableDeclaratorMatcher(path, compileOptions) { var pattern = path.value; var n = compileOptions.backend.t.namedTypes; if (n.Identifier.check(pattern.id) && pattern.id.typeAnnotation == null) { if (pattern.init == null) { var placeholderMatcher = (0, _Placeholder["default"])(path, pattern.id.name, compileOptions, { nodeType: 'VariableDeclarator' }); if (placeholderMatcher) return placeholderMatcher; } } }