Skip to content

Commit

Permalink
fix: don't overwrite variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AllieJonsson committed Jan 9, 2025
1 parent e19ce1b commit c51c3b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/generators/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,15 @@ export const addDependency = ({
}

if (types) {
let uniqueTypes = types;
if (values) {
types = types.filter((t) => !values.some((v) => v.name === t.name));
uniqueTypes = types.filter(
(t) => !values.some((v) => v.name === t.name),
);
dep += '\n';
}
dep += generateDependency({
deps: types,
deps: uniqueTypes,
isAllowSyntheticDefaultImports,
dependency,
specsName,
Expand Down

0 comments on commit c51c3b0

Please sign in to comment.