]> git.r.bdr.sh - rbdr/dotfiles/blob
4fe639d4efcd2d84cb65ea8a700d547bdf79b782
[rbdr/dotfiles] /
1 'use strict';
2
3 var eq = require('./eq')
4 , value = require('./valid-value')
5
6 , keys = Object.keys
7 , propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
8
9 module.exports = function (a, b) {
10 var k1, k2;
11
12 if (eq(value(a), value(b))) return true;
13
14 a = Object(a);
15 b = Object(b);
16
17 k1 = keys(a);
18 k2 = keys(b);
19 if (k1.length !== k2.length) return false;
20 return k1.every(function (key) {
21 if (!propertyIsEnumerable.call(b, key)) return false;
22 return eq(a[key], b[key]);
23 });
24 };