MCPcopy Create free account
hub / github.com/anomalyco/opencode / resolveTarget

Function resolveTarget

packages/app/src/utils/persist.ts:518–526  ·  view source on GitHub ↗
(target: PersistTarget, platform: Platform)

Source from the content-addressed store, hash-verified

516}
517
518function resolveTarget(target: PersistTarget, platform: Platform): PersistTarget {
519 if (target.scope !== "window") return target
520 if (platform.platform === "desktop" && !platform.windowID) return { ...target, storage: GLOBAL_STORAGE }
521 const windowID = platform.platform === "desktop" ? (platform.windowID ?? "browser") : "browser"
522 return {
523 ...target,
524 storage: windowStorage(windowID),
525 }
526}
527
528export function removePersisted(
529 target: { storage?: string; legacyStorageNames?: string[]; key: string },

Callers 1

persistedFunction · 0.70

Calls 1

windowStorageFunction · 0.85

Tested by

no test coverage detected