Socket
Socket
Sign inDemoInstall

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 2.0.0 to 2.0.1

14

abstract-leveldown.js

@@ -27,2 +27,5 @@ /* Copyright (c) 2013 Rod Vagg, MIT License */

options.createIfMissing = options.createIfMissing != false
options.errorIfExists = !!options.errorIfExists
if (typeof this._open == 'function')

@@ -62,2 +65,4 @@ return this._open(options, callback)

options.asBuffer = options.asBuffer != false
if (typeof this._get == 'function')

@@ -201,8 +206,7 @@ return this._get(key, options, callback)

options.reverse = !!options.reverse
options.keys = 'keys' in options ? !!options.keys : true
options.values = 'values' in options ? !!options.values : true
options.keys = options.keys != false
options.values = options.values != false
options.limit = 'limit' in options ? options.limit : -1
options.fillCache = !!options.fillCache
options.keyAsBuffer = 'keyAsBuffer' in options ? !!options.keyAsBuffer : true
options.valueAsBuffer = 'valueAsBuffer' in options ? !!options.valueAsBuffer : true
options.keyAsBuffer = options.keyAsBuffer != false
options.valueAsBuffer = options.valueAsBuffer != false

@@ -209,0 +213,0 @@ return options

@@ -0,1 +1,5 @@

### 2.0.0 - Aug 26 2014
* Lots of stuff between 0.11.1 and now, omitted updating changelog
* Switch to allowing writes of empty values: null, undefined, '', []
### 0.11.1 - Nov 15 2013

@@ -2,0 +6,0 @@ * Adjust approximate-size-test.js to account for snappy compression

{
"name": "abstract-leveldown",
"description": "An abstract prototype matching the LevelDOWN API",
"version": "2.0.0",
"version": "2.0.1",
"contributors": [

@@ -6,0 +6,0 @@ "Rod Vagg <r@va.gg> (https://github.com/rvagg)",

@@ -67,3 +67,3 @@ const tap = require('tap')

, expectedCb = function () {}
, expectedOptions = { options: 1 }
, expectedOptions = { createIfMissing: true, errorIfExists: false }
, test

@@ -85,11 +85,13 @@

t.equal(spy.getCall(0).args.length, 2, 'got two arguments')
t.deepEqual(spy.getCall(0).args[0], {}, 'got blank options argument')
t.deepEqual(spy.getCall(0).args[0], expectedOptions, 'got default options argument')
t.equal(spy.getCall(0).args[1], expectedCb, 'got expected cb argument')
test.open(expectedOptions, expectedCb)
test.open({ options: 1 }, expectedCb)
expectedOptions.options = 1
t.equal(spy.callCount, 2, 'got _open() call')
t.equal(spy.getCall(1).thisValue, test, '`this` on _open() was correct')
t.equal(spy.getCall(1).args.length, 2, 'got two arguments')
t.deepEqual(spy.getCall(1).args[0], expectedOptions, 'got blank options argument')
t.deepEqual(spy.getCall(1).args[0], expectedOptions, 'got expected options argument')
t.equal(spy.getCall(1).args[1], expectedCb, 'got expected cb argument')

@@ -125,3 +127,3 @@ t.end()

, expectedCb = function () {}
, expectedOptions = { options: 1 }
, expectedOptions = { asBuffer: true }
, expectedKey = 'a key'

@@ -145,7 +147,9 @@ , test

t.equal(spy.getCall(0).args[0], expectedKey, 'got expected key argument')
t.deepEqual(spy.getCall(0).args[1], {}, 'got blank options argument')
t.deepEqual(spy.getCall(0).args[1], expectedOptions, 'got default options argument')
t.equal(spy.getCall(0).args[2], expectedCb, 'got expected cb argument')
test.get(expectedKey, expectedOptions, expectedCb)
test.get(expectedKey, { options: 1 }, expectedCb)
expectedOptions.options = 1
t.equal(spy.callCount, 2, 'got _get() call')

@@ -155,3 +159,3 @@ t.equal(spy.getCall(1).thisValue, test, '`this` on _get() was correct')

t.equal(spy.getCall(1).args[0], expectedKey, 'got expected key argument')
t.deepEqual(spy.getCall(1).args[1], expectedOptions, 'got blank options argument')
t.deepEqual(spy.getCall(1).args[1], expectedOptions, 'got expected options argument')
t.equal(spy.getCall(1).args[2], expectedCb, 'got expected cb argument')

@@ -192,3 +196,3 @@ t.end()

t.equal(spy.getCall(1).args[0], expectedKey, 'got expected key argument')
t.deepEqual(spy.getCall(1).args[1], expectedOptions, 'got blank options argument')
t.deepEqual(spy.getCall(1).args[1], expectedOptions, 'got expected options argument')
t.equal(spy.getCall(1).args[2], expectedCb, 'got expected cb argument')

@@ -492,3 +496,3 @@ t.end()

var spy = sinon.spy()
, expectedOptions = { options: 1, reverse: false, keys: true, values: true, limit: -1, fillCache: false, keyAsBuffer: true, valueAsBuffer: true }
, expectedOptions = { options: 1, reverse: false, keys: true, values: true, limit: -1, keyAsBuffer: true, valueAsBuffer: true }
, test

@@ -495,0 +499,0 @@

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