All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.amd.isMatch.js Maven / Gradle / Ivy

The newest version!
define(['./keys'], function (keys) {

  // Returns whether an object has a given set of `key:value` pairs.
  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;
  }

  return isMatch;

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy