Performs a partial deep comparison between `object` and `source` to determine if `object` contains equivalent property values. **Note:** This method is equivalent to `matches` when `source` is partially applied. Partial comparisons will match empty array and empty object `source` values against any array or object value, respectively. See `isEqual` for a list of supported value comparisons.
const object = { 'a': 1, 'b': 2 }
isMatch(object, { 'b': 2 })
// => true
isMatch(object, { 'b': 1 })
// => false
Name | Type | Attribute | Description |
---|---|---|---|
object | The object to inspect. | ||
source | The object of property values to match. |
{ "comment": "/**\r\n * Performs a partial deep comparison between `object` and `source` to\r\n * determine if `object` contains equivalent property values.\r\n *\r\n * **Note:** This method is equivalent to `matches` when `source` is\r\n * partially applied.\r\n *\r\n * Partial comparisons will match empty array and empty object `source`\r\n * values against any array or object value, respectively. See `isEqual`\r\n * for a list of supported value comparisons.\r\n *\r\n * @since 3.0.0\r\n * @category Lang\r\n * @param {Object} object The object to inspect.\r\n * @param {Object} source The object of property values to match.\r\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\r\n * @example\r\n *\r\n * const object = { 'a': 1, 'b': 2 }\r\n *\r\n * isMatch(object, { 'b': 2 })\r\n * // => true\r\n *\r\n * isMatch(object, { 'b': 1 })\r\n * // => false\r\n */", "meta": { "range": [ 943, 1061 ], "filename": "isMatch.js", "lineno": 30, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100004839", "name": "isMatch", "type": "FunctionDeclaration", "paramnames": [ "object", "source" ] } }, "description": "Performs a partial deep comparison between `object` and `source` to\rdetermine if `object` contains equivalent property values.\r\r**Note:** This method is equivalent to `matches` when `source` is\rpartially applied.\r\rPartial comparisons will match empty array and empty object `source`\rvalues against any array or object value, respectively. See `isEqual`\rfor a list of supported value comparisons.", "since": "3.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Lang", "value": "Lang" } ], "params": [ { "type": { "names": [ "Object" ] }, "description": "The object to inspect.", "name": "object" }, { "type": { "names": [ "Object" ] }, "description": "The object of property values to match.", "name": "source" } ], "returns": [ { "type": { "names": [ "boolean" ] }, "description": "Returns `true` if `object` is a match, else `false`." } ], "examples": [ "const object = { 'a': 1, 'b': 2 }\r\risMatch(object, { 'b': 2 })\r// => true\r\risMatch(object, { 'b': 1 })\r// => false" ], "name": "isMatch", "longname": "isMatch", "kind": "function", "scope": "global", "___id": "T000002R000463", "___s": true, "filepath": "isMatch.js" }