Comparing version 1.2.0 to 1.2.1
@@ -5,10 +5,7 @@ var inherits = require('inherits') | ||
, ltgt = require('ltgt') | ||
, setImmediate = global.setImmediate || process.nextTick | ||
, createRBT = require('functional-red-black-tree') | ||
, globalStore = {} | ||
/* istanbul ignore next */ | ||
var setImmediate = global.setImmediate || process.nextTick | ||
function toKey (key) { | ||
return typeof key == 'string' ? '$' + key : JSON.stringify(key) | ||
} | ||
function gt(value) { | ||
@@ -127,3 +124,3 @@ return ltgt.compare(value, this._end) > 0 | ||
this._location = this.location ? toKey(this.location) : '_tree' | ||
this._location = this.location ? ('$' + this.location) : '_tree' | ||
this._store = this.location ? globalStore: this | ||
@@ -188,4 +185,3 @@ this._store[this._location] = this._store[this._location] || createRBT(ltgt.compare) | ||
MemDOWN.prototype._batch = function (array, options, callback) { | ||
var err | ||
, i = -1 | ||
var i = -1 | ||
, key | ||
@@ -202,6 +198,2 @@ , value | ||
key = this._isBuffer(array[i].key) ? array[i].key : String(array[i].key) | ||
err = this._checkKey(key, 'key') | ||
if (err) | ||
return setImmediate(function errorCall() { callback(err) }) | ||
iter = tree.find(key) | ||
@@ -211,8 +203,2 @@ | ||
value = this._isBuffer(array[i].value) ? array[i].value : String(array[i].value) | ||
if (value === null || value === undefined) | ||
err = new Error('value cannot be `null` or `undefined`') | ||
if (err) | ||
return setImmediate(function errorCall() { callback(err) }) | ||
tree = iter.valid ? iter.update(value) : tree.insert(key, value) | ||
@@ -238,3 +224,3 @@ } else { | ||
MemDOWN.destroy = function (name, callback) { | ||
var key = toKey(name) | ||
var key = '$' + name | ||
@@ -241,0 +227,0 @@ if (key in globalStore) |
{ | ||
"name": "memdown", | ||
"description": "An drop-in replacement for LevelDOWN that works in memory only", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"homepage": "https://github.com/Level/memdown", | ||
@@ -27,3 +27,3 @@ "authors": [ | ||
"functional-red-black-tree": "^1.0.1", | ||
"abstract-leveldown": "^2.0.3" | ||
"abstract-leveldown": "2.4.1" | ||
}, | ||
@@ -45,4 +45,4 @@ "devDependencies": { | ||
"test": "npm run lint && node ./test.js --stderr | faucet", | ||
"test-browser": "zuul ./test.js", | ||
"test-browser-local": "zuul --local ./test.js", | ||
"test-browser": "zuul --no-coverage ./test.js", | ||
"test-browser-local": "zuul --no-coverage --local 9000 ./test.js", | ||
"lint": "jshint -c .jshintrc memdown.js", | ||
@@ -49,0 +49,0 @@ "coverage": "istanbul cover -i memdown.js ./node_modules/.bin/tape ./test.js && istanbul check-coverage --lines 90 --function 80 --statements 90 --branches 80", |
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
12572
171
+ Addedabstract-leveldown@2.4.1(transitive)
- Removedabstract-leveldown@2.7.2(transitive)
Updatedabstract-leveldown@2.4.1