MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / hashObject

Function hashObject

packages/@contentlayer/utils/src/hash.ts:6–11  ·  view source on GitHub ↗
(obj: JsonValue | any)

Source from the content-addressed store, hash-verified

4import { T, Tagged } from './effect/index.js'
5
6export const hashObject = (obj: JsonValue | any): T.Effect<unknown, HashError, string> => {
7 return T.tryCatchPromise(
8 () => xxhash64(stringifyIfNeeded(obj)),
9 (error) => new HashError({ error }),
10 )
11}
12
13export class HashError extends Tagged('HashError')<{
14 readonly error: unknown

Callers 1

makeCacheItemFunction · 0.90

Calls 1

stringifyIfNeededFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…