This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/client/node_modules/underscore/amd/isMatch.js

18 lines
447 B
JavaScript
Raw Normal View History

2025-06-13 06:04:40 +00:00
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;
});