MCPcopy Create free account
hub / github.com/TanStack/devtools / loadConfig

Function loadConfig

packages/devtools-a11y/src/core/utils/config.utils.ts:19–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 * Load configuration from localStorage
18 */
19export function loadConfig(): Required<A11yPluginOptions> {
20 if (typeof localStorage === 'undefined') {
21 return DEFAULT_CONFIG
22 }
23
24 try {
25 const stored = localStorage.getItem(STORAGE_KEY)
26 if (stored) {
27 const parsed = JSON.parse(stored) as Partial<A11yPluginOptions>
28 return { ...DEFAULT_CONFIG, ...parsed }
29 }
30 } catch (error) {
31 console.warn(
32 '[A11y Config] Failed to load config from localStorage:',
33 error,
34 )
35 }
36
37 return DEFAULT_CONFIG
38}
39
40/**
41 * Save configuration to localStorage

Callers 3

config.test.tsFile · 0.90
saveConfigFunction · 0.85
mergeConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected