deno.land / x / msgpack_javascript@v3.0.0-beta2 / test / readme.test.ts

readme.test.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
import { deepStrictEqual } from "assert";import { encode, decode } from "@msgpack/msgpack";
describe("README", () => { context("## Synopsis", () => { it("runs", () => { const object = { nil: null, integer: 1, float: Math.PI, string: "Hello, world!", binary: Uint8Array.from([1, 2, 3]), array: [10, 20, 30], map: { foo: "bar" }, timestampExt: new Date(), };
const encoded = encode(object); // encoded is an Uint8Array instance
deepStrictEqual(decode(encoded), object); }); });});
msgpack_javascript

Version Info

Tagged at
a year ago