@modern-kit/utils
Version:
20 lines (16 loc) • 489 B
JavaScript
;
var deviceIsClient = require('../../device/isClient/index.cjs');
require('../../device/isServer/index.cjs');
function clearStorage(type) {
if (!deviceIsClient.isClient()) {
throw new Error("Cannot be executed unless it is a client environment.");
}
try {
const storage = window[type];
storage.clear();
} catch (err) {
throw new Error(`Failed to clear ${type}: ${err}`);
}
}
exports.clearStorage = clearStorage;
//# sourceMappingURL=index.cjs.map