rename-variable.js 369 B

123456789
  1. 'use strict';
  2. const getVariableIdentifiers = require('../utils/get-variable-identifiers.js');
  3. const replaceReferenceIdentifier = require('./replace-reference-identifier.js');
  4. const renameVariable = (variable, name, fixer) =>
  5. getVariableIdentifiers(variable)
  6. .map(identifier => replaceReferenceIdentifier(identifier, name, fixer));
  7. module.exports = renameVariable;