Skip to content

Commit

Permalink
#157 convert builtInIcons to Dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHeckert committed Sep 16, 2024
1 parent ef721c7 commit d9df4ad
Show file tree
Hide file tree
Showing 3 changed files with 764 additions and 234 deletions.
12 changes: 9 additions & 3 deletions src/app/domain/entities/dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Dictionary {

putEntry(entry: Entry): void {
if (!this.has(entry.key)) {
this.entries.push(new Entry(entry.value, entry.key));
this.entries.push(entry);
}
}

Expand All @@ -51,6 +51,10 @@ export class Dictionary {
});
}

addBuildInIcons(buildInIcons: Dictionary): void {
buildInIcons.entries.forEach(entry => this.set(entry.key, entry.value))
}

appendDict(dict: Dictionary): void {
dict.entries.forEach((entry) => this.putEntry(entry));
}
Expand All @@ -70,11 +74,13 @@ export class Dictionary {
}

export class Entry {
value: any;
value: any; // ToDo: dh, I think type of any is not a good choice. Try to figur out if we can use typed objects here.
key: string;
keyWords: string[];

constructor(value: any, key: string) {
constructor(value: any, key: string, keyWords: string[] = []) {
this.value = value;
this.key = key;
this.keyWords = keyWords;
}
}
Loading

0 comments on commit d9df4ad

Please sign in to comment.