mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(ivy): avoid type coercion in saveNameToExportMap function (#34335)
TypeScript 3.7 flags `if` conditions that implicitly coerce a function/method definition. While checking for the `template` presence on a def (actually checking whether we work with Component) in `saveNameToExportMap`, the `if` condition had implicit type coercion. This commit updates the condition to use the `isComponentDef` function (that checks `def.template` against `null` internally) to avoid compilation errors with TypeScript 3.7. PR Close #34335
This commit is contained in:
parent
46f9201e6f
commit
74bbe3e413
1 changed files with 1 additions and 1 deletions
|
|
@ -1312,7 +1312,7 @@ function saveNameToExportMap(
|
|||
exportsMap[def.exportAs[i]] = index;
|
||||
}
|
||||
}
|
||||
if ((def as ComponentDef<any>).template) exportsMap[''] = index;
|
||||
if (isComponentDef(def)) exportsMap[''] = index;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue