You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@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

to
1.1.0

5

package.json
{
"name": "@toolz/allow",
"version": "1.0.8",
"version": "1.1.0",
"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": "^1.0.2"
}
}

4

README.md

@@ -612,2 +612,4 @@ # allow

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

@@ -629,2 +631,4 @@ ```

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

@@ -631,0 +635,0 @@ ```

import { isARegularObject } from '@toolz/is-a-regular-object';
import { local } from '@toolz/local-storage';
const Allow = () => {
let allowNull = false;
let allowNull = local.getItem('allow.allowNull', false);
const failureBehavior = {

@@ -10,3 +11,3 @@ IGNORE: 'ignore',

};
let currentFailureBehavior = failureBehavior.THROW;
let currentFailureBehavior = local.getItem('allow.failureBehavior', failureBehavior.THROW);
let onFailure = () => {

@@ -211,3 +212,3 @@ //

aBoolean(newAllowNull);
allowNull = newAllowNull;
allowNull = local.setItem('allow.allowNull', newAllowNull);
};

@@ -217,3 +218,3 @@

oneOf(behavior, failureBehavior);
currentFailureBehavior = behavior;
currentFailureBehavior = local.setItem('allow.failureBehavior', behavior);
};

@@ -220,0 +221,0 @@