MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / get

Method get

static/local.ts:69–77  ·  view source on GitHub ↗
(key: string, ifNotPresent: T)

Source from the content-addressed store, hash-verified

67
68class SessionThenLocalStorage implements Storage {
69 get<T>(key: string, ifNotPresent: T): string | T {
70 try {
71 const sessionValue = window.sessionStorage.getItem(prefix + key);
72 if (sessionValue !== null) return sessionValue;
73 } catch {
74 // Swallow up any security exceptions...
75 }
76 return localStorage.get<T>(key, ifNotPresent);
77 }
78
79 remove(key: string) {
80 this.removeSession(key);

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected