Skip to content

Commit

Permalink
Remove obsolete by set
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 19, 2024
1 parent 7e71f71 commit 4de4108
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/knip/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ export const main = async (unresolvedConfiguration: CommandLineOptions) => {
for (const id of importItems.importedNs) importedModule.importedNs.add(id);
for (const id of importItems.isReExportedBy) importedModule.isReExportedBy.add(id);
for (const id of importItems.isReExportedNs) importedModule.isReExportedNs.add(id);
for (const id of importItems.by) importedModule.by.add(id);
if (importItems.hasStar) importedModule.hasStar = true;
if (importItems.isReExport) importedModule.isReExport = true;
};
Expand Down
1 change: 0 additions & 1 deletion packages/knip/src/types/serializable-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export type SerializableImports = {
isReExportedBy: Set<string>;
isReExportedAs: Set<[string, string]>;
isReExportedNs: Set<[string, string]>;
by: Set<string>;
};

export type SerializableImportMap = Record<FilePath, SerializableImports>;
Expand Down
3 changes: 0 additions & 3 deletions packages/knip/src/typescript/getImportsAndExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ const getImportsAndExports = (
isReExportedNs: new Set(),
importedNs: new Set(),
identifiers: new Set(),
by: new Set(),
});

internalImport.by.add(sourceFile.fileName);

if (isReExport) {
internalImport.isReExport = true;
if (namespace && isStar) internalImport.isReExportedAs.add([sourceFile.fileName, namespace]);
Expand Down

0 comments on commit 4de4108

Please sign in to comment.