@modern-kit/utils
Version:
18 lines (15 loc) • 440 B
JavaScript
import { isClient } from '../../device/isClient/index.mjs';
import '../../device/isServer/index.mjs';
function clearStorage(type) {
if (!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}`);
}
}
export { clearStorage };
//# sourceMappingURL=index.mjs.map