1 define(['./hasOwn', './every', '../lang/isObject', '../lang/is'], function(hasOwn, every, isObject, is) {
3 // Makes a function to compare the object values from the specified compare
5 function makeCompare(callback) {
6 return function(value, key) {
7 return hasOwn(this, key) && callback(value, this[key]);
11 function checkProperties(value, key) {
12 return hasOwn(this, key);
16 * Checks if two objects have the same keys and values.
18 function equals(a, b, callback) {
19 callback = callback || is;
21 if (!isObject(a) || !isObject(b)) {
22 return callback(a, b);
25 return (every(a, makeCompare(callback), b) &&
26 every(b, checkProperties, a));