Skip to content

Commit

Permalink
Use for loops instead of forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Sep 17, 2024
1 parent b0a36d8 commit 0998cc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,21 +423,21 @@ const updateNamespaceStatus = (routes: Route[]): Route[] => {
)

// Update namespace status based on routes
Object.values(namespaceGroups).forEach((routesInNamespace) => {
for (const routesInNamespace of Object.values(namespaceGroups)) {
const isNamespaceDeprecated = routesInNamespace.every(
(route) => route.isDeprecated,
)
const isNamespaceUndocumented = routesInNamespace.every(
(route) => route.isUndocumented,
)

routesInNamespace.forEach((route) => {
for (const route of routesInNamespace) {
if (route.namespace) {

Check failure on line 435 in src/lib/blueprint.ts

View workflow job for this annotation

GitHub Actions / Format code

Unexpected nullable object value in conditional. An explicit null check is required

Check failure on line 435 in src/lib/blueprint.ts

View workflow job for this annotation

GitHub Actions / Lint (Node.js v18)

Unexpected nullable object value in conditional. An explicit null check is required

Check failure on line 435 in src/lib/blueprint.ts

View workflow job for this annotation

GitHub Actions / Lint (Node.js v20)

Unexpected nullable object value in conditional. An explicit null check is required
route.namespace.isDeprecated = isNamespaceDeprecated
route.namespace.isUndocumented = isNamespaceUndocumented
}
})
})
}
}

return routes
}
Expand Down

0 comments on commit 0998cc3

Please sign in to comment.