New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

level-hooks

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-hooks - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

24

index.js
var ranges = require('string-range')
//this will be used by queue.
module.exports = function (db) {

@@ -23,19 +22,2 @@

function checker(range) {
if ('string' === typeof range)
return function (key) {
return key.indexOf(range) == 0
}
else if(range instanceof RegExp)
return function (key) {
return range.test(key)
}
else if('object' === typeof range)
return function (key) {
return key >= range.start && key <= range.end
}
else if('function' === typeof range)
return range
}
function remover (array, item) {

@@ -53,3 +35,3 @@ return function () {

if(!hook) hook = prefix, prefix = ''
var h = {test: checker(prefix), hook: hook}
var h = {test: ranges.checker(prefix), hook: hook}
posthooks.push(h)

@@ -60,3 +42,3 @@ return remover(posthooks, h)

if(!hook) hook = prefix, prefix = ''
var h = {test: checker(prefix), hook: hook}
var h = {test: ranges.checker(prefix), hook: hook}
prehooks.push(h)

@@ -63,0 +45,0 @@ return remover(prehooks, h)

6

package.json
{
"name": "level-hooks",
"description": "pre/post hooks for leveldb",
"version": "4.0.0",
"version": "4.0.1",
"homepage": "https://github.com/dominictarr/level-hooks",

@@ -11,3 +11,5 @@ "repository": {

"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://bit.ly/dominictarr)",
"dependencies": {},
"dependencies": {
"string-range": "~1.0.0"
},
"devDependencies": {

@@ -14,0 +16,0 @@ "levelup": "~0.6",

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