@ts-intl/dependency
Version:
I18n keys dependency analysis
14 lines (12 loc) • 340 B
text/typescript
import { IAction, Renamed } from '../types';
import { changeModule } from '../utils';
export const renamedAction: IAction<Renamed> = async (
{ from, to },
opts,
ctx
) => {
ctx.graph = await changeModule(from, to, ctx.graph);
ctx.pathIntlKeysMap[to] = ctx.pathIntlKeysMap[from];
delete ctx.pathIntlKeysMap[to];
return ctx;
};