deno.land / x / msgpack_javascript@v3.0.0-beta2 / src / decode.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Decoder } from "./Decoder";import type { DecoderOptions } from "./Decoder";import type { SplitUndefined } from "./context";
/** * @deprecated Use {@link DecoderOptions} instead. */export type DecodeOptions = never;
/** * @deprecated No longer supported. */export const defaultDecodeOptions: never = undefined as never;
/** * It decodes a single MessagePack object in a buffer. * * This is a synchronous decoding function. * See other variants for asynchronous decoding: {@link decodeAsync()}, {@link decodeStream()}, 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<ContextType = undefined>( buffer: ArrayLike<number> | BufferSource, options?: DecoderOptions<SplitUndefined<ContextType>>,): unknown { 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<ContextType = undefined>( buffer: ArrayLike<number> | BufferSource, options?: DecoderOptions<SplitUndefined<ContextType>>,): Generator<unknown, void, unknown> { const decoder = new Decoder(options); return decoder.decodeMulti(buffer);}
msgpack_javascript

Version Info

Tagged at
a year ago