Skip to content

Commit

Permalink
Change msgpack library (#14)
Browse files Browse the repository at this point in the history
* change to @msgpack/msgpack

* 2.0.0

* fix return type
  • Loading branch information
yehiyam committed May 17, 2022
1 parent cb8eec6 commit 3a3548f
Show file tree
Hide file tree
Showing 3 changed files with 4,783 additions and 33 deletions.
7 changes: 4 additions & 3 deletions lib/msgpack.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const msgpack = require('msgpack');
const msgpack = require('@msgpack/msgpack');

const msgpackEncode = (...args) => {
return msgpack.pack(...args);
const encoded = msgpack.encode(...args);
return Buffer.from(encoded.buffer, encoded.byteOffset, encoded.byteLength);
};

const msgpackDecode = (...args) => {
return msgpack.unpack(...args);
return msgpack.decode(...args);
};

module.exports = {
Expand Down

0 comments on commit 3a3548f

Please sign in to comment.