This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bidirectional-map.js | |
// BidirectionalMap, StrictBidirectionalMap, SilentBidirectionalMap | |
// Two-way map. Same API as Map with the addition of getKey, hasValue, and deleteValue. | |
// In this version, values will stay unique by deleting previous keys. | |
export class BidirectionalMap extends Map { | |
#inverseMap = new Map(); | |
constructor(entries) { |