abstract-leveldown
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -11,4 +11,4 @@ /* Copyright (c) 2013 Rod Vagg, MIT License */ | ||
if (typeof location != 'string') | ||
throw new Error('constructor requires a location string argument') | ||
if (typeof location != 'string' || !location.length) | ||
throw new Error('constructor requires a non empty location string') | ||
@@ -15,0 +15,0 @@ this.location = location |
@@ -5,3 +5,3 @@ module.exports.args = function (leveldown, test) { | ||
leveldown | ||
, { name: 'Error', message: 'constructor requires at least a location argument' } | ||
, /constructor requires at least a location argument/ | ||
, 'no-arg leveldown() throws' | ||
@@ -11,2 +11,3 @@ ) | ||
}) | ||
test('test database creation non-string location throws', function (t) { | ||
@@ -17,3 +18,3 @@ t.throws( | ||
} | ||
, { name: 'Error', message: 'constructor requires a location string argument' } | ||
, /constructor requires a non empty location string/ | ||
, 'non-string location leveldown() throws' | ||
@@ -24,4 +25,16 @@ ) | ||
test('test database open no-arg throws', function (t) { | ||
var db = leveldown('foo') | ||
test('test database creation empty string location throws', function (t) { | ||
t.throws( | ||
function () { | ||
leveldown('') | ||
} | ||
, /constructor requires a non empty location string/ | ||
, 'non-string location leveldown() throws' | ||
) | ||
t.end() | ||
}) | ||
test('test database creation non empty string does not throw', function (t) { | ||
var db | ||
t.doesNotThrow(function () { db = leveldown('foo') }) | ||
t.ok(db, 'database object returned') | ||
@@ -31,2 +44,2 @@ t.ok(typeof db.open === 'function', 'open() function exists') | ||
}) | ||
} | ||
} |
{ | ||
"name": "abstract-leveldown", | ||
"description": "An abstract prototype matching the LevelDOWN API", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ "Rod Vagg <r@va.gg> (https://github.com/rvagg)", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
114921
2676
0