MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / hashObject

Function hashObject

src/storage/hashObject.js:4–17  ·  view source on GitHub ↗
({
  type,
  object,
  format = 'content',
  oid = undefined,
})

Source from the content-addressed store, hash-verified

2import { shasum } from '../utils/shasum.js'
3
4export async function hashObject({
5 type,
6 object,
7 format = 'content',
8 oid = undefined,
9}) {
10 if (format !== 'deflated') {
11 if (format !== 'wrapped') {
12 object = GitObject.wrap({ type, object })
13 }
14 oid = await shasum(object)
15 }
16 return { oid, object }
17}

Callers

nothing calls this directly

Calls 2

shasumFunction · 0.90
wrapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…