Skip to content

Commit

Permalink
fix: Error in generic type usage in internal checkDuplicatePluginKeys…
Browse files Browse the repository at this point in the history
… using reduce
  • Loading branch information
PopperLi committed Sep 5, 2023
1 parent f24b3d5 commit e9b6141
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/preset-umi/src/features/tmpFiles/tmpFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,14 @@ if (process.env.NODE_ENV === 'development') {

function checkDuplicatePluginKeys(arr: string[]) {
const duplicates: string[] = [];
arr.reduce((prev, curr) => {
arr.reduce<{ [k: string]: boolean }>((prev, curr) => {
if (prev[curr]) {
duplicates.push(curr);
} else {
prev[curr] = true;
}
return prev;
}, {} as { [k: string]: boolean });
}, {});
if (duplicates.length) {
throw new Error(
`The plugin key cannot be duplicated. (${duplicates.join(', ')})`,
Expand Down

0 comments on commit e9b6141

Please sign in to comment.