Function
hashObject
({
type,
object,
format = 'content',
oid = undefined,
})
Source from the content-addressed store, hash-verified
| 2 | import { shasum } from '../utils/shasum.js' |
| 3 | |
| 4 | export 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
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…