(value: T, identifier?: string)
| 6 | constructor(private readonly generateIdentifier: (v: T) => string) {} |
| 7 | |
| 8 | register(value: T, identifier?: string): void { |
| 9 | if (this.kv.getByValue(value)) { |
| 10 | return; |
| 11 | } |
| 12 | |
| 13 | if (!identifier) { |
| 14 | identifier = this.generateIdentifier(value); |
| 15 | } |
| 16 | |
| 17 | this.kv.set(identifier, value); |
| 18 | } |
| 19 | |
| 20 | clear(): void { |
| 21 | this.kv.clear(); |
no test coverage detected