服务器

Array

Collection

Date

Function

Lang

Math

Number

Object

Seq

String

Util

Properties

Methods

_.isMatchWith(object, source, customizer)

此方法与_.isMatch类似,不同之处在于它接受调用以比较值的定制程序。 如果定制程序返回未定义,则比较由该方法处理。 定制器使用五个参数调用:(objValue,srcValue,index | key,object,source)。

Since

4.0.0

Arguments
  1. object (对象):要检查的对象。
  2. source (Object):要匹配的属性值的对象。
  3. [customizer] (功能):自定义比较的功能。
Returns

(boolean):如果object匹配,则返回true,否则返回false。

Example
function isGreeting(value) {
  return /^h(?:i|ello)$/.test(value);
}
 

function customizer(objValue, srcValue) {
  if (isGreeting(objValue) && isGreeting(srcValue)) {
    return true;
  }
}
 

var object = { 'greeting': 'hello' };

var source = { 'greeting': 'hi' };
 
_.isMatchWith(object, source, customizer);
// => true