Skip to content

Commit

Permalink
Merge pull request #78 from Blumea/development
Browse files Browse the repository at this point in the history
🏗️ v1.1.2 minor update
  • Loading branch information
akashchouhan16 committed Oct 30, 2023
2 parents c29a395 + f830e20 commit 7b0718d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
'env': {
'node': true,
'commonjs': true,
'es2021': true,
'jest/globals': true
},
plugins: ['jest'],
'extends': 'eslint:recommended',
'overrides': [
{
'files': [
'.eslintrc.{js,cjs}'
],
'parserOptions': {
'sourceType': 'script'
}
}
],
'parserOptions': {
'ecmaVersion': 'latest'
},
'ignorePatterns': ['/dist/', '/tests/'],
'rules': {
quotes: ['error', 'single', { 'allowTemplateLiterals': true }]
}
}
28 changes: 0 additions & 28 deletions build/classicalBloom/bitarray.js

This file was deleted.

4 changes: 2 additions & 2 deletions build/countingBloom/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CountingBloomFilter {

for (let i = 0; i < this.hash_count; i++) {
const index = Math.ceil(murmurhash.v3(element, i) % this.size);
if (!this.bit_set[index] || !this.bit_set[index].hasOwnProperty('count_bit') || this.bit_set[index].count_bit === 0) {
if (!this.bit_set[index] || this.bit_set[index].count_bit === 0) {
if (this.logger) {
blumeaLogger('counting', `${element} does not exist.`);
}
Expand Down Expand Up @@ -157,7 +157,7 @@ class CountingBloomFilter {
let count = 0;
for (let i = 0; i < this.hash_count; i++) {
const index = Math.ceil(murmurhash.v3(element, i) % this.size);
if (!this.bit_set[index] || !this.bit_set[index].hasOwnProperty('count_bit') || this.bit_set[index].count_bit === 0) {
if (!this.bit_set[index] || this.bit_set[index].count_bit === 0) {
if (this.logger) {
blumeaLogger('counting', `${element} does not exist.`);
}
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ const ScalableBloomFilter = require('./build/scalableBloom/main')

const CuckooBloomFilter = require('./build/cuckooBloom/main')

const { buildVector, setBit, getBit } = require('./build/classicalBloom/bitarray')
const bitArray = { buildVector, setBit, getBit }

module.exports = { BloomFilter, PartitionedBloomFilter, CountingBloomFilter, CuckooBloomFilter, ScalableBloomFilter, bitArray }
module.exports = { BloomFilter, PartitionedBloomFilter, CountingBloomFilter, CuckooBloomFilter, ScalableBloomFilter }
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "blumea",
"version": "1.1.1",
"version": "1.1.2",
"description": "Blumea is a streamlined Bloom filter npm package for your node apps.",
"main": "index.js",
"scripts": {
"test": "jest",
"lint": "eslint . --ext .js",
"lint-fix": "eslint --fix . --ext .js",
"test/classical": "echo \"Manual tests on classical bloom..\" && cd Tests && node test-classical.js -log",
"test/counting": "echo \"Manual tests on counting bloom..\" && cd Tests && node test-counting.js -log",
"test/partitioned": "echo \"Manual tests on partitioned bloom..\" && cd Tests && node test-partitioned.js -log",
Expand Down Expand Up @@ -41,6 +43,8 @@
"murmurhash-js": "^1.0.0"
},
"devDependencies": {
"eslint": "^8.52.0",
"eslint-plugin-jest": "^27.6.0",
"jest": "^29.5.0"
}
}

0 comments on commit 7b0718d

Please sign in to comment.