MCPcopy Create free account
hub / github.com/apache/maka / payloadShapeForHash

Function payloadShapeForHash

packages/runtime/src/request-shape.ts:655–663  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

653}
654
655function payloadShapeForHash(value: unknown): unknown {
656 const serialized = stableStringify(value);
657 return {
658 type: value === null ? 'null' : Array.isArray(value) ? 'array' : typeof value,
659 chars: serialized.length,
660 bytes: Buffer.byteLength(serialized, 'utf8'),
661 hash: stableHash(value),
662 };
663}
664
665function canonicalize(value: unknown, parentKey?: string): unknown {
666 if (value === null) return null;

Callers 1

contentShapeForHashFunction · 0.85

Calls 2

stableHashFunction · 0.85
stableStringifyFunction · 0.70

Tested by

no test coverage detected