MCPcopy Index your code
hub / github.com/simstudioai/sim / isAvailable

Method isAvailable

apps/sim/lib/core/utils/browser-storage.ts:87–100  ·  view source on GitHub ↗

* Check if localStorage is available * @returns True if localStorage is available and accessible

()

Source from the content-addressed store, hash-verified

85 * @returns True if localStorage is available and accessible
86 */
87 static isAvailable(): boolean {
88 if (typeof window === 'undefined') {
89 return false
90 }
91
92 try {
93 const testKey = '__test_localStorage_availability__'
94 window.localStorage.setItem(testKey, 'test')
95 window.localStorage.removeItem(testKey)
96 return true
97 } catch {
98 return false
99 }
100 }
101}
102
103export const STORAGE_KEYS = {

Callers

nothing calls this directly

Calls 2

setItemMethod · 0.80
removeItemMethod · 0.80

Tested by

no test coverage detected