Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from deep-equal to deep-eql #435

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions lib/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var deepEqual = require('deep-equal');
var deepEqual = require('deep-eql');
var defined = require('defined');
var path = require('path');
var inherits = require('inherits');
Expand All @@ -10,6 +10,14 @@ var forEach = require('for-each');
var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
var toLowerCase = bind.call(Function.call, String.prototype.toLowerCase);

function isPrimitive(value) {
return value === null || typeof value !== 'object';
}

function loose(a, b) {
return isPrimitive(a) && isPrimitive(b) ? a == b : null;
}

module.exports = Test;

var nextTick = typeof setImmediate !== 'undefined'
Expand Down Expand Up @@ -418,7 +426,7 @@ Test.prototype.deepEqual
= Test.prototype.isEquivalent
= Test.prototype.same
= function (a, b, msg, extra) {
this._assert(deepEqual(a, b, { strict: true }), {
this._assert(deepEqual(a, b), {
message : defined(msg, 'should be equivalent'),
operator : 'deepEqual',
actual : a,
Expand All @@ -431,7 +439,7 @@ Test.prototype.deepLooseEqual
= Test.prototype.looseEqual
= Test.prototype.looseEquals
= function (a, b, msg, extra) {
this._assert(deepEqual(a, b), {
this._assert(deepEqual(a, b, { comparator: loose }), {
message : defined(msg, 'should be equivalent'),
operator : 'deepLooseEqual',
actual : a,
Expand All @@ -449,7 +457,7 @@ Test.prototype.notDeepEqual
= Test.prototype.isNotEquivalent
= Test.prototype.isInequivalent
= function (a, b, msg, extra) {
this._assert(!deepEqual(a, b, { strict: true }), {
this._assert(!deepEqual(a, b), {
message : defined(msg, 'should not be equivalent'),
operator : 'notDeepEqual',
actual : a,
Expand All @@ -462,7 +470,7 @@ Test.prototype.notDeepLooseEqual
= Test.prototype.notLooseEqual
= Test.prototype.notLooseEquals
= function (a, b, msg, extra) {
this._assert(!deepEqual(a, b), {
this._assert(!deepEqual(a, b, { comparator: loose }), {
message : defined(msg, 'should be equivalent'),
operator : 'notDeepLooseEqual',
actual : a,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test": "test"
},
"dependencies": {
"deep-equal": "~1.0.1",
"deep-eql": "^3.0.1",
"defined": "~1.0.0",
"for-each": "~0.3.2",
"function-bind": "~1.1.1",
Expand Down