From 3acb0d7fb8915fb7f1ca97701b5761793738bad3 Mon Sep 17 00:00:00 2001 From: jesse keane Date: Tue, 3 Feb 2015 16:38:17 -0800 Subject: [PATCH] add type check to support browsers --- index.js | 2 +- test/cmp.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index fd2c4f3..dbc11f2 100644 --- a/index.js +++ b/index.js @@ -90,5 +90,5 @@ function objEquiv(a, b, opts) { key = ka[i]; if (!deepEqual(a[key], b[key], opts)) return false; } - return true; + return typeof a === typeof b; } diff --git a/test/cmp.js b/test/cmp.js index a10186a..d141256 100644 --- a/test/cmp.js +++ b/test/cmp.js @@ -82,3 +82,8 @@ test('buffers', function (t) { t.ok(equal(Buffer('xyz'), Buffer('xyz'))); t.end(); }); + +test('booleans and arrays', function (t) { + t.notOk(equal(true, [])); + t.end(); +})