level-hooks
Advanced tools
Comparing version 4.1.4 to 4.1.5
10
index.js
@@ -75,3 +75,3 @@ | ||
function callHooks (isBatch, b, opts, cb) { | ||
try { | ||
b.forEach(function hook(e, i) { | ||
@@ -93,2 +93,6 @@ prehooks.forEach(function (h) { | ||
ch.key = prefix + ch.key | ||
if(h.test(String(ch.key))) { | ||
//this usually means a stack overflow. | ||
throw new Error('prehook cannot insert into own range') | ||
} | ||
b.push(ch) | ||
@@ -114,3 +118,5 @@ hook(ch, b.length - 1) | ||
}) | ||
} catch (err) { | ||
return (cb || opts)(err) | ||
} | ||
b = b.filter(function (e) { | ||
@@ -117,0 +123,0 @@ return e && e.type //filter out empty items |
{ | ||
"name": "level-hooks", | ||
"description": "pre/post hooks for leveldb", | ||
"version": "4.1.4", | ||
"version": "4.1.5", | ||
"homepage": "https://github.com/dominictarr/level-hooks", | ||
@@ -6,0 +6,0 @@ "repository": { |
15455
13
387