📜  isMatch - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:22.689000             🧑  作者: Mango

代码示例1
function isMatch(object, attrs) {
  var _keys = keys(attrs), length = _keys.length;
  if (object == null) return !length;
  var obj = Object(object);
  for (var i = 0; i < length; i++) {
    var key = _keys[i];
    if (attrs[key] !== obj[key] || !(key in obj)) return false;
  }
  return true;
}