getFromStorage function infrastructure exported ✓ 100.0%

Last updated: 2026-03-05T10:53:28.866Z

Metrics

LOC: 7 Complexity: 2 Params: 3 Coverage: 100.0% (2/2 lines, 0x executed)

Signature

getFromStorage( key: string, defaultValue: T, ): : Promise<T>

Summary

Reads a value from chrome.storage.local.

Tags

#@param key - Storage key to retrieve#@param defaultValue - Value returned when the key does not exist#@returns The stored value or `defaultValue`

Source Code

export async function getFromStorage<T>(
  key: string,
  defaultValue: T,
): Promise<T> {
  const result = await chrome.storage.local.get(key);
  return (result[key] as T) ?? defaultValue;
}

Dependencies (Outgoing)

graph LR getFromStorage["getFromStorage"] style getFromStorage fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getFromStorage "77fa46e898763ede.html"
TargetType
key dynamic_call

Impact (Incoming)

graph LR getFromStorage["getFromStorage"] getDemoFlows["getDemoFlows"] getFieldDetectionCache["getFieldDetectionCache"] getSavedForms["getSavedForms"] getIgnoredFields["getIgnoredFields"] getRules["getRules"] getSettings["getSettings"] getDemoFlows -->|uses| getFromStorage getFieldDetectionCache -->|calls| getFromStorage getSavedForms -->|calls| getFromStorage getIgnoredFields -->|calls| getFromStorage getRules -->|calls| getFromStorage getSettings -->|calls| getFromStorage style getFromStorage fill:#dbeafe,stroke:#2563eb,stroke-width:2px click getFromStorage "77fa46e898763ede.html" click getDemoFlows "7a890fea8b78bfa5.html" click getFieldDetectionCache "8f2869c3e935ff86.html" click getSavedForms "9a1357b95618ee5e.html" click getIgnoredFields "4ae1979d28b4e80b.html" click getRules "69aeb172cce4aa1c.html" click getSettings "99db54620b94a08b.html"