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:
koloml authored and GitHub committed 2025-02-20 15:31:59 -05:00
commit f6504eeecf
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}
/**