Skip to content

Commit 8fe076f

Browse files
committed
Small improvements to the documentation comments (no code change)
1 parent 9045d01 commit 8fe076f

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MessagePack is an efficient binary serialisation format. It lets you exchange da
1414

1515
## Size
1616

17-
This library is very lightweight. The source code has around **510 lines** (incl. browser/Node detection), the minified file has 6.6 kB and can be GZip-compressed to **2.4 kB**.
17+
This library is very lightweight. The source code has around **560 lines** (incl. browser/Node detection), the minified file has 7.0 kB and can be GZip-compressed to **2.7 kB**.
1818

1919
## Performance
2020

@@ -57,7 +57,7 @@ If there should be a naming conflict with another library you want to load, you
5757
In Node.js, these functions are exported in the object you get from the `require` function.
5858

5959
```js
60-
var msgpack = require('@ygoe/msgpack');
60+
var msgpack = require("@ygoe/msgpack");
6161
```
6262

6363
### Example

msgpack.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
// Serializes a value to a MessagePack byte array.
55
//
66
// data: The value to serialize. This can be a scalar, array or object.
7-
// options: An object that defined additional options.
8-
// - multiple: Indicates whether multiple values in data are concatenated to multiple MessagePack arrays.
9-
// - invalidTypeReplacement: The value that is used to replace values of unsupported types, or a function that returns such a value, given the original value as parameter.
7+
// options: An object that defines additional options.
8+
// - multiple: (boolean) Indicates whether multiple values in data are concatenated to multiple MessagePack arrays. Default: false.
9+
// - invalidTypeReplacement:
10+
// (any) The value that is used to replace values of unsupported types.
11+
// (function) A function that returns such a value, given the original value as parameter.
1012
function serialize(data, options) {
1113
if (options && options.multiple && !Array.isArray(data)) {
1214
throw new Error("Invalid argument type: Expected an Array to serialize multiple values.");
@@ -267,8 +269,8 @@
267269
// Deserializes a MessagePack byte array to a value.
268270
//
269271
// array: The MessagePack byte array to deserialize. This must be an Array or Uint8Array containing bytes, not a string.
270-
// options: An object that defined additional options.
271-
// - multiple: Indicates whether multiple concatenated MessagePack arrays are returned as an array.
272+
// options: An object that defines additional options.
273+
// - multiple: (boolean) Indicates whether multiple concatenated MessagePack arrays are returned as an array. Default: false.
272274
function deserialize(array, options) {
273275
const pow32 = 0x100000000; // 2^32
274276
let pos = 0;

msgpack.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)