MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / load

Method load

packages/oauth/src/storage.ts:72–88  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

70 }
71
72 async load(name: string): Promise<TokenInfo | undefined> {
73 const file = this.pathFor(name);
74 let raw: string;
75 try {
76 raw = readFileSync(file, 'utf-8');
77 } catch {
78 return undefined;
79 }
80 let parsed: unknown;
81 try {
82 parsed = JSON.parse(raw);
83 } catch {
84 return undefined;
85 }
86 if (!isRecord(parsed)) return undefined;
87 return tokenFromWire(parsed as Partial<TokenInfoWire>);
88 }
89
90 async save(name: string, token: TokenInfo): Promise<void> {
91 this.ensureDir();

Callers

nothing calls this directly

Calls 3

pathForMethod · 0.95
isRecordFunction · 0.90
tokenFromWireFunction · 0.90

Tested by

no test coverage detected