MCPcopy
hub / github.com/prisma/prisma / writeFileMap

Function writeFileMap

packages/client-generator-js/src/generateClient.ts:408–425  ·  view source on GitHub ↗
(outputDir: string, fileMap: FileMap)

Source from the content-addressed store, hash-verified

406}
407
408function writeFileMap(outputDir: string, fileMap: FileMap) {
409 return Promise.all(
410 Object.entries(fileMap).map(async ([fileName, content]) => {
411 const absolutePath = path.join(outputDir, fileName)
412 // The deletion of the file is necessary, so VSCode
413 // picks up the changes.
414 await fs.rm(absolutePath, { recursive: true, force: true })
415 if (typeof content === 'string') {
416 // file
417 await fs.writeFile(absolutePath, content)
418 } else {
419 // subdirectory
420 await fs.mkdir(absolutePath)
421 await writeFileMap(absolutePath, content)
422 }
423 }),
424 )
425}
426
427function isWasmEngineSupported(provider: ConnectorType) {
428 return (

Callers 1

generateClientFunction · 0.70

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected