mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-15 21:27:50 +00:00
Update vendors.
Former-commit-id: f2a09b6501a34b2ae2d8e996b13c9da4fb048535
This commit is contained in:
8
vendor/underscore/underscore.js
vendored
8
vendor/underscore/underscore.js
vendored
@@ -699,12 +699,18 @@
|
||||
// Return a copy of the object only containing the whitelisted properties.
|
||||
_.pick = function(obj) {
|
||||
var result = {};
|
||||
each(flatten(slice.call(arguments, 1), true, []), function(key) {
|
||||
each(_.flatten(slice.call(arguments, 1)), function(key) {
|
||||
if (key in obj) result[key] = obj[key];
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
// Return a copy of the object without the blacklisted properties.
|
||||
_.omit = function(obj) {
|
||||
var keys = _.flatten(slice.call(arguments, 1));
|
||||
return _.pick(obj, _.difference(_.keys(obj), keys));
|
||||
};
|
||||
|
||||
// Fill in a given object with default properties.
|
||||
_.defaults = function(obj) {
|
||||
each(slice.call(arguments, 1), function(source) {
|
||||
|
||||
Reference in New Issue
Block a user