415gotit
This commit is contained in:
26
node_modules/@msgpack/msgpack/dist.esm/decode.mjs
generated
vendored
Normal file
26
node_modules/@msgpack/msgpack/dist.esm/decode.mjs
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Decoder } from "./Decoder.mjs";
|
||||
/**
|
||||
* It decodes a single MessagePack object in a buffer.
|
||||
*
|
||||
* This is a synchronous decoding function.
|
||||
* See other variants for asynchronous decoding: {@link decodeAsync}, {@link decodeMultiStream}, or {@link decodeArrayStream}.
|
||||
*
|
||||
* @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.
|
||||
* @throws {@link DecodeError} if the buffer contains invalid data.
|
||||
*/
|
||||
export function decode(buffer, options) {
|
||||
const decoder = new Decoder(options);
|
||||
return decoder.decode(buffer);
|
||||
}
|
||||
/**
|
||||
* It decodes multiple MessagePack objects in a buffer.
|
||||
* This is corresponding to {@link decodeMultiStream}.
|
||||
*
|
||||
* @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.
|
||||
* @throws {@link DecodeError} if the buffer contains invalid data.
|
||||
*/
|
||||
export function decodeMulti(buffer, options) {
|
||||
const decoder = new Decoder(options);
|
||||
return decoder.decodeMulti(buffer);
|
||||
}
|
||||
//# sourceMappingURL=decode.mjs.map
|
||||
Reference in New Issue
Block a user