Skip to content

Commit

Permalink
use null
Browse files Browse the repository at this point in the history
  • Loading branch information
bennycode committed Nov 17, 2024
1 parent d097bbc commit 2f0990c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/converter/convertFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ProjectUtil} from '../util/ProjectUtil.js';
import {replaceRequire} from './replaceRequire.js';

/**
* Returns the source file if it was modified; otherwise, returns undefined.
* Returns the source file ONLY if it was modified.
*/
export function convertFile(tsConfigFilePath: string, sourceFile: SourceFile) {
const filePath = sourceFile.getFilePath();
Expand Down Expand Up @@ -56,10 +56,5 @@ export function convertFile(tsConfigFilePath: string, sourceFile: SourceFile) {
});
});

if (madeChanges) {

return sourceFile;
}

return undefined;
return madeChanges ? sourceFile : null;
}

0 comments on commit 2f0990c

Please sign in to comment.