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

Function tempPathFor

apps/kimi-code/src/utils/persistence.ts:28–33  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

26}
27
28function tempPathFor(filePath: string): string {
29 const dir = dirname(filePath);
30 const base = basename(filePath);
31 const nonce = `${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}`;
32 return join(dir, `.${base}.${nonce}.tmp`);
33}
34
35export async function readJsonFile<T>(
36 filePath: string,

Callers 1

writeJsonFileFunction · 0.85

Calls 3

basenameFunction · 0.85
nowMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected