π Invert key-value pairs in an object, e.g., { foo: "bar" } β { bar: "foo" }
Invert the key-value pairs in an object in Deno. This is a port of sindresorhus/invert-kv.
import { invert } from "https://deno.land/x/invert_kv/mod.ts";
const obj = { hello: "world" };
const result = invert(); // { world: "hello" }
Run tests:
deno test
MIT Β© Denorg
A project by Denorg, the world's first Deno-focused community
organization and consulting company. Work with us β