https://github.com/denorg/invert-kv
🙃 Invert key-value pairs in an object, e.g., { foo: "bar" } → { bar: "foo" }
https://github.com/denorg/invert-kv
deno denoland denorg key-value object typescript
Last synced: 3 days ago
JSON representation
🙃 Invert key-value pairs in an object, e.g., { foo: "bar" } → { bar: "foo" }
- Host: GitHub
- URL: https://github.com/denorg/invert-kv
- Owner: denorg
- License: mit
- Created: 2020-05-14T23:10:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T11:52:50.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T00:38:25.982Z (23 days ago)
- Topics: deno, denoland, denorg, key-value, object, typescript
- Language: TypeScript
- Homepage: https://denorg.github.io/invert-kv/
- Size: 14.6 KB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - invert-kv - Invert key-value pairs in Deno. (Modules / Online Playgrounds)
- awesome-deno - invert-kv - Invert key-value pairs in Deno. (Modules / Utils)
- awesome-deno-cn - @denorg/invert-kv
README
# 🙃 Invert KV
Invert the key-value pairs in an object in Deno. This is a port of [sindresorhus/invert-kv](https://github.com/sindresorhus/invert-kv).
[](https://github.com/denorg/invert-kv/actions)
[](https://github.com/denorg/invert-kv/blob/master/LICENSE)
[](https://github.com/denorg/invert-kv/graphs/contributors)
[](https://denorg.github.io/starter/)
[](https://github.com/denorg)
[](https://github.com/denorg/invert-kv)
[](https://github.com/semantic-release/semantic-release)```ts
import { invert } from "https://deno.land/x/invert_kv/mod.ts";const obj = { hello: "world" };
const result = invert(); // { world: "hello" }
```## 👩💻 Development
Run tests:
```bash
deno test
```## 📄 License
MIT © [Denorg](https://den.org.in)
A project by Denorg, the world's first Deno-focused community
organization and consulting company. Work with us →