A thin wrapper layer around storage utility.
Kind: global class
Boolean
Boolean
Boolean
String
\*
Create the storage.
Param | Type | Description |
---|---|---|
adapters | Array.<StorageAdapter> |
List of storage adapters to pick from. Will use the first option returning ‘isValid()’ = true. |
prefix | String |
Optional prefix to add to all keys under this storage instance. |
valuesAsBase64 | Boolean |
If true, will encode and decode data as base64. |
keysAsBase64 | Boolean |
If true, will encode and decode keys as base64. |
Boolean
Return if this storage adapter is persistent storage or not.
Kind: instance property of Storage
Returns: Boolean
- True if this storage type is persistent.
Boolean
Check if this storage instance has a valid adapter.
Kind: instance property of Storage
Returns: Boolean
- True if found a valid adapter to use, false otherwise.
Boolean
Check if a key exists.
Kind: instance method of Storage
Returns: Boolean
- True if key exists in storage.
Param | Type | Description |
---|---|---|
key | String |
Key to check. |
Set value.
Kind: instance method of Storage
Param | Type | Description |
---|---|---|
key | String |
Key to set. |
value | String |
Value to set. |
String
Get value.
Kind: instance method of Storage
Returns: String
- Value or null if not set.
Param | Type | Description |
---|---|---|
key | String |
Key to get. |
\*
Get value and JSON parse it.
Kind: instance method of Storage
Returns: \*
- Value as a dictionary object or null if not set.
Param | Type | Description |
---|---|---|
key | String |
Key to get. |
Set value as JSON.
Kind: instance method of Storage
Param | Type | Description |
---|---|---|
key | String |
Key to set. |
value | \* |
Value to set as a dictionary. |
Delete value.
Kind: instance method of Storage
Param | Type | Description |
---|---|---|
key | String |
Key to delete. |
Clear all values from this storage instance, based on prefix + adapter type.
Kind: instance method of Storage
Default adapters to use when no adapters list is provided.
Kind: static property of Storage