just-pick
TypeScript icon, indicating that this package has built-in type declarations

4.2.0 • Public • Published

just-pick

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-pick
yarn add just-pick

Copy an object but with only the specified keys

import pick from 'just-pick';

var obj = { a: 3, b: 5, c: 9 };
pick(obj, ['a', 'c']); // {a: 3, c: 9}
pick(obj, 'a', 'c'); // {a: 3, c: 9}
pick(obj, ['a', 'b', 'd']); // {a: 3, b: 5}
pick(obj, ['a', 'a']); // {a: 3}

Package Sidebar

Install

npm i just-pick

Weekly Downloads

32,735

Version

4.2.0

License

MIT

Unpacked Size

5.16 kB

Total Files

9

Last publish

Collaborators

  • angus-c
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy