DCFronted/node_modules/superjson/dist/double-indexed-kv.js
zyb 0c0b5d869c 加入了node_modules
添加了新的功能项
2025-05-13 21:23:41 +08:00

21 lines
514 B
JavaScript

export class DoubleIndexedKV {
constructor() {
this.keyToValue = new Map();
this.valueToKey = new Map();
}
set(key, value) {
this.keyToValue.set(key, value);
this.valueToKey.set(value, key);
}
getByKey(key) {
return this.keyToValue.get(key);
}
getByValue(value) {
return this.valueToKey.get(value);
}
clear() {
this.keyToValue.clear();
this.valueToKey.clear();
}
}
//# sourceMappingURL=double-indexed-kv.js.map