Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ndhoule/pick

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndhoule/pick - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

.npmignore

4

HISTORY.md

@@ -0,1 +1,5 @@

## 2.0.0
- Remove Component/Duo support
## 1.0.2

@@ -2,0 +6,0 @@

7

index.js

@@ -30,5 +30,3 @@ 'use strict';

* @api public
* @category Object
* @see {@link omit}
* @param {Array.<string>|string} props The property or properties to keep.
* @param {string|string[]} props The property or properties to keep.
* @param {Object} object The object to iterate over.

@@ -45,3 +43,2 @@ * @return {Object} A new object containing only the specified properties from `object`.

*/
var pick = function pick(props, object) {

@@ -71,3 +68,3 @@ if (!existy(object) || !isObject(object)) {

/**
/*
* Exports.

@@ -74,0 +71,0 @@ */

{
"name": "@ndhoule/pick",
"version": "1.0.2",
"description": "Create a shallow copy of the input object which contains only the specified properties.",
"version": "2.0.0",
"description": "Create a shallow copy of an input object that contains only the specified properties.",
"main": "index.js",

@@ -6,0 +6,0 @@ "repository": {

# pick [![CI][ci-badge]][ci-link]
Create a shallow copy of the input object which contains only the specified properties.
Create a shallow copy of an input object that contains only the specified properties.
## Installation
```sh

@@ -12,2 +10,18 @@ $ component install ndhoule/pick

## API
### `pick(props : string|string[], object: Object) => Object`
Return a shallow copy of an input `object` containing only a specified list of properties.
```javascript
var person = { name: 'Tim', occupation: 'enchanter', fears: 'rabbits' };
pick('name', person);
//=> { name: 'Tim' }
pick(['name', 'fears'], person);
//=> { name: 'Tim', fears: 'rabbits' }
```
## License

@@ -14,0 +28,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc