MCPcopy
hub / github.com/vitejs/vite / get

Method get

packages/vite/src/node/server/bundledDev.ts:38–49  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

36 }
37
38 get(file: string): MemoryFile | undefined {
39 const result = this.files.get(file)
40 if (result === undefined) {
41 return undefined
42 }
43 if (typeof result === 'function') {
44 const content = result()
45 this.files.set(file, content)
46 return content
47 }
48 return result
49 }
50
51 set(file: string, content: MemoryFile | (() => MemoryFile)): void {
52 this.files.set(file, content)

Callers

nothing calls this directly

Calls 3

resultFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected