Socket
Socket
Sign inDemoInstall

lodash.omit

Package Overview
Dependencies
0
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.4.1 to 4.5.0

222

index.js

@@ -24,3 +24,2 @@ /**

genTag = '[object GeneratorFunction]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';

@@ -30,3 +29,3 @@

* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/

@@ -75,3 +74,3 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

* @private
* @param {Array} [array] The array to search.
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.

@@ -89,3 +88,3 @@ * @returns {boolean} Returns `true` if `target` is found, else `false`.

* @private
* @param {Array} [array] The array to search.
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.

@@ -151,3 +150,3 @@ * @param {Function} comparator The comparator invoked per element.

* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.

@@ -174,3 +173,3 @@ * @param {number} fromIndex The index to search from.

* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.

@@ -207,15 +206,2 @@ * @param {number} fromIndex The index to search from.

/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.times` without support for iteratee shorthands

@@ -296,22 +282,5 @@ * or max array length checks.

/**
* Converts `iterator` to an array.
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/**
* Creates a function that invokes `func` with its first argument transformed.
*
* @private
* @param {Function} func The function to wrap.

@@ -329,2 +298,3 @@ * @param {Function} transform The argument transform.

var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;

@@ -342,3 +312,3 @@

/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
var funcToString = funcProto.toString;

@@ -350,3 +320,3 @@ /** Used to check objects for own properties. */

* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.

@@ -363,5 +333,4 @@ */

/** Built-in value references. */
var Reflect = root.Reflect,
Symbol = root.Symbol,
enumerate = Reflect ? Reflect.enumerate : undefined,
var Symbol = root.Symbol,
getPrototype = overArg(Object.getPrototypeOf, Object),
propertyIsEnumerable = objectProto.propertyIsEnumerable,

@@ -372,4 +341,3 @@ splice = arrayProto.splice,

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf,
nativeGetSymbols = Object.getOwnPropertySymbols,
var nativeGetSymbols = Object.getOwnPropertySymbols,
nativeMax = Math.max;

@@ -736,6 +704,33 @@

/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to search.
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.

@@ -877,4 +872,3 @@ * @returns {number} Returns the index of the matched value, else `-1`.

/**
* The base implementation of `_.keysIn` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*

@@ -886,7 +880,12 @@ * @private

function baseKeysIn(object) {
object = object == null ? object : Object(object);
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
var result = [];
for (var key in object) {
result.push(key);
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}

@@ -896,9 +895,2 @@ return result;

// Fallback for IE < 9 with es6-shim.
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
baseKeysIn = function(object) {
return iteratorToArray(enumerate(object));
};
}
/**

@@ -987,15 +979,2 @@ * The base implementation of `_.pick` without support for individual

/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Gets the data for `map`.

@@ -1029,11 +1008,2 @@ *

/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/**
* Creates an array of the own enumerable symbol properties of `object`.

@@ -1065,19 +1035,2 @@ *

/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
/**
* Checks if `value` is a flattenable `arguments` object or array.

@@ -1149,2 +1102,21 @@ *

/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/**
* Converts `value` to a string key if it's not a string or symbol.

@@ -1185,3 +1157,3 @@ *

* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.

@@ -1239,3 +1211,3 @@ *

function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&

@@ -1296,3 +1268,3 @@ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);

function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value);
return value != null && isLength(value.length) && !isFunction(value);
}

@@ -1348,4 +1320,3 @@

// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';

@@ -1358,4 +1329,4 @@ return tag == funcTag || tag == genTag;

*
* **Note:** This function is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*

@@ -1367,4 +1338,3 @@ * @static

* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length,
* else `false`.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example

@@ -1391,3 +1361,3 @@ *

* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)

@@ -1449,24 +1419,2 @@ *

/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.

@@ -1517,19 +1465,3 @@ *

function keysIn(object) {
var index = -1,
isProto = isPrototype(object),
props = baseKeysIn(object),
propsLength = props.length,
indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
while (++index < propsLength) {
var key = props[index];
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}

@@ -1536,0 +1468,0 @@

{
"name": "lodash.omit",
"version": "4.4.1",
"version": "4.5.0",
"description": "The lodash method `_.omit` exported as a module.",

@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/",

@@ -1,2 +0,2 @@

# lodash.omit v4.4.1
# lodash.omit v4.5.0

@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.omit` exported as a [Node.js](https://nodejs.org/) module.

See the [documentation](https://lodash.com/docs#omit) or [package source](https://github.com/lodash/lodash/blob/4.4.1-npm-packages/lodash.omit) for more details.
See the [documentation](https://lodash.com/docs#omit) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.omit) for more details.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc