Socket
Socket
Sign inDemoInstall

@toolz/allow

Package Overview
Dependencies
2
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

5

package.json
{
"name": "@toolz/allow",
"version": "1.1.2",
"version": "1.1.3",
"description": "Provides validation of data types",

@@ -58,4 +58,5 @@ "keywords": [

"dependencies": {
"@toolz/is-a-regular-object": "^1.0.1"
"@toolz/is-a-regular-object": "^1.0.1",
"@toolz/local-storage-is-available": "^1.0.0"
}
}

18

src/allow.js
import { isARegularObject } from '@toolz/is-a-regular-object';
import { localStorageIsAvailable } from '@toolz/local-storage-is-available';
const localStorageIsSupported = () => {
try {
const testKey = '__some_random_key_you_are_not_going_to_use__';
localStorage.setItem(testKey, testKey);
localStorage.removeItem(testKey);
return true;
} catch (e) {
return false;
}
};
const Allow = () => {

@@ -22,3 +12,3 @@ let allowNull;

};
if (localStorageIsSupported()) {
if (localStorageIsAvailable()) {
const savedAllowNull = localStorage.getItem('allow.allowNull');

@@ -230,3 +220,3 @@ allowNull = savedAllowNull === 'true';

aBoolean(newAllowNull);
if (localStorageIsSupported())
if (localStorageIsAvailable())
localStorage.setItem('allow.allowNull', newAllowNull.toString());

@@ -238,3 +228,3 @@ allowNull = newAllowNull;

oneOf(behavior, failureBehavior);
if (localStorageIsSupported())
if (localStorageIsAvailable())
localStorage.setItem('allow.failureBehavior', behavior);

@@ -241,0 +231,0 @@ currentFailureBehavior = behavior;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc