mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v4.17.1.
This commit is contained in:
11
omit.js
11
omit.js
@@ -1,5 +1,7 @@
|
||||
import arrayMap from './_arrayMap.js';
|
||||
import baseClone from './_baseClone.js';
|
||||
import baseUnset from './_baseUnset.js';
|
||||
import castPath from './_castPath.js';
|
||||
import copyObject from './_copyObject.js';
|
||||
import flatRest from './_flatRest.js';
|
||||
import getAllKeysIn from './_getAllKeysIn.js';
|
||||
@@ -34,8 +36,15 @@ var omit = flatRest(function(object, paths) {
|
||||
if (object == null) {
|
||||
return result;
|
||||
}
|
||||
var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG;
|
||||
paths = arrayMap(paths, function(path) {
|
||||
path = castPath(path, object);
|
||||
bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0);
|
||||
return path;
|
||||
});
|
||||
|
||||
copyObject(object, getAllKeysIn(object), result);
|
||||
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG);
|
||||
result = baseClone(result, bitmask);
|
||||
|
||||
var length = paths.length;
|
||||
while (length--) {
|
||||
|
||||
Reference in New Issue
Block a user