From fe84100e27441677339c4ba1cd73536ec718bdd9 Mon Sep 17 00:00:00 2001 From: "FUJI Goro (gfx)" Date: Thu, 30 May 2019 22:13:47 +0900 Subject: [PATCH 1/2] releng for v1.3.0 --- CHANGELOG.md | 8 ++++++++ README.md | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cc27f85..19c565f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ This is the revision history of @msgpack/msgpack +## v1.3.0 2019/05/29 + +https://github.com/msgpack/msgpack-javascript/compare/v1.2.3...v1.3.0 + +* Add `decodeArrayStream()` to decode an array and returns `AsyncIterable` [#42](https://github.com/msgpack/msgpack-javascript/pull/42) +* Add `decodeStream()` to decode an unlimited data stream [#46](https://github.com/msgpack/msgpack-javascript/pull/46) +* Let `decodeAsync()` and `decodeArrayStream()` to take `ReadalbeStream>` (whatwg-streams) [#43](https://github.com/msgpack/msgpack-javascript/pull/46) + ## v1.2.3 2019/05/29 https://github.com/msgpack/msgpack-javascript/compare/v1.2.2...v1.2.3 diff --git a/README.md b/README.md index 99236ec9..725f8354 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,24 @@ maxExtLength | number | `4_294_967_295` (UINT32_MAX) You can use `max${Type}Length` to limit the length of each type decoded. -### `decodeAsync(stream: AsyncIterable | Uint8Array>, options?: DecodeAsyncOptions): Promise` +### `decodeAsync(stream: AsyncIterable> | ReadableStream>, options?: DecodeAsyncOptions): Promise` It decodes `stream` in an async iterable of byte arrays and returns decoded data as `uknown` wrapped in `Promise`. This function works asyncronously. Note that `decodeAsync()` acceps the same options as `decode()`. +### `decodeArrayStream(stream: AsyncIterable> | ReadableStream>, options?: DecodeAsyncOptions): AsyncIterable` + +It is alike to `decodeAsync()`, but only accepts an array of items as `stream`, and emits the decoded item one-by-one. + +It throws errors when the input is not an array. + +### `decodeStream(stream: AsyncIterable> | ReadableStream>, options?: DecodeAsyncOptions): AsyncIterable` + +It is like to `decodeAsync()` and `decodeArrayStream()`, but the input consists of independent MessagePack items. + +In other words, it decodes an unlimited stream and emits an item one-by-one. + ### Extension Types To handle [MessagePack Extension Types](https://github.com/msgpack/msgpack/blob/master/spec.md#extension-types), this library provides `ExtensionCodec` class. From 20ed98990e2e7038c0f019be78ebcc8c118a8424 Mon Sep 17 00:00:00 2001 From: "FUJI Goro (gfx)" Date: Thu, 30 May 2019 22:50:22 +0900 Subject: [PATCH 2/2] fix docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 725f8354..a0910fef 100644 --- a/README.md +++ b/README.md @@ -71,15 +71,15 @@ Note that `decodeAsync()` acceps the same options as `decode()`. ### `decodeArrayStream(stream: AsyncIterable> | ReadableStream>, options?: DecodeAsyncOptions): AsyncIterable` -It is alike to `decodeAsync()`, but only accepts an array of items as `stream`, and emits the decoded item one-by-one. +It is alike to `decodeAsync()`, but only accepts an array of items as the input `stream`, and emits the decoded item one by one. It throws errors when the input is not an array. ### `decodeStream(stream: AsyncIterable> | ReadableStream>, options?: DecodeAsyncOptions): AsyncIterable` -It is like to `decodeAsync()` and `decodeArrayStream()`, but the input consists of independent MessagePack items. +It is like to `decodeAsync()` and `decodeArrayStream()`, but the input `stream` consists of independent MessagePack items. -In other words, it decodes an unlimited stream and emits an item one-by-one. +In other words, it decodes an unlimited stream and emits an item one by one. ### Extension Types