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

flat-file-db

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat-file-db - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

3

index.js

@@ -85,3 +85,2 @@ var fs = require('fs');

var free = function(from, to, block) {
while (freelists.length < block) freelists.push([]);

@@ -104,2 +103,4 @@ var size = BLOCK_SIZE << block;

while (freelists.length <= maxBlock) freelists.push([]);
entries.forEach(function(entry) {

@@ -106,0 +107,0 @@ var from = self._head;

{
"name": "flat-file-db",
"version": "0.1.4",
"version": "0.1.5",
"repository": "git://github.com:mafintosh/flat-file-db.git",

@@ -5,0 +5,0 @@ "author": "Mathias Buus <mathiasbuus@gmail.com>",

@@ -18,31 +18,42 @@ var test = require('tap').test;

// make sure it's the same as in index.js
var BLOCK_SIZE = 256;
// make sure it's the same as in index.js
var BLOCK_SIZE = 256;
// make sure this function is the same as in index.js
var nextBlockSize = function(length) {
var i = 0;
while ((BLOCK_SIZE << i) < length) i++;
return i;
};
// make sure this function is the same as in index.js
var nextBlockSize = function(length) {
var i = 0;
while ((BLOCK_SIZE << i) < length) i++;
return i;
};
var len = 1000;
var len = 1000;
var db = ff.sync(reset(TMP));
var db = ff.sync(reset(TMP));
while (nextBlockSize(len) < db._freelists.length) {
len *= 2;
}
while (nextBlockSize(len) < db._freelists.length) {
len *= 2;
}
var data = '';
for (var i=0; i<len; i++) {
data += 'a';
}
var data = '';
for (var i=0; i<len; i++) {
data += 'a';
}
data = {d:data};
data = {d:data};
db.put('a', data);
db.put('a', data);
db.put('b', data);
t.end();
db.put('a', data);
db.del('b');
// there was also a bug on re-loading freelists
// for large block sizes, so let's read the DB back
db.on('drain', function(){
ff.sync(TMP);
t.end();
});
});

@@ -49,0 +60,0 @@

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