forked from msgpack/msgpack-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencode.js
More file actions
20 lines (20 loc) · 711 Bytes
/
Copy pathencode.js
File metadata and controls
20 lines (20 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultEncodeOptions = void 0;
exports.encode = encode;
const Encoder_1 = require("./Encoder");
/**
* @deprecated No longer supported.
*/
exports.defaultEncodeOptions = undefined;
/**
* It encodes `value` in the MessagePack format and
* returns a byte buffer.
*
* The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`.
*/
function encode(value, options) {
const encoder = new Encoder_1.Encoder(options);
return encoder.encodeSharedRef(value);
}
//# sourceMappingURL=encode.js.map