lodash.ismatch
Advanced tools
Comparing version 4.1.2 to 4.1.3
148
index.js
/** | ||
* lodash 4.1.2 (Custom Build) <https://lodash.com/> | ||
* lodash 4.1.3 (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 | ||
*/ | ||
@@ -31,2 +31,3 @@ var Stack = require('lodash._stack'), | ||
objectTag = '[object Object]', | ||
promiseTag = '[object Promise]', | ||
regexpTag = '[object RegExp]', | ||
@@ -39,2 +40,3 @@ setTag = '[object Set]', | ||
var arrayBufferTag = '[object ArrayBuffer]', | ||
dataViewTag = '[object DataView]', | ||
float32Tag = '[object Float32Array]', | ||
@@ -53,3 +55,3 @@ float64Tag = '[object Float64Array]', | ||
/** Used to detect host constructors (Safari > 5). */ | ||
/** Used to detect host constructors (Safari). */ | ||
var reIsHostCtor = /^\[object .+?Constructor\]$/; | ||
@@ -66,7 +68,8 @@ | ||
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = | ||
typedArrayTags[dateTag] = typedArrayTags[errorTag] = | ||
typedArrayTags[funcTag] = typedArrayTags[mapTag] = | ||
typedArrayTags[numberTag] = typedArrayTags[objectTag] = | ||
typedArrayTags[regexpTag] = typedArrayTags[setTag] = | ||
typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; | ||
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = | ||
typedArrayTags[errorTag] = typedArrayTags[funcTag] = | ||
typedArrayTags[mapTag] = typedArrayTags[numberTag] = | ||
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = | ||
typedArrayTags[setTag] = typedArrayTags[stringTag] = | ||
typedArrayTags[weakMapTag] = false; | ||
@@ -100,3 +103,4 @@ /** | ||
* @param {Function} predicate The function invoked per iteration. | ||
* @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. | ||
* @returns {boolean} Returns `true` if any element passes the predicate check, | ||
* else `false`. | ||
*/ | ||
@@ -206,7 +210,11 @@ function arraySome(array, predicate) { | ||
var Symbol = root.Symbol, | ||
Uint8Array = root.Uint8Array, | ||
getPrototypeOf = Object.getPrototypeOf; | ||
Uint8Array = root.Uint8Array; | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
var nativeGetPrototype = Object.getPrototypeOf; | ||
/* Built-in method references that are verified to be native. */ | ||
var Map = getNative(root, 'Map'), | ||
var DataView = getNative(root, 'DataView'), | ||
Map = getNative(root, 'Map'), | ||
Promise = getNative(root, 'Promise'), | ||
Set = getNative(root, 'Set'), | ||
@@ -216,3 +224,5 @@ WeakMap = getNative(root, 'WeakMap'); | ||
/** Used to detect maps, sets, and weakmaps. */ | ||
var mapCtorString = Map ? funcToString.call(Map) : '', | ||
var dataViewCtorString = DataView ? (DataView + '') : '', | ||
mapCtorString = Map ? funcToString.call(Map) : '', | ||
promiseCtorString = Promise ? funcToString.call(Promise) : '', | ||
setCtorString = Set ? funcToString.call(Set) : '', | ||
@@ -238,3 +248,3 @@ weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; | ||
return hasOwnProperty.call(object, key) || | ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null); | ||
(typeof object == 'object' && key in object && getPrototype(object) === null); | ||
} | ||
@@ -277,3 +287,4 @@ | ||
* @param {Function} [customizer] The function to customize comparisons. | ||
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. | ||
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` | ||
* for more details. | ||
* @param {Object} [stack] Tracks traversed `object` and `other` objects. | ||
@@ -311,4 +322,7 @@ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | ||
if (objIsWrapped || othIsWrapped) { | ||
var objUnwrapped = objIsWrapped ? object.value() : object, | ||
othUnwrapped = othIsWrapped ? other.value() : other; | ||
stack || (stack = new Stack); | ||
return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); | ||
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); | ||
} | ||
@@ -362,5 +376,6 @@ } | ||
} else { | ||
var stack = new Stack, | ||
result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; | ||
var stack = new Stack; | ||
if (customizer) { | ||
var result = customizer(objValue, srcValue, key, object, source, stack); | ||
} | ||
if (!(result === undefined | ||
@@ -386,3 +401,4 @@ ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) | ||
* @param {Function} customizer The function to customize comparisons. | ||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. | ||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` | ||
* for more details. | ||
* @param {Object} stack Tracks traversed `array` and `other` objects. | ||
@@ -429,3 +445,4 @@ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. | ||
if (!arraySome(other, function(othValue) { | ||
return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); | ||
return arrValue === othValue || | ||
equalFunc(arrValue, othValue, customizer, bitmask, stack); | ||
})) { | ||
@@ -435,3 +452,6 @@ result = false; | ||
} | ||
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { | ||
} else if (!( | ||
arrValue === othValue || | ||
equalFunc(arrValue, othValue, customizer, bitmask, stack) | ||
)) { | ||
result = false; | ||
@@ -458,3 +478,4 @@ break; | ||
* @param {Function} customizer The function to customize comparisons. | ||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. | ||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` | ||
* for more details. | ||
* @param {Object} stack Tracks traversed `object` and `other` objects. | ||
@@ -465,2 +486,10 @@ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | ||
switch (tag) { | ||
case dataViewTag: | ||
if ((object.byteLength != other.byteLength) || | ||
(object.byteOffset != other.byteOffset)) { | ||
return false; | ||
} | ||
object = object.buffer; | ||
other = other.buffer; | ||
case arrayBufferTag: | ||
@@ -475,4 +504,5 @@ if ((object.byteLength != other.byteLength) || | ||
case dateTag: | ||
// Coerce dates and booleans to numbers, dates to milliseconds and booleans | ||
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal. | ||
// Coerce dates and booleans to numbers, dates to milliseconds and | ||
// booleans to `1` or `0` treating invalid dates coerced to `NaN` as | ||
// not equal. | ||
return +object == +other; | ||
@@ -489,4 +519,4 @@ | ||
case stringTag: | ||
// Coerce regexes to strings and treat strings primitives and string | ||
// objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. | ||
// Coerce regexes to strings and treat strings, primitives and objects, | ||
// as equal. See https://es5.github.io/#x15.10.6.4 for more details. | ||
return object == (other + ''); | ||
@@ -509,4 +539,7 @@ | ||
} | ||
bitmask |= UNORDERED_COMPARE_FLAG; | ||
stack.set(object, other); | ||
// Recursively compare objects (susceptible to call stack limits). | ||
return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other)); | ||
return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); | ||
@@ -530,3 +563,4 @@ case symbolTag: | ||
* @param {Function} customizer The function to customize comparisons. | ||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. | ||
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` | ||
* for more details. | ||
* @param {Object} stack Tracks traversed `object` and `other` objects. | ||
@@ -628,2 +662,13 @@ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | ||
/** | ||
* 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)); | ||
} | ||
/** | ||
* Gets the `toStringTag` of `value`. | ||
@@ -639,4 +684,7 @@ * | ||
// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. | ||
if ((Map && getTag(new Map) != mapTag) || | ||
// Fallback for data views, maps, sets, and weak maps in IE 11, | ||
// for data views in Edge, and promises in Node.js. | ||
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || | ||
(Map && getTag(new Map) != mapTag) || | ||
(Promise && getTag(Promise.resolve()) != promiseTag) || | ||
(Set && getTag(new Set) != setTag) || | ||
@@ -651,3 +699,5 @@ (WeakMap && getTag(new WeakMap) != weakMapTag)) { | ||
switch (ctorString) { | ||
case dataViewCtorString: return dataViewTag; | ||
case mapCtorString: return mapTag; | ||
case promiseCtorString: return promiseTag; | ||
case setCtorString: return setTag; | ||
@@ -678,6 +728,8 @@ case weakMapCtorString: return weakMapTag; | ||
* @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`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -704,5 +756,7 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -727,9 +781,12 @@ * | ||
* | ||
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
* **Note:** This function is loosely based on | ||
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @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 | ||
@@ -760,2 +817,3 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
@@ -789,2 +847,3 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -820,2 +879,3 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @since 3.0.0 | ||
* @category Lang | ||
@@ -844,5 +904,7 @@ * @param {Object} object The object to inspect. | ||
* @memberOf _ | ||
* @since 3.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a native function, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is a native function, | ||
* else `false`. | ||
* @example | ||
@@ -872,5 +934,7 @@ * | ||
* @memberOf _ | ||
* @since 3.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -890,7 +954,9 @@ * | ||
/** | ||
* Creates an array of own enumerable key-value pairs for `object` which | ||
* can be consumed by `_.fromPairs`. | ||
* Creates an array of own enumerable string keyed-value pairs for `object` | ||
* which can be consumed by `_.fromPairs`. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @alias entries | ||
* @category Object | ||
@@ -897,0 +963,0 @@ * @param {Object} object The object to query. |
{ | ||
"name": "lodash.ismatch", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"description": "The lodash method `_.isMatch` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.ismatch v4.1.2 | ||
# lodash.ismatch v4.1.3 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.isMatch` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#isMatch) or [package source](https://github.com/lodash/lodash/blob/4.1.2-npm-packages/lodash.ismatch) for more details. | ||
See the [documentation](https://lodash.com/docs#isMatch) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.ismatch) 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
31437
874
1