mirror of
https://github.com/koloml/furbooru-tagging-assistant.git
synced 2025-12-24 07:12:57 +00:00
Merge pull request #97 from koloml/bugfix/storage-helper-falsy-values
StorageHelper: Fixed helper treating falsy values as unset values
This commit is contained in:
@@ -22,7 +22,7 @@ export default class StorageHelper {
|
||||
* @return The JSON object or the default value if the entry does not exist.
|
||||
*/
|
||||
async read<Type = any, DefaultType = any>(key: string, defaultValue: DefaultType | null = null): Promise<Type | DefaultType> {
|
||||
return (await this.#storageArea.get(key))?.[key] || defaultValue;
|
||||
return (await this.#storageArea.get(key))?.[key] ?? defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user