(outputDir: string, fileMap: FileMap)
| 234 | } |
| 235 | |
| 236 | function writeFileMap(outputDir: string, fileMap: FileMap) { |
| 237 | return Promise.all( |
| 238 | Object.entries(fileMap).map(async ([fileName, content]) => { |
| 239 | const absolutePath = path.join(outputDir, fileName) |
| 240 | // The deletion of the file is necessary, so VSCode |
| 241 | // picks up the changes. |
| 242 | await fs.rm(absolutePath, { recursive: true, force: true }) |
| 243 | if (typeof content === 'string' || Buffer.isBuffer(content)) { |
| 244 | // file |
| 245 | await fs.writeFile(absolutePath, content) |
| 246 | } else { |
| 247 | // subdirectory |
| 248 | await fs.mkdir(absolutePath) |
| 249 | await writeFileMap(absolutePath, content) |
| 250 | } |
| 251 | }), |
| 252 | ) |
| 253 | } |
| 254 | |
| 255 | function validateDmmfAgainstDenylists(prismaClientDmmf: DMMF.Document): Error[] | null { |
| 256 | const errorArray = [] as Error[] |
no test coverage detected