Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abstract-leveldown

Package Overview
Dependencies
Maintainers
1
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 0.0.0 to 0.0.1

20

abstract-leveldown.js
/* Copyright (c) 2013 Rod Vagg, MIT License */
function checkKeyValue(obj, type) {
if (obj === null || obj === undefined)
return new Error(type + ' cannot be `null` or `undefined`')
if (obj === null || obj === undefined)
return new Error(type + ' cannot be `null` or `undefined`')
if (Buffer.isBuffer(obj)) {
if (obj.length === 0)
return new Error(type + ' cannot be an empty Buffer')
} else if (String(obj) === '')
return new Error(type + ' cannot be an empty String')
}
function AbstractIterator (db) {

@@ -86,2 +98,4 @@ this.db = db

throw new Error('get() requires a callback argument')
var err = checkKeyValue(key, 'key')
if (err) return callback(err)
if (typeof options != 'object')

@@ -101,2 +115,6 @@ options = {}

throw new Error('put() requires a callback argument')
var err = checkKeyValue(value, 'value')
if (err) return callback(err)
err = checkKeyValue(key, 'key')
if (err) return callback(err)
if (typeof options != 'object')

@@ -116,2 +134,4 @@ options = {}

throw new Error('del() requires a callback argument')
var err = checkKeyValue(key, 'key')
if (err) return callback(err)
if (typeof options != 'object')

@@ -118,0 +138,0 @@ options = {}

5

package.json
{
"name" : "abstract-leveldown"
, "description" : "An abstract prototype matching the LevelDOWN API"
, "version" : "0.0.0"
, "version" : "0.0.1"
, "homepage" : "https://github.com/rvagg/node-abstract-leveldown"

@@ -19,4 +19,5 @@ , "authors" : [

"tap" : "*"
, "leveldown" : "~0.2.0"
, "leveldown" : "git+https://github.com/rvagg/node-leveldown.git#0.2-wip"
, "sinon" : "*"
, "rimraf" : "*"
}

@@ -23,0 +24,0 @@ , "scripts": {

@@ -26,2 +26,9 @@ var tap = require('tap')

require('leveldown/test/put-get-del-test').setUp(factory)
require('leveldown/test/put-get-del-test').errorKeys()
//require('leveldown/test/put-get-del-test').nonErrorKeys()
require('leveldown/test/put-get-del-test').errorValues()
//require('leveldown/test/put-get-del-test').nonErrorKeys()
require('leveldown/test/put-get-del-test').tearDown()
require('leveldown/test/approximate-size-test').setUp(factory)

@@ -28,0 +35,0 @@ require('leveldown/test/approximate-size-test').args(factory)

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