import { default } from "https://deno.land/x/ayonli_jsext@v0.9.72/collections/BiMap.ts";
Bi-directional map, keys and values are unique and map to each other.
Examples
Example 1
Example 1
import { BiMap } from "@ayonli/jsext/collections";
const map = new BiMap<string, string>();
map.set("foo", "hello");
map.set("bar", "world");
console.log(map.get("foo")); // hello
console.log(map.getKey("world")); // bar
map.delete("foo");
console.log(map.hasValue("hello")); // false
map.deleteValue("world");
console.log(map.has("bar")); // false