lodash.ismatch
Advanced tools
Comparing version 3.2.0 to 4.0.0
46
index.js
/** | ||
* lodash 3.2.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
* lodash 4.0.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
*/ | ||
var baseIsMatch = require('lodash._baseismatch'), | ||
bindCallback = require('lodash._bindcallback'), | ||
pairs = require('lodash.pairs'); | ||
toPairs = require('lodash.topairs'); | ||
/** | ||
* Gets the propery names, values, and compare flags of `object`. | ||
* Gets the property names, values, and compare flags of `object`. | ||
* | ||
@@ -21,3 +20,3 @@ * @private | ||
function getMatchData(object) { | ||
var result = pairs(object), | ||
var result = toPairs(object), | ||
length = result.length; | ||
@@ -60,3 +59,6 @@ | ||
* | ||
* _.isObject(1); | ||
* _.isObject(_.noop); | ||
* // => true | ||
* | ||
* _.isObject(null); | ||
* // => false | ||
@@ -73,11 +75,5 @@ */ | ||
* Performs a deep comparison between `object` and `source` to determine if | ||
* `object` contains equivalent property values. If `customizer` is provided | ||
* it is invoked to compare values. If `customizer` returns `undefined` | ||
* comparisons are handled by the method instead. The `customizer` is bound | ||
* to `thisArg` and invoked with three arguments: (value, other, index|key). | ||
* `object` contains equivalent property values. | ||
* | ||
* **Note:** This method supports comparing properties of arrays, booleans, | ||
* `Date` objects, numbers, `Object` objects, regexes, and strings. Functions | ||
* and DOM nodes are **not** supported. Provide a customizer function to extend | ||
* support for comparing other values. | ||
* **Note:** This method supports comparing the same values as `_.isEqual`. | ||
* | ||
@@ -89,4 +85,2 @@ * @static | ||
* @param {Object} source The object of property values to match. | ||
* @param {Function} [customizer] The function to customize value comparisons. | ||
* @param {*} [thisArg] The `this` binding of `customizer`. | ||
* @returns {boolean} Returns `true` if `object` is a match, else `false`. | ||
@@ -102,17 +96,7 @@ * @example | ||
* // => false | ||
* | ||
* // using a customizer callback | ||
* var object = { 'greeting': 'hello' }; | ||
* var source = { 'greeting': 'hi' }; | ||
* | ||
* _.isMatch(object, source, function(value, other) { | ||
* return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; | ||
* }); | ||
* // => true | ||
*/ | ||
function isMatch(object, source, customizer, thisArg) { | ||
customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; | ||
return baseIsMatch(object, getMatchData(source), customizer); | ||
function isMatch(object, source) { | ||
return object === source || baseIsMatch(object, source, getMatchData(source)); | ||
} | ||
module.exports = isMatch; |
{ | ||
"name": "lodash.ismatch", | ||
"version": "3.2.0", | ||
"description": "The modern build of lodash’s `_.isMatch` as a module.", | ||
"version": "4.0.0", | ||
"description": "The lodash method `_.isMatch` exported as a module.", | ||
"homepage": "https://lodash.com/", | ||
"icon": "https://lodash.com/icon.svg", | ||
"license": "MIT", | ||
"keywords": "lodash, lodash-modularized, stdlib, util", | ||
"keywords": "lodash, lodash-modularized, stdlib, util, ismatch", | ||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"contributors": [ | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)", | ||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -20,6 +18,5 @@ ], | ||
"dependencies": { | ||
"lodash._baseismatch": "^3.0.0", | ||
"lodash._bindcallback": "^3.0.0", | ||
"lodash.pairs": "^3.0.0" | ||
"lodash._baseismatch": "^4.0.0", | ||
"lodash.topairs": "^4.0.0" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
# lodash.ismatch v3.2.0 | ||
# lodash.ismatch v4.0.0 | ||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isMatch` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
The [lodash](https://lodash.com/) method `_.isMatch` exported as a [Node.js](https://nodejs.org/) module. | ||
@@ -8,3 +8,2 @@ ## Installation | ||
Using npm: | ||
```bash | ||
@@ -15,4 +14,3 @@ $ {sudo -H} npm i -g npm | ||
In Node.js/io.js: | ||
In Node.js: | ||
```js | ||
@@ -22,2 +20,2 @@ var isMatch = require('lodash.ismatch'); | ||
See the [documentation](https://lodash.com/docs#isMatch) or [package source](https://github.com/lodash/lodash/blob/3.2.0-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.0.0-npm-packages/lodash.ismatch) for more details. |
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
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
2
5288
91
19
+ Addedlodash.topairs@^4.0.0
+ Addedlodash._baseisequal@4.1.1(transitive)
+ Addedlodash._baseismatch@4.0.2(transitive)
+ Addedlodash._root@3.0.1(transitive)
+ Addedlodash._stack@4.1.3(transitive)
+ Addedlodash.keys@4.2.0(transitive)
+ Addedlodash.topairs@4.3.0(transitive)
- Removedlodash._bindcallback@^3.0.0
- Removedlodash.pairs@^3.0.0
- Removedlodash._baseisequal@3.0.7(transitive)
- Removedlodash._baseismatch@3.1.3(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.istypedarray@3.0.6(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.pairs@3.0.1(transitive)
Updatedlodash._baseismatch@^4.0.0