Skip to content

Commit

Permalink
Angular: Handle nested module metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Nov 10, 2023
1 parent 9648116 commit f16de2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const isComponentAlreadyDeclared = (
): boolean => {
if (
moduleDeclarations &&
moduleDeclarations.some((declaration) => declaration === componentToFind)
moduleDeclarations.flat().some((declaration) => declaration === componentToFind)
) {
// Found component in declarations array
return true;
Expand All @@ -23,7 +23,7 @@ export const isComponentAlreadyDeclared = (
return false;
}

return moduleImports.some((importItem) => {
return moduleImports.flat().some((importItem) => {
const extractedNgModuleMetadata = extractNgModuleMetadata(importItem);
if (!extractedNgModuleMetadata) {
// Not an NgModule
Expand Down

0 comments on commit f16de2f

Please sign in to comment.