Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Nov 25, 2024
1 parent bfdc113 commit bbfd6aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/enricher/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ElementEnricher {

private getTechnologyCandidates(node: Node) {
const candidates: TechnologyTemplateMap[] = []
for (const plugin of this.graph.plugins.technology.filter(it => it.enabled())) {
for (const plugin of this.graph.plugins.technology.filter(it => it.backwards())) {
candidates.push(...plugin.assign(node))
}
return candidates
Expand All @@ -39,7 +39,7 @@ export class ElementEnricher {
*/
private enrichImplementations() {
// for backwards compatibility and testing purposed, continue if, e.g., no rules at all exists
if (utils.isEmpty(this.graph.plugins.technology.filter(it => it.enabled()))) return
if (utils.isEmpty(this.graph.plugins.technology.filter(it => it.backwards()))) return

for (const node of this.graph.nodes.filter(it => it.managed).filter(it => utils.isPopulated(it.technologies))) {
// Do not override manual assigned technologies but enrich them with an implementation
Expand Down
2 changes: 1 addition & 1 deletion src/technologies/plugins/rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class TechnologyRulePlugin implements TechnologyPlugin {
return rules
}

enabled() {
backwards() {
return this.hasRules()
}

Expand Down
3 changes: 2 additions & 1 deletion src/technologies/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export type TechnologyPluginBuilder = {
}

export type TechnologyPlugin = {
enabled: () => Boolean
// for backwards compatibility and testing purposed, continue if, e.g., no rules at all exists
backwards: () => Boolean

// TODO: must assign technology.assign!
assign: (node: Node) => TechnologyTemplateMap[]
Expand Down

0 comments on commit bbfd6aa

Please sign in to comment.