Util
Matches

_.matches(source)

Creates a function that performs a partial deep comparison between a given object and source, returning true if the given object has equivalent property values, else false.

Note: The created function is equivalent to _.isMatch with source 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.

Arguments

source (Object): The object of property values to match.

Returns

(Function): Returns the new spec function.

Example

Last updated on February 21, 2024