@toolz/allow
Advanced tools
Comparing version 1.0.8 to 1.1.0
{ | ||
"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" | ||
} | ||
} |
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83496
1140
670
2
+ Added@toolz/local-storage@^1.0.2
+ Added@toolz/allow@1.1.5(transitive)
+ Added@toolz/local-storage@1.0.5(transitive)
+ Added@toolz/local-storage-is-available@1.0.0(transitive)
+ Added@toolz/session-storage-is-available@1.0.0(transitive)