UNPKG

@modern-kit/utils

Version:
20 lines (16 loc) 536 B
'use strict'; var deviceIsClient = require('../../device/isClient/index.cjs'); require('../../device/isServer/index.cjs'); function removeStorageItem(type, key) { if (!deviceIsClient.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}`); } } exports.removeStorageItem = removeStorageItem; //# sourceMappingURL=index.cjs.map