Socket
Socket
Sign inDemoInstall

abstract-leveldown

Package Overview
Dependencies
Maintainers
3
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-leveldown - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

4

abstract-leveldown.js

@@ -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)",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc