securityos/node_modules/eslint-plugin-unicorn/rules/fix/rename-variable.js

10 lines
369 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
'use strict';
const getVariableIdentifiers = require('../utils/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;