Socket
Socket
Sign inDemoInstall

@toolz/allow

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toolz/allow - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

4

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

@@ -59,4 +59,4 @@ "keywords": [

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

@@ -612,3 +612,3 @@ # allow

can be toggled with setAllowNull().
If localStorage is available, the allowNull value will be set there.
If sessionStorage is available, the allowNull value will be set there.
This allows the setting to be saved once in the lifecycle of the app.

@@ -631,3 +631,3 @@ */

'ignore' will turn off all warnings and cease the throwing of all Errors.
If localStorage is available, the failureBehavior value will be set there.
If sessionStorage is available, the failureBehavior value will be set there.
This allows the setting to be saved once in the lifecycle of the app.

@@ -634,0 +634,0 @@ */

import { isARegularObject } from '@toolz/is-a-regular-object';
import { localStorageIsAvailable } from '@toolz/local-storage-is-available';
import { sessionStorageIsAvailable } from '@toolz/session-storage-is-available';

@@ -12,6 +12,6 @@ const Allow = () => {

};
if (localStorageIsAvailable()) {
const savedAllowNull = localStorage.getItem('allow.allowNull');
if (sessionStorageIsAvailable()) {
const savedAllowNull = sessionStorage.getItem('allow.allowNull');
allowNull = savedAllowNull === 'true';
currentFailureBehavior = localStorage.getItem('allow.failureBehavior') || failureBehavior.THROW;
currentFailureBehavior = sessionStorage.getItem('allow.failureBehavior') || failureBehavior.THROW;
} else {

@@ -220,4 +220,4 @@ allowNull = false;

aBoolean(newAllowNull);
if (localStorageIsAvailable())
localStorage.setItem('allow.allowNull', newAllowNull.toString());
if (sessionStorageIsAvailable())
sessionStorage.setItem('allow.allowNull', newAllowNull.toString());
allowNull = newAllowNull;

@@ -228,4 +228,4 @@ };

oneOf(behavior, failureBehavior);
if (localStorageIsAvailable())
localStorage.setItem('allow.failureBehavior', behavior);
if (sessionStorageIsAvailable())
sessionStorage.setItem('allow.failureBehavior', behavior);
currentFailureBehavior = behavior;

@@ -232,0 +232,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