MCPcopy
hub / github.com/simstudioai/sim / removeItem

Method removeItem

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

* Safely removes an item from localStorage * @param key - The storage key to remove * @returns True if successful, false otherwise

(key: string)

Source from the content-addressed store, hash-verified

67 * @returns True if successful, false otherwise
68 */
69 static removeItem(key: string): boolean {
70 if (typeof window === 'undefined') {
71 return false
72 }
73
74 try {
75 window.localStorage.removeItem(key)
76 return true
77 } catch (error) {
78 logger.warn(`Failed to remove localStorage item "${key}":`, error)
79 return false
80 }
81 }
82
83 /**
84 * Check if localStorage is available

Callers 15

clearUserDataFunction · 0.80
store.tsFile · 0.80
migrateFromLocalStorageFunction · 0.80
clearExecutionPointerFunction · 0.80
store.tsFile · 0.80
isAvailableMethod · 0.80
clearMethod · 0.80
clearMethod · 0.80
clearMethod · 0.80

Calls 1

warnMethod · 0.65

Tested by

no test coverage detected