MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / decodeBytes

Function decodeBytes

apps/local/src/db/v1-v2-migration.ts:323–329  ·  view source on GitHub ↗
(value: ArrayBuffer | ArrayBufferView)

Source from the content-addressed store, hash-verified

321const textDecoder = new TextDecoder();
322
323const decodeBytes = (value: ArrayBuffer | ArrayBufferView): string => {
324 const bytes =
325 value instanceof ArrayBuffer
326 ? new Uint8Array(value)
327 : new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
328 return textDecoder.decode(bytes);
329};
330
331const parseJson = (value: unknown): unknown => {
332 if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {

Callers 1

parseJsonFunction · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected