Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjarneo/object-swap
Switch the object key and value. It doesn't work with nested objects.
https://github.com/bjarneo/object-swap
Last synced: 3 days ago
JSON representation
Switch the object key and value. It doesn't work with nested objects.
- Host: GitHub
- URL: https://github.com/bjarneo/object-swap
- Owner: bjarneo
- License: mit
- Created: 2015-12-21T22:16:56.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-21T22:17:43.000Z (almost 9 years ago)
- Last Synced: 2024-11-03T18:05:27.180Z (10 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
object-swap
======What
------
Switch the object key and value. It doesn't work with nested objects.Installation
------
```
$ npm install --save object-swap
```Usage
------
```javascript
var swap = require('object-swap');console.log(swap({
a: 1,
b: 2,
c: 3
}));// { '1': 'a', '2': 'b', '3': 'c' }
```
Test
------
```
npm test
```Contribution
------
Contributions are appreciated.License
------
MIT-licensed. See LICENSE.