Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 1 month ago
JSON representation

🙃 Invert key-value pairs in an object, e.g., { foo: "bar" } → { bar: "foo" }

Awesome Lists containing this project

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).

[![Deno CI](https://github.com/denorg/invert-kv/workflows/Deno%20CI/badge.svg)](https://github.com/denorg/invert-kv/actions)
[![GitHub](https://img.shields.io/github/license/denorg/invert-kv)](https://github.com/denorg/invert-kv/blob/master/LICENSE)
[![Contributors](https://img.shields.io/github/contributors/denorg/invert-kv)](https://github.com/denorg/invert-kv/graphs/contributors)
[![Deno Starter](https://img.shields.io/badge/deno-starter-brightgreen)](https://denorg.github.io/starter/)
[![Made by Denorg](https://img.shields.io/badge/made%20by-denorg-0082fb)](https://github.com/denorg)
[![TypeScript](https://img.shields.io/badge/types-TypeScript-blue)](https://github.com/denorg/invert-kv)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](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 →