(key: string, value: T)
| 18 | // Adds a new entry, replacing an existing entry. |
| 19 | // Returns false if it was already present. |
| 20 | set(key: string, value: T): boolean { |
| 21 | const encodedKey = this.encodeKey(key); |
| 22 | const wasPresent = this._map[encodedKey] !== undefined; |
| 23 | |
| 24 | this._map[encodedKey] = value; |
| 25 | return !wasPresent; |
| 26 | } |
| 27 | |
| 28 | // Adds a new entry if the key isn't already defined. |
| 29 | // Returns false if it was already present. |
no test coverage detected