UNPKG

@modern-kit/utils

Version:
18 lines (15 loc) 482 B
import { isClient } from '../../device/isClient/index.mjs'; import '../../device/isServer/index.mjs'; function removeStorageItem(type, key) { if (!isClient()) { throw new Error("Cannot be executed unless it is a client environment."); } try { const storage = window[type]; storage.removeItem(key); } catch (err) { throw new Error(`Failed to remove key "${key}" from ${type}: ${err}`); } } export { removeStorageItem }; //# sourceMappingURL=index.mjs.map