@toolz/allow
Advanced tools
Comparing version 1.1.3 to 1.1.4
{ | ||
"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 @@ }; |
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
83989
+ Added@toolz/session-storage-is-available@1.0.0(transitive)
- Removed@toolz/local-storage-is-available@1.0.0(transitive)