* Creates a shallow clone of `object` excluding the specified properties. * Property names may be specified as individual arguments or as arrays of * property names. If a callback is provided it will be executed for each * property of `object` omitting the properties the callback retu
(object, callback, thisArg)
| 37866 | * // => { 'name': 'fred' } |
| 37867 | */ |
| 37868 | function omit(object, callback, thisArg) { |
| 37869 | var result = {}; |
| 37870 | if (typeof callback != 'function') { |
| 37871 | var props = []; |
| 37872 | forIn(object, function(value, key) { |
| 37873 | props.push(key); |
| 37874 | }); |
| 37875 | props = baseDifference(props, baseFlatten(arguments, true, false, 1)); |
| 37876 | |
| 37877 | var index = -1, |
| 37878 | length = props.length; |
| 37879 | |
| 37880 | while (++index < length) { |
| 37881 | var key = props[index]; |
| 37882 | result[key] = object[key]; |
| 37883 | } |
| 37884 | } else { |
| 37885 | callback = lodash.createCallback(callback, thisArg, 3); |
| 37886 | forIn(object, function(value, key, object) { |
| 37887 | if (!callback(value, key, object)) { |
| 37888 | result[key] = value; |
| 37889 | } |
| 37890 | }); |
| 37891 | } |
| 37892 | return result; |
| 37893 | } |
| 37894 | |
| 37895 | /** |
| 37896 | * Creates a two dimensional array of an object's key-value pairs, |
nothing calls this directly
no test coverage detected