MCPcopy
hub / github.com/prisma/prisma / read

Method read

packages/client/src/runtime/utils/SourceFileSlice.ts:19–28  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

17 private lines: string[]
18
19 static read(filePath: string): SourceFileSlice | null {
20 let content: string
21 try {
22 content = fs.readFileSync(filePath, 'utf-8')
23 } catch (e) {
24 return null
25 }
26
27 return SourceFileSlice.fromContent(content)
28 }
29
30 static fromContent(content: string): SourceFileSlice {
31 const lines = content.split(/\r?\n/)

Callers 7

getTemplateParametersFunction · 0.80
MigrateDev.test.tsFile · 0.80
sqlite.test.tsFile · 0.80
getHashFunction · 0.80
jestContext.tsFile · 0.80
vitestContext.tsFile · 0.80

Calls 1

fromContentMethod · 0.80

Tested by

no test coverage detected