New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.6.0 to 0.6.1

10

index.js

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

if (!isBuffer(key)) {
if (!Buffer.isBuffer(key)) {
key = String(key);

@@ -213,3 +213,3 @@ }

}
if (!isBuffer(key)) {
if (!Buffer.isBuffer(key)) {
key = String(key);

@@ -275,6 +275,2 @@ }

function isBuffer(buf) {
return buf instanceof ArrayBuffer;
}
function checkKeyValue(obj, type) {

@@ -303,3 +299,3 @@ if (obj === null || obj === undefined) {

if (isBuffer(obj)) {
if (Buffer.isBuffer(obj)) {
if (obj.length === 0) {

@@ -306,0 +302,0 @@ return new Error(type + ' cannot be an empty Buffer');

'use strict';
// ArrayBuffer/Uint8Array are old formats that date back to before we
// had a proper browserified buffer type. they may be removed later
var arrayBuffPrefix = 'ArrayBuffer:';

@@ -8,5 +10,10 @@ var arrayBuffRegex = new RegExp('^' + arrayBuffPrefix);

// this is the new encoding format used going forward
var bufferPrefix = 'Buff:';
var bufferRegex = new RegExp('^' + bufferPrefix);
var utils = require('./utils');
var LocalStorageCore = require('./localstorage-core');
var TaskQueue = require('./taskqueue');
var d64 = require('d64');

@@ -61,6 +68,4 @@ function LocalStorage(dbname) {

self.sequentialize(callback, function (callback) {
if (value instanceof ArrayBuffer) {
value = arrayBuffPrefix + btoa(String.fromCharCode.apply(null, value));
} else if (value instanceof Uint8Array) {
value = uintPrefix + btoa(String.fromCharCode.apply(null, value));
if (Buffer.isBuffer(value)) {
value = bufferPrefix + d64.encode(value);
}

@@ -89,3 +94,8 @@

if (typeof retval !== 'undefined') {
if (arrayBuffRegex.test(retval)) {
if (bufferRegex.test(retval)) {
retval = d64.decode(retval.substring(bufferPrefix.length));
} else if (arrayBuffRegex.test(retval)) {
// this type is kept for backwards
// compatibility with older databases, but may be removed
// after a major version bump
retval = retval.substring(arrayBuffPrefix.length);

@@ -96,2 +106,3 @@ retval = new ArrayBuffer(atob(retval).split('').map(function (c) {

} else if (uintRegex.test(retval)) {
// ditto
retval = retval.substring(uintPrefix.length);

@@ -98,0 +109,0 @@ retval = new Uint8Array(atob(retval).split('').map(function (c) {

@@ -15,7 +15,8 @@ {

],
"version": "0.6.0",
"version": "0.6.1",
"main": "index.js",
"dependencies": {
"abstract-leveldown": "~0.12.0",
"abstract-leveldown": "0.12.3",
"argsarray": "0.0.1",
"d64": "^1.0.0",
"inherits": "^2.0.1",

@@ -22,0 +23,0 @@ "tiny-queue": "0.2.0"

Sorry, the diff of this file is not supported yet

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