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

bloomrun

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bloomrun - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

5

bloomrun.js

@@ -75,2 +75,7 @@ 'use strict'

if (onlyRegex(pattern)) {
this._regexBucket.remove(pattern, payload)
return this
}
for (var key in pattern) {

@@ -77,0 +82,0 @@ if (pattern.hasOwnProperty(key)) {

4

lib/bucket.js

@@ -5,2 +5,3 @@ 'use strict'

var match = require('./match')
var onlyRegex = require('./onlyRegex')

@@ -31,5 +32,6 @@ function Bucket (parent) {

var data = this.data
var justRegex = onlyRegex(pattern)
for (var i = 0; i < data.length; i++) {
if (match(pattern, data[i].pattern)) {
if (payload === null || payload === data[i].payload) {
if (payload === null || payload === data[i].payload || justRegex) {
data.splice(i, 1)

@@ -36,0 +38,0 @@ foundPattern = true

{
"name": "bloomrun",
"version": "3.0.1",
"version": "3.0.2",
"description": "JS object pattern matching, powered by bloom filters",

@@ -30,3 +30,3 @@ "main": "bloomrun.js",

"pre-commit": "^1.1.1",
"snazzy": "^5.0.0",
"snazzy": "^6.0.0",
"standard": "^8.5.0",

@@ -33,0 +33,0 @@ "tape": "^4.0.2",

@@ -169,2 +169,17 @@ 'use strict'

test('removing regex pattern without other keys is supported', function (t) {
t.plan(2)
var instance = bloomrun()
var pattern = { to: /.*/ }
instance.add(pattern)
t.deepEqual(instance.lookup({ to: 'you' }), pattern)
instance.remove(pattern)
t.equal(instance.lookup({ to: 'you' }), null)
})
test('remove deletes all matches', function (t) {

@@ -171,0 +186,0 @@ t.plan(2)

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