Comparing version 0.2.0 to 0.3.0
@@ -6,3 +6,4 @@ module.exports = { | ||
pick: function (/* keys */) { | ||
var keys = Array.prototype.slice.call(arguments); | ||
var keys = Array.isArray(arguments[0]) ? arguments[0] : | ||
Array.prototype.slice.call(arguments); | ||
return function (obj) { | ||
@@ -9,0 +10,0 @@ var out = {}; |
{ | ||
"name": "map-utils", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "map util functions, map, utils, pick, pluck, set, exists", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,2 +35,13 @@ var utils = require('../index.js'); | ||
}); | ||
it('should pick multiple keys from an object (as an array)', function () { | ||
var obj = { | ||
foo: 1, | ||
bar: 2, | ||
qux: 3 | ||
}; | ||
utils.pick(['foo', 'qux'])(obj).should.eql({ | ||
foo: 1, | ||
qux: 3 | ||
}); | ||
}); | ||
}); | ||
@@ -37,0 +48,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7042
175