export const saveLocalStorage = ({ key, value }) => {
    try {
        if (value === undefined || value === null) {
            localStorage.removeItem(key);
            return;
        }
        localStorage.setItem(key, JSON.stringify(value));
    }
    catch (error) {
        console.warn('saveLocalStorage error:', error);
    }
};
export const getLocalStorage = (key) => {
    if (typeof window === 'undefined')
        return null;
    try {
        const value = localStorage.getItem(key);
        if (!value)
            return null;
        return value;
    }
    catch (error) {
        console.warn('getLocalStorage error:', error);
        return null;
    }
};
export const deleteLocalStorage = (key) => {
    localStorage.removeItem(key);
};
//# sourceMappingURL=save-local-storage.js.map