"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStorage = getStorage;
const isServer = typeof window === 'undefined';
function getStorage(key, defaultValue) {
    if (isServer) {
        return defaultValue;
    }
    let value;
    try {
        value = localStorage.getItem(key) || undefined;
    }
    catch (_e) {
        // Unsupported
    }
    return value || defaultValue;
}
