MCPcopy Create free account
hub / github.com/denoland/std / decode

Function decode

msgpack/decode.ts:24–38  ·  view source on GitHub ↗
(data: Uint8Array)

Source from the content-addressed store, hash-verified

22 * @returns Decoded value from the MessagePack binary data.
23 */
24export function decode(data: Uint8Array): ValueType {
25 const pointer = { consumed: 0 };
26 const dataView = new DataView(
27 data.buffer,
28 data.byteOffset,
29 data.byteLength,
30 );
31 const value = decodeSlice(data, dataView, pointer);
32
33 if (pointer.consumed < data.length) {
34 throw new EvalError("Messagepack decode did not consume whole array");
35 }
36
37 return value;
38}
39
40function decodeString(
41 uint8: Uint8Array,

Callers 2

decode_test.tsFile · 0.90
encode_test.tsFile · 0.90

Calls 1

decodeSliceFunction · 0.85

Tested by

no test coverage detected