Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

localstorage-down

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localstorage-down - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

.idea/.name

9

localstorage.js

@@ -12,3 +12,3 @@ 'use strict';

this._keys = [];
this._prefix = dbname + '!';
this._prefix = dbname.replace(/!/g, '!!') + '!'; // escape bangs in dbname

@@ -29,8 +29,3 @@ var prefixLen = this._prefix.length;

LocalStorage.prototype.key = function (keyindex) {
var retVal = this._keys[keyindex];
if (typeof retVal !== 'undefined') {
// this needs to be a last and first;
retVal = retVal.replace('!bin');
}
return retVal;
return this._keys[keyindex];
};

@@ -37,0 +32,0 @@

@@ -15,3 +15,3 @@ {

],
"version": "0.5.1",
"version": "0.5.2",
"main": "index.js",

@@ -18,0 +18,0 @@ "dependencies": {

@@ -17,3 +17,3 @@ 'use strict';

tape('test .destroy', function(t) {
tape('test .destroy', function (t) {
var db = levelup('destroy-test', {db: leveldown});

@@ -48,2 +48,25 @@ var db2 = levelup('other-db', {db: leveldown});

tape('test escaped db name', function (t) {
var db = levelup('bang!', {db: leveldown});
var db2 = levelup('bang!!', {db: leveldown});
db.put('!db1', '!db1', function (err) {
t.notOk(err, 'no error');
db2.put('db2', 'db2', function (err) {
t.notOk(err, 'no error');
db.close(function (err) {
t.notOk(err, 'no error');
db2.close(function (err) {
t.notOk(err, 'no error');
db = levelup('bang!', {db: leveldown});
db.get('!db2', function (err, key, value) {
t.ok(err, 'got error');
t.equal(key, undefined, 'key should be null');
t.equal(value, undefined, 'value should be null');
t.end();
});
});
});
});
});
});
};
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