UNPKG

@ts-intl/dependency

Version:

I18n keys dependency analysis

17 lines (14 loc) 436 B
import { IAction, NewFile } from '../types'; import { getDependenciesNoRecursion } from '../utils'; export const newFileAction: IAction<NewFile> = async ( { from }, { extractIntlKeys, ignoreCollectDeps, madgeConfig }, ctx ) => { // update ctx ctx.pathIntlKeysMap[from] = await extractIntlKeys(from); if (!ignoreCollectDeps) { ctx.graph[from] = await getDependenciesNoRecursion(from, madgeConfig); } return ctx; };