Similar to getAsString
the key of the value to access.
the value if existing or undefined otherwise.
Uses same logic as getAsObject.
the key of the value to access.
the StorageValue[] if the stored value is readable as StorageValue[], otherwise undefined.
Returns the value for the given key as boolean. Tries to parse the value at the given key as boolean.
the key of the value to access.
the value as boolean if existing or readable as boolean. Otherwise undefined!
Returns the value for the given key as T. Uses JSON.parse for parsing and casts it to T.
the key of the value to access.
Optional
typeCheck: (o: Record<string, unknown>) => booleana optional function which verifies the retrieved object, if the function returns false, undefined is returned
the object if JSON.parse is able to read it, otherwise undefined.
Returns the value for the given key as string. This method will always return a value if the key exists, because all values are saved as string!
the key of the value to access.
the value if existing or undefined otherwise.
Sets the given value with the given key into the storage.
Objects are serialized with JSON.stringify
.
the key where to save the value
the value to store.
Sets the given key value pairs into the storage. This is considered as single transaction, in stores with transactions.
a object with multiple key value pairs to write into the storage.
Deletes the given key(s) from the storage.