MCPcopy
hub / github.com/desktop/desktop / getBlobImage

Function getBlobImage

app/src/lib/git/diff.ts:870–883  ·  view source on GitHub ↗
(
  repository: Repository,
  path: string,
  commitish: string
)

Source from the content-addressed store, hash-verified

868 * https://en.wikipedia.org/wiki/Data_URI_scheme
869 */
870export 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 *

Callers 2

diff-test.tsFile · 0.90
getImageDiffFunction · 0.85

Calls 3

getBlobContentsFunction · 0.90
getMediaTypeFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected