lodash.omitby
Advanced tools
Comparing version 4.2.2 to 4.3.0
164
index.js
/** | ||
* lodash 4.2.2 (Custom Build) <https://lodash.com/> | ||
* lodash 4.3.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
var baseFor = require('lodash._basefor'), | ||
baseIteratee = require('lodash._baseiteratee'), | ||
var baseIteratee = require('lodash._baseiteratee'), | ||
keysIn = require('lodash.keysin'); | ||
/** | ||
* The base implementation of `_.forIn` without support for iteratee shorthands. | ||
* Appends the elements of `values` to `array`. | ||
* | ||
* @private | ||
* @param {Object} object The object to iterate over. | ||
* @param {Function} iteratee The function invoked per iteration. | ||
* @returns {Object} Returns `object`. | ||
* @param {Array} array The array to modify. | ||
* @param {Array} values The values to append. | ||
* @returns {Array} Returns `array`. | ||
*/ | ||
function baseForIn(object, iteratee) { | ||
return object == null ? object : baseFor(object, iteratee, keysIn); | ||
function arrayPush(array, values) { | ||
var index = -1, | ||
length = values.length, | ||
offset = array.length; | ||
while (++index < length) { | ||
array[offset + index] = values[index]; | ||
} | ||
return array; | ||
} | ||
/** Built-in value references. */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
var nativeGetPrototype = Object.getPrototypeOf; | ||
/** | ||
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses | ||
* `keysFunc` and `symbolsFunc` to get the enumerable property names and | ||
* symbols of `object`. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @param {Function} keysFunc The function to get the keys of `object`. | ||
* @param {Function} symbolsFunc The function to get the symbols of `object`. | ||
* @returns {Array} Returns the array of property names and symbols. | ||
*/ | ||
function baseGetAllKeys(object, keysFunc, symbolsFunc) { | ||
var result = keysFunc(object); | ||
return isArray(object) | ||
? result | ||
: arrayPush(result, symbolsFunc(object)); | ||
} | ||
/** | ||
* The base implementation of `_.pickBy` without support for iteratee shorthands. | ||
@@ -34,8 +64,15 @@ * | ||
function basePickBy(object, predicate) { | ||
var result = {}; | ||
baseForIn(object, function(value, key) { | ||
var index = -1, | ||
props = getAllKeysIn(object), | ||
length = props.length, | ||
result = {}; | ||
while (++index < length) { | ||
var key = props[index], | ||
value = object[key]; | ||
if (predicate(value, key)) { | ||
result[key] = value; | ||
} | ||
}); | ||
} | ||
return result; | ||
@@ -45,12 +82,101 @@ } | ||
/** | ||
* Creates an array of own and inherited enumerable property names and | ||
* symbols of `object`. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @returns {Array} Returns the array of property names and symbols. | ||
*/ | ||
function getAllKeysIn(object) { | ||
return baseGetAllKeys(object, keysIn, getSymbolsIn); | ||
} | ||
/** | ||
* Gets the `[[Prototype]]` of `value`. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {null|Object} Returns the `[[Prototype]]`. | ||
*/ | ||
function getPrototype(value) { | ||
return nativeGetPrototype(Object(value)); | ||
} | ||
/** | ||
* Creates an array of the own enumerable symbol properties of `object`. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @returns {Array} Returns the array of symbols. | ||
*/ | ||
function getSymbols(object) { | ||
// Coerce `object` to an object to avoid non-object errors in V8. | ||
// See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. | ||
return getOwnPropertySymbols(Object(object)); | ||
} | ||
// Fallback for IE < 11. | ||
if (!getOwnPropertySymbols) { | ||
getSymbols = function() { | ||
return []; | ||
}; | ||
} | ||
/** | ||
* Creates an array of the own and inherited enumerable symbol properties | ||
* of `object`. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @returns {Array} Returns the array of symbols. | ||
*/ | ||
var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { | ||
var result = []; | ||
while (object) { | ||
arrayPush(result, getSymbols(object)); | ||
object = getPrototype(object); | ||
} | ||
return result; | ||
}; | ||
/** | ||
* Checks if `value` is classified as an `Array` object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @type {Function} | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
* | ||
* _.isArray([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isArray(document.body.children); | ||
* // => false | ||
* | ||
* _.isArray('abc'); | ||
* // => false | ||
* | ||
* _.isArray(_.noop); | ||
* // => false | ||
*/ | ||
var isArray = Array.isArray; | ||
/** | ||
* The opposite of `_.pickBy`; this method creates an object composed of | ||
* the own and inherited enumerable properties of `object` that `predicate` | ||
* doesn't return truthy for. The predicate is invoked with two arguments: | ||
* (value, key). | ||
* the own and inherited enumerable string keyed properties of `object` that | ||
* `predicate` doesn't return truthy for. The predicate is invoked with two | ||
* arguments: (value, key). | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Object | ||
* @param {Object} object The source object. | ||
* @param {Function|Object|string} [predicate=_.identity] The function invoked per property. | ||
* @param {Array|Function|Object|string} [predicate=_.identity] | ||
* The function invoked per property. | ||
* @returns {Object} Returns the new object. | ||
@@ -57,0 +183,0 @@ * @example |
{ | ||
"name": "lodash.omitby", | ||
"version": "4.2.2", | ||
"version": "4.3.0", | ||
"description": "The lodash method `_.omitBy` exported as a module.", | ||
@@ -18,6 +18,5 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._basefor": "~3.0.0", | ||
"lodash._baseiteratee": "~4.5.0", | ||
"lodash._baseiteratee": "~4.6.0", | ||
"lodash.keysin": "^4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.omitby v4.2.2 | ||
# lodash.omitby v4.3.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.omitBy` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#omitBy) or [package source](https://github.com/lodash/lodash/blob/4.2.2-npm-packages/lodash.omitby) for more details. | ||
See the [documentation](https://lodash.com/docs#omitBy) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.omitby) for more details. |
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
8433
2
179
1
+ Addedlodash._baseiteratee@4.6.1(transitive)
+ Addedlodash._stringtopath@4.7.1(transitive)
- Removedlodash._basefor@~3.0.0
- Removedlodash._basefor@3.0.3(transitive)
- Removedlodash._baseiteratee@4.5.2(transitive)
Updatedlodash._baseiteratee@~4.6.0