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

ClientStorage

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ClientStorage - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

53

client-storage.js

@@ -7,2 +7,6 @@ 'use strict';

var isServer = function () {
return typeof process === 'object' && !process?.browser;
};
var debug = function () {

@@ -24,23 +28,28 @@ console.warn.apply(console, arguments);

switch (driverName) {
case 'localStorage':
if (BrowserStorage.isSupported()) {
StorageDriver = BrowserStorage;
} else {
debug('ClientStorage is set to "localStorage", but it is not supported on this browser');
}
break;
case 'cookies':
if (CookiesStorage.isSupported()) {
StorageDriver = CookiesStorage;
} else {
debug('ClientStorage is set to "cookies", but CookiesStorage is disabled on this browser');
}
break;
case 'js':
if (isServer()) {
StorageDriver = JSStorage;
this.driverName = 'js';
break;
default:
break;
} else {
switch (driverName) {
case 'localStorage':
if (BrowserStorage.isSupported()) {
StorageDriver = BrowserStorage;
} else {
debug('ClientStorage is set to "localStorage", but it is not supported on this browser');
}
break;
case 'cookies':
if (CookiesStorage.isSupported()) {
StorageDriver = CookiesStorage;
} else {
debug('ClientStorage is set to "cookies", but CookiesStorage is disabled on this browser');
}
break;
case 'js':
StorageDriver = JSStorage;
this.driverName = 'js';
break;
default:
break;
}
}

@@ -61,3 +70,7 @@

this.driver = new StorageDriver(this, document.cookie);
if (this.driverName === 'cookies') {
this.driver = new StorageDriver(this, document.cookie);
} else {
this.driver = new StorageDriver(this);
}
Object.assign(this, StorageDriver.prototype);

@@ -64,0 +77,0 @@ }

{
"name": "ClientStorage",
"version": "4.0.0",
"version": "4.0.1",
"description": "Bulletproof persistent browser storage, works with disabled Cookies and/or localStorage",

@@ -5,0 +5,0 @@ "main": "./client-storage.js",

@@ -14,3 +14,4 @@ [![support](https://img.shields.io/badge/support-GitHub-white)](https://github.com/sponsors/dr-dimitru)

- 👨‍💻 With `String`, `Array`, `Object`, and `Boolean` support as values;
- ♿ Works with disabled `localStorage` and `cookies`.
- ♿ Works with disabled `localStorage` and `cookies`;
- Available via [📦 NPM](https://www.npmjs.com/package/ClientStorage) and [☄️ Atmosphere](https://atmospherejs.com/ostrio/cstorage).

@@ -17,0 +18,0 @@ ![ClientStorage NPM library logo](https://raw.githubusercontent.com/VeliovGroup/Client-Storage/master/cover.jpg)

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