( repository: Repository, path: string, commitish: string )
| 868 | * https://en.wikipedia.org/wiki/Data_URI_scheme |
| 869 | */ |
| 870 | export async function getBlobImage( |
| 871 | repository: Repository, |
| 872 | path: string, |
| 873 | commitish: string |
| 874 | ): Promise<Image> { |
| 875 | const extension = Path.extname(path) |
| 876 | const contents = await getBlobContents(repository, commitish, path) |
| 877 | return new Image( |
| 878 | contents.buffer, |
| 879 | contents.toString('base64'), |
| 880 | getMediaType(extension), |
| 881 | contents.length |
| 882 | ) |
| 883 | } |
| 884 | /** |
| 885 | * Retrieve the binary contents of a blob from the working directory |
| 886 | * |
no test coverage detected