Comparing version 1.0.1 to 1.0.2
@@ -20,4 +20,9 @@ | ||
// to be compatible with the current abstract-leveldown tests | ||
// nullish or empty strings. | ||
// I could use !!val but I want to permit numbers and booleans, | ||
// if possible. | ||
function isDef (val) { | ||
return 'undefined' !== typeof val | ||
return val != null && val !== '' | ||
} | ||
@@ -24,0 +29,0 @@ |
{ | ||
"name": "ltgt", | ||
"description": "", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/dominictarr/ltgt", | ||
@@ -6,0 +6,0 @@ "repository": { |
37
test.js
@@ -83,2 +83,19 @@ var tape = require('tape') | ||
//nullish and empty strings signify are streated like null! | ||
{ range: | ||
{end: null, reverse: true}, | ||
selection: | ||
[5, 4, 3, 2, 1] | ||
}, | ||
{ range: | ||
{end: undefined, reverse: true}, | ||
selection: | ||
[5, 4, 3, 2, 1] | ||
}, | ||
{ range: | ||
{end: '', reverse: true}, | ||
selection: | ||
[5, 4, 3, 2, 1] | ||
}, | ||
//lt/gt/lte/gte | ||
@@ -181,3 +198,3 @@ | ||
var strings = ['00', '01'] | ||
var strings = ['00', '01', '02'] | ||
var sranges = [ | ||
@@ -187,4 +204,10 @@ {range: | ||
selection: | ||
['00', '01'] | ||
} | ||
['00', '01', '02'] | ||
}, | ||
{range: | ||
{start: '03', reverse: true}, | ||
selection: | ||
['02', '01', '00'] | ||
}, | ||
] | ||
@@ -221,1 +244,9 @@ function compare (a, b) { | ||
tape('upperBound', function (t) { | ||
t.equal('b', ltgt.upperBound({start: 'b', reverse: true})) | ||
t.equal('b', ltgt.upperBound({end: 'b', reverse: false})) | ||
t.equal(undefined, ltgt.lowerBound({start: 'b', reverse: true})) | ||
t.equal(undefined, ltgt.lowerBound({end: 'b', reverse: false})) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10922
303