( repository: Repository, file: FileChange )
| 891 | * https://en.wikipedia.org/wiki/Data_URI_scheme |
| 892 | */ |
| 893 | export async function getWorkingDirectoryImage( |
| 894 | repository: Repository, |
| 895 | file: FileChange |
| 896 | ): Promise<Image> { |
| 897 | const contents = await readFile(Path.join(repository.path, file.path)) |
| 898 | return new Image( |
| 899 | contents.buffer, |
| 900 | contents.toString('base64'), |
| 901 | getMediaType(Path.extname(file.path)), |
| 902 | contents.length |
| 903 | ) |
| 904 | } |
| 905 | |
| 906 | /** |
| 907 | * List the modified binary files' paths in the given repository |
no test coverage detected