UNPKG

eslint-plugin-unicorn

Version:
9 lines (7 loc) 361 B
'use strict'; const getVariableIdentifiers = require('./get-variable-identifiers.js'); const replaceReferenceIdentifier = require('./replace-reference-identifier.js'); const renameVariable = (variable, name, fixer) => getVariableIdentifiers(variable) .map(identifier => replaceReferenceIdentifier(identifier, name, fixer)); module.exports = renameVariable;