Skip to content

Commit a9ae386

Browse files
committed
feat: implement alias caching
1 parent e248e4e commit a9ae386

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,18 @@ export function normalizeConfigFileOptions(
263263
return undefined;
264264
}
265265

266+
const aliasCache = new Map<string, Record<string, string[]>>();
267+
266268
export function normalizeAlias(
267269
alias: Record<string, string | string[]> | undefined,
268270
parent: string,
269271
): Record<string, string[]> | undefined {
270272
if (!alias) return undefined;
271273

274+
if (aliasCache.has(parent)) {
275+
return aliasCache.get(parent);
276+
}
277+
272278
return Object.keys(alias).reduce(
273279
(acc, key) => {
274280
const value = Array.isArray(alias[key]) ? alias[key] : [alias[key]];

0 commit comments

Comments
 (0)