Socket
Socket
Sign inDemoInstall

utile

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utile - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

13

lib/index.js

@@ -85,2 +85,15 @@ /*

//
// given an object, set value at path, creating objects if necessary.
//
exports.createPath = function (object, path, value) {
for (var i in path) {
var key = path[i];
if(!object[key]) object[key] = ((+i + 1 == path.length) ? value : {});
object = object[key];
}
}
//
// ### function mixin (target [source0, source1, ...])

@@ -87,0 +100,0 @@ // Copies enumerable properties from `source0 ... sourceN`

2

package.json
{
"name": "utile",
"description": "A drop-in replacement for `util` with some additional advantageous functions",
"version": "0.0.5",
"version": "0.0.6",
"author": "Nodejitsu Inc <info@nodejitsu.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -54,4 +54,10 @@ /*

assert.notStrictEqual(obj1, clone);
},
"the createPath() method": function () {
var x = {}
, r = Math.random()
utile.createPath(x, ['a','b','c'], r)
assert.equal(x.a.b.c, r)
}
}
}).export(module);
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