chore: Removing some any

This commit is contained in:
Tom Moor
2024-01-05 23:25:05 -05:00
parent 89d905ebb7
commit 140526af06
5 changed files with 10 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
import { Primitive } from "utility-types";
/**
* Storage is a wrapper class for localStorage that allow safe usage when
* localStorage is not available.
@@ -41,7 +43,7 @@ class Storage {
* @param fallback The fallback value if the key doesn't exist.
* @returns The value or undefined if it doesn't exist.
*/
public get(key: string, fallback?: any) {
public get(key: string, fallback?: Primitive) {
try {
const value = this.interface.getItem(key);
if (typeof value === "string") {
@@ -79,7 +81,7 @@ class MemoryStorage {
return this.data[key] || null;
}
setItem(key: string, value: any) {
setItem(key: string, value: Primitive) {
return (this.data[key] = String(value));
}