MCPcopy Index your code
hub / github.com/upstash/context7 / readUpdateState

Function readUpdateState

packages/cli/src/utils/update-check.ts:74–81  ·  view source on GitHub ↗
(stateFile?: string)

Source from the content-addressed store, hash-verified

72}
73
74async function readUpdateState(stateFile?: string): Promise<UpdateState> {
75 try {
76 const raw = await readFile(await readStateFilePath(stateFile), "utf-8");
77 return JSON.parse(raw) as UpdateState;
78 } catch {
79 return {};
80 }
81}
82
83async function writeUpdateState(state: UpdateState, stateFile?: string): Promise<void> {
84 const path = await writeStateFilePath(stateFile);

Callers 3

checkForUpdatesFunction · 0.85

Calls 1

readStateFilePathFunction · 0.85

Tested by

no test coverage detected