Comparing version 1.1.0 to 1.1.1
@@ -75,3 +75,3 @@ /*! | ||
if (!(this instanceof Insection)) { | ||
return new Insection(); | ||
return new Insection(valueComparer); | ||
} | ||
@@ -78,0 +78,0 @@ valueComparer = valueComparer || defaultValueComparer; |
@@ -54,3 +54,3 @@ var InvalidIntervalError = require('./InvalidIntervalError'); | ||
if (!(this instanceof Insection)) { | ||
return new Insection(); | ||
return new Insection(valueComparer); | ||
} | ||
@@ -57,0 +57,0 @@ valueComparer = valueComparer || defaultValueComparer; |
{ | ||
"name": "insection", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A data structure for storing number intervals", | ||
@@ -5,0 +5,0 @@ "main": "lib/insection.js", |
@@ -113,2 +113,14 @@ var Insection = require('../lib/Insection.js'); | ||
}); | ||
it("overrides duplicate entries", function () { | ||
insection.add(3, 4, 'foo'); | ||
insection.add(3, 4, 'foo'); | ||
expect(insection.get(), 'to have length', 1); | ||
}); | ||
it("does not consider duplicate intervals with distinct value duplicate", function () { | ||
insection.add(3, 4, 'foo'); | ||
insection.add(3, 4, 'bar'); | ||
expect(insection.get(), 'to have length', 2); | ||
}); | ||
}); | ||
@@ -115,0 +127,0 @@ |
90536
1767