Comparing version 3.0.1 to 3.1.0
@@ -15,2 +15,9 @@ var inherits = require('util').inherits | ||
var equals = function (oidA, oidB) { | ||
// curried | ||
if (arguments.length === 1) { | ||
return function (oidB) { | ||
return equals(oidA, oidB) | ||
} | ||
} | ||
if (oidA === oidB) { return true; } | ||
@@ -17,0 +24,0 @@ if (!oidA || !oidB) { return false } |
{ | ||
"name": "objectid", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "mongodb objectid utilities", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,2 +31,3 @@ # objectid | ||
### ObjectId.equals(oidA, oidB) => Boolean | ||
Curried to support creating equality predicates. | ||
@@ -33,0 +34,0 @@ ### ObjectId.tryParse(oid, out, as) => Boolean |
@@ -124,2 +124,9 @@ var chai = require('chai') | ||
}) | ||
it('curries arguments', function () { | ||
var oidA = ObjectId() | ||
var eq = ObjectId.equals(oidA) | ||
eq.should.be.a('function') | ||
eq('sdfsdf').should.equal(false) | ||
eq(oidA).should.equal(true) | ||
}) | ||
}) | ||
@@ -126,0 +133,0 @@ |
9187
178
59