This commit is contained in:
dela
2026-02-21 18:27:49 +08:00
parent 0ac4b23f07
commit 5dc86ccfbf
270 changed files with 49508 additions and 4636 deletions

26
node_modules/msgpack-lite/lib/encoder.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
// encoder.js
exports.Encoder = Encoder;
var EventLite = require("event-lite");
var EncodeBuffer = require("./encode-buffer").EncodeBuffer;
function Encoder(options) {
if (!(this instanceof Encoder)) return new Encoder(options);
EncodeBuffer.call(this, options);
}
Encoder.prototype = new EncodeBuffer();
EventLite.mixin(Encoder.prototype);
Encoder.prototype.encode = function(chunk) {
this.write(chunk);
this.emit("data", this.read());
};
Encoder.prototype.end = function(chunk) {
if (arguments.length) this.encode(chunk);
this.flush();
this.emit("end");
};