(files: PermissionFileMetadata[])
| 194 | } |
| 195 | |
| 196 | async function diffContentForFiles(files: PermissionFileMetadata[]) { |
| 197 | const content = await Promise.all( |
| 198 | files.map(async (file) => { |
| 199 | if (!file.patch) return [] |
| 200 | const content = await diffContentForPatch(file.filePath, file.patch, file.movePath) |
| 201 | return content ? [content] : [] |
| 202 | }), |
| 203 | ) |
| 204 | return content.flat() |
| 205 | } |
| 206 | |
| 207 | async function diffContentForPatch(filepath: string, diff: string, displayPath = filepath) { |
| 208 | const content = (await exists(filepath)) ? await readText(filepath) : "" |
no test coverage detected