Skip to content

Commit

Permalink
Replaced type-cast with non-null-assertion as it is more type-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
timocov committed Nov 26, 2023
1 parent a9dba29 commit e1fd042
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bundle-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ export function generateDtsBundle(entries: readonly EntryPointConfig[], options:
return;
}

const importClause = st.importClause as ts.ImportClause;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const importClause = st.importClause!;
if (importClause.name !== undefined && areDeclarationSame(statement, importClause)) {
// import name from 'module';
importItem.defaultImports.add(collisionsResolver.addTopLevelIdentifier(importClause.name));
Expand Down

0 comments on commit e1fd042

Please sign in to comment.