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

utils-extend

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utils-extend - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

test/pick.js

30

index.js

@@ -112,2 +112,32 @@ /**

/**
* @description
* Return a copy of the object with list keys
* @example
* util.pick({ key: 'value' }, 'key', 'key1');
* util.pick(obj, function(value, key, object) { });
*/
exports.pick = function(obj, iteratee) {
var result = {};
if (exports.isFunction(iteratee)) {
for (var key in obj) {
var value = obj[key];
if (iteratee(value, key, obj)) {
result[key] = value;
}
}
} else {
var keys = Array.prototype.slice.call(arguments, 1);
keys.forEach(function(key) {
if (key in obj) {
result[key] = obj[key];
}
});
}
return result;
};
exports.path = {};

@@ -114,0 +144,0 @@

4

package.json
{
"name": "utils-extend",
"version": "1.0.6",
"version": "1.0.7",
"description": "Extend nodejs util api, and it is light weight and simple",

@@ -31,2 +31,2 @@ "main": "index.js",

}
}
}

@@ -1,3 +0,4 @@

## utils-extend
Extend nodejs util api, and it is light weight and simple
# utils-extend
[![NPM](https://nodei.co/npm/utils-extend.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/utils-extend/)
Extend nodejs util api, and it is light weight and simple.
```

@@ -11,2 +12,5 @@ var util = require('utils-extend');

## API
### util
Extend api in nodejs util module,
### util.extend

@@ -57,2 +61,8 @@ Deep clone soure object to target

```
### util.pick
Return a copy of the object with list keys
```js
util.pick({ key: 'value' }, 'key');
util.pick({ key: 'value' }, function(value, key, object) { });
```

@@ -78,3 +88,1 @@ ### util.escape

Normalize \ paths to / paths.

@@ -17,3 +17,3 @@ var assert = require('assert');

var source = { k: 'v2' };
var source2 = { k: 'v3' }
var source2 = { k: 'v3' };

@@ -20,0 +20,0 @@ util.extend(target, source, source2);

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