Function
decodeString
(
uint8: Uint8Array,
size: number,
pointer: { consumed: number },
)
Source from the content-addressed store, hash-verified
| 38 | } |
| 39 | |
| 40 | function decodeString( |
| 41 | uint8: Uint8Array, |
| 42 | size: number, |
| 43 | pointer: { consumed: number }, |
| 44 | ) { |
| 45 | pointer.consumed += size; |
| 46 | const u8 = uint8.subarray(pointer.consumed - size, pointer.consumed); |
| 47 | if (u8.length !== size) { |
| 48 | throw new EvalError( |
| 49 | "Messagepack decode reached end of array prematurely", |
| 50 | ); |
| 51 | } |
| 52 | return decoder.decode(u8); |
| 53 | } |
| 54 | |
| 55 | function decodeArray( |
| 56 | uint8: Uint8Array, |
Tested by
no test coverage detected