"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteLocalStorage = exports.getLocalStorage = exports.saveLocalStorage = void 0;
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);
    }
};
exports.saveLocalStorage = saveLocalStorage;
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;
    }
};
exports.getLocalStorage = getLocalStorage;
const deleteLocalStorage = (key) => {
    localStorage.removeItem(key);
};
exports.deleteLocalStorage = deleteLocalStorage;
//# sourceMappingURL=save-local-storage.js.map