GHHG10's picture
download
raw
831 Bytes
import Store from "electron-store"
import electron from "electron"
import { SETTINGS_STORE } from "./store-keys"
const cache = new Map<string, Store>()
// We cannot instantiate the electron-store at module load time because
// module import hoisting causes this to run before app.setPath("userData", ...)
// in index.ts has executed, which would result in files being written to the default directory
// (e.g. bad: %APPDATA%\@opencode-ai\desktop\opencode.settings vs good: %APPDATA%\ai.opencode.desktop.dev\opencode.settings).
export function getStore(name = SETTINGS_STORE) {
const cached = cache.get(name)
if (cached) return cached
const next = new Store({
name,
cwd: electron.app.getPath("userData"),
fileExtension: "",
accessPropertiesByDotNotation: false,
})
cache.set(name, next)
return next
}

Xet Storage Details

Size:
831 Bytes
·
Xet hash:
65c427e9422dc7acbe7134538e4d5aa1ffa28799a73324b69d143c99ab6b7551

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.