Skip to content

Commit 526c36f

Browse files
committed
refactor(migrations): simplify version increment on overwrite
1 parent 94034c0 commit 526c36f

File tree

1 file changed

+2
-5
lines changed
  • projects/igniteui-angular/migrations/common

1 file changed

+2
-5
lines changed

projects/igniteui-angular/migrations/common/tsUtils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,8 @@ export function getLanguageService(filePaths: string[], host: Tree, options: ts.
146146
function patchHostOverwrite(host: Tree, fileVersions: Map<string, number>) {
147147
const original = host.overwrite;
148148
host.overwrite = (path: string, content: Buffer | string) => {
149-
if (!fileVersions.has(path)) {
150-
fileVersions.set(path, 1);
151-
} else {
152-
fileVersions.set(path, fileVersions.get(path) + 1);
153-
}
149+
const version = fileVersions.get(path) || 0;
150+
fileVersions.set(path, version + 1);
154151
original.call(host, path, content);
155152
};
156153
}

0 commit comments

Comments
 (0)