import {IsJsonString} from "./json_validator";

export const getDefaultValue = (key: string, defaultValue: any) => {
    const data = localStorage.getItem(key)

    if (!data) return defaultValue

    return IsJsonString(data)
        ? JSON.parse(data)
        : data
}