415gotit
This commit is contained in:
30
node_modules/@msgpack/msgpack/dist.esm/decodeAsync.mjs
generated
vendored
Normal file
30
node_modules/@msgpack/msgpack/dist.esm/decodeAsync.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Decoder } from "./Decoder.mjs";
|
||||
import { ensureAsyncIterable } from "./utils/stream.mjs";
|
||||
/**
|
||||
* @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 async function decodeAsync(streamLike, options) {
|
||||
const stream = ensureAsyncIterable(streamLike);
|
||||
const decoder = new Decoder(options);
|
||||
return decoder.decodeAsync(stream);
|
||||
}
|
||||
/**
|
||||
* @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 decodeArrayStream(streamLike, options) {
|
||||
const stream = ensureAsyncIterable(streamLike);
|
||||
const decoder = new Decoder(options);
|
||||
return decoder.decodeArrayStream(stream);
|
||||
}
|
||||
/**
|
||||
* @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 decodeMultiStream(streamLike, options) {
|
||||
const stream = ensureAsyncIterable(streamLike);
|
||||
const decoder = new Decoder(options);
|
||||
return decoder.decodeStream(stream);
|
||||
}
|
||||
//# sourceMappingURL=decodeAsync.mjs.map
|
||||
Reference in New Issue
Block a user