https://github.com/afeiship/next-pick-pairs
Pick key/value pairs from object.
https://github.com/afeiship/next-pick-pairs
next object pairs pick
Last synced: 6 months ago
JSON representation
Pick key/value pairs from object.
- Host: GitHub
- URL: https://github.com/afeiship/next-pick-pairs
- Owner: afeiship
- License: mit
- Created: 2017-10-19T03:50:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T07:26:59.000Z (almost 5 years ago)
- Last Synced: 2025-01-06T08:08:41.366Z (9 months ago)
- Topics: next, object, pairs, pick
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-pick-pairs
> Pick key/value pairs from object.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```bash
npm install -S @jswork/next-pick-pairs
```## usage
```js
import '@jswork/next-pick-pairs';const obj = {
"nickname": null,
"uid": "UR1785049326",
"job": null,
"last_name": null,
"username": "15502115100",
"last_active": "2017-09-22T13:08:04.753046Z",
"is_staff": false,
"login_count": 5,
"gender": null,
"is_active": true,
"groups": [],
"company": null,
"is_superuser": false,
"first_name": null,
"last_login": "2017-09-22T13:08:04.753038Z",
"permissions": [],
"date_joined": "2017-09-19T14:13:10.129030Z",
"email": 'test@email.com',
"phone": "15502115100"
};const res = nx.pickPairs(obj,['nickname','is_staff','email']);
//result:
[ { key: 'nickname', value: null },
{ key: 'is_staff', value: false },
{ key: 'email', value: 'test@email.com' } ]
```## license
Code released under [the MIT license](https://github.com/afeiship/next-pick-pairs/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-pick-pairs
[version-url]: https://npmjs.org/package/@jswork/next-pick-pairs[license-image]: https://img.shields.io/npm/l/@jswork/next-pick-pairs
[license-url]: https://github.com/afeiship/next-pick-pairs/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-pick-pairs
[size-url]: https://github.com/afeiship/next-pick-pairs/blob/master/dist/next-pick-pairs.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-pick-pairs
[download-url]: https://www.npmjs.com/package/@jswork/next-pick-pairs