refactor(ivy): ngcc - use .has() to check Map membership (#25445)

Previously we were relying upon the `.get()` method to return `undefined`
but it is clearer and safer to always check with `.has()` first.

PR Close #25445
This commit is contained in:
Pete Bacon Darwin
2019-05-14 08:36:57 +01:00
committed by Jason Aden
parent edd775eabc
commit 757d4c33df
4 changed files with 25 additions and 16 deletions

View File

@ -63,7 +63,7 @@ export class ModuleWithProvidersAnalyzer {
ngModule = {node: dtsNgModule, viaModule: null};
}
const dtsFile = dtsFn.getSourceFile();
const analysis = analyses.get(dtsFile) || [];
const analysis = analyses.has(dtsFile) ? analyses.get(dtsFile) : [];
analysis.push({declaration: dtsFn, ngModule});
analyses.set(dtsFile, analysis);
}