290290 < li > - < a href ="#clone "> clone</ a > </ li >
291291 < li > - < a href ="#tap "> tap</ a > </ li >
292292 < li > - < a href ="#has "> has</ a > </ li >
293- < li > - < a href ="#matches " > matches </ a > </ li >
293+ < li > - < a href ="#matcher " > matcher </ a > </ li >
294294 < li > - < a href ="#property "> property</ a > </ li >
295295 < li > - < a href ="#propertyOf "> propertyOf</ a > </ li >
296296 < li > - < a href ="#isEqual "> isEqual</ a > </ li >
297+ < li > - < a href ="#isMatch "> isMatch</ a > </ li >
297298 < li > - < a href ="#isEmpty "> isEmpty</ a > </ li >
298299 < li > - < a href ="#isElement "> isElement</ a > </ li >
299300 < li > - < a href ="#isArray "> isArray</ a > </ li >
@@ -1549,14 +1550,14 @@ <h2 id="objects">Object Functions</h2>
15491550_.propertyOf(stooge)('name');
15501551=> 'moe'</ pre >
15511552
1552- < p id ="matches ">
1553- < b class ="header "> matches </ b > < code > _.matches (attrs)</ code >
1553+ < p id ="matcher ">
1554+ < b class ="header "> matcher </ b > < code > _.matcher (attrs)</ code >
15541555 < br />
15551556 Returns a predicate function that will tell you if a passed in object
15561557 contains all of the key/value properties present in < b > attrs</ b > .
15571558 </ p >
15581559 < pre >
1559- var ready = _.matches ({selected: true, visible: true});
1560+ var ready = _.matcher ({selected: true, visible: true});
15601561var readyToGoList = _.filter(list, ready);</ pre >
15611562
15621563 < p id ="isEqual ">
@@ -1572,6 +1573,18 @@ <h2 id="objects">Object Functions</h2>
15721573=> false
15731574_.isEqual(stooge, clone);
15741575=> true
1576+ </ pre >
1577+
1578+ < p id ="isMatch ">
1579+ < b class ="header "> isMatch</ b > < code > _.isMatch(object, properties)</ code >
1580+ < br />
1581+ Tells you if the keys and values in < b > properties</ b > are contained
1582+ in < b > object</ b > .
1583+ </ p >
1584+ < pre >
1585+ var stooge = {name: 'moe', age: 32};
1586+ _.isMatch(stooge, {age: 32});
1587+ => true
15751588</ pre >
15761589
15771590 < p id ="isEmpty ">
@@ -2202,6 +2215,11 @@ <h2 id="changelog">Change Log</h2>
22022215 Added < tt > _.findIndex</ tt > and < tt > _.findLastIndex</ tt > functions,
22032216 which nicely complement their twin-twins < tt > _.indexOf</ tt > and < tt > _.lastIndexOf</ tt > .
22042217 </ li >
2218+ < li >
2219+ Added an < tt > _.isMatch</ tt > predicate function that tells you if an
2220+ object matches key-value properties. A kissing cousin of
2221+ < tt > _.isEqual</ tt > and < tt > _.matcher</ tt > .
2222+ </ li >
22052223 < li >
22062224 Added an < tt > _.isError</ tt > function.
22072225 </ li >
@@ -2217,6 +2235,10 @@ <h2 id="changelog">Change Log</h2>
22172235 Added the < tt > _.propertyOf</ tt > function generator as a mirror-world
22182236 version of < tt > _.property</ tt > .
22192237 </ li >
2238+ < li >
2239+ Deprecated < tt > _.matches</ tt > . It's now known by a more harmonious
2240+ name — < tt > _.matcher</ tt > .
2241+ </ li >
22202242 < li >
22212243 Various and diverse code simplifications, changes for improved
22222244 cross-platform compatibility, and edge case bug fixes.
0 commit comments