@nidomiro/relation-tuple-parser
Version:
[](https://www.npmjs.com/package/@nidomiro/relation-tuple-parser)
23 lines • 563 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TwoWayMap = void 0;
class TwoWayMap {
constructor(map) {
this.map = map;
this.reverseMap = new Map();
map.forEach((value, key) => {
this.reverseMap.set(value, key);
});
}
get(key) {
return this.map.get(key);
}
getByValue(value) {
return this.reverseMap.get(value);
}
values() {
return this.map.values();
}
}
exports.TwoWayMap = TwoWayMap;
//# sourceMappingURL=two-way-map.js.map