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.4.5 to 4.5.0

test/unsafe.js

8

index.js

@@ -49,3 +49,7 @@ var ranges = require('string-range')

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

@@ -107,3 +111,3 @@ return remover(prehooks, h)

ch.key = prefix + ch.key
if(h.test(String(ch.key))) {
if(h.safe && h.test(String(ch.key))) {
//this usually means a stack overflow.

@@ -110,0 +114,0 @@ throw new Error('prehook cannot insert into own range')

{
"name": "level-hooks",
"description": "pre/post hooks for leveldb",
"version": "4.4.5",
"version": "4.5.0",
"homepage": "https://github.com/dominictarr/level-hooks",

@@ -6,0 +6,0 @@ "repository": {

@@ -70,2 +70,10 @@ # Pre/Post hooks for leveldb

#### unsafe mode
normally, pre hooks prevent you from inserting into the hooked range
when the hook is triggered. However, sometimes you do need to do this.
In those cases, pass in a range with `{start: START, end: END, safe: false}`
and level-hooks will not error. If you use this option, your hook must
avoid triggering in a loop itself.
### rm = db.hooks.post (range?, hook)

@@ -78,4 +86,5 @@

## License
MIT
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