(config: Partial<A11yPluginOptions>)
| 41 | * Save configuration to localStorage |
| 42 | */ |
| 43 | export function saveConfig(config: Partial<A11yPluginOptions>): void { |
| 44 | if (typeof localStorage === 'undefined') { |
| 45 | return |
| 46 | } |
| 47 | |
| 48 | try { |
| 49 | const current = loadConfig() |
| 50 | const updated = { ...current, ...config } |
| 51 | localStorage.setItem(STORAGE_KEY, JSON.stringify(updated)) |
| 52 | } catch (error) { |
| 53 | console.warn('[A11y Config] Failed to save config to localStorage:', error) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Merge user options with defaults |
no test coverage detected