415gotit
This commit is contained in:
27
node_modules/msgpack-lite/lib/decode-buffer.js
generated
vendored
Normal file
27
node_modules/msgpack-lite/lib/decode-buffer.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// decode-buffer.js
|
||||
|
||||
exports.DecodeBuffer = DecodeBuffer;
|
||||
|
||||
var preset = require("./read-core").preset;
|
||||
|
||||
var FlexDecoder = require("./flex-buffer").FlexDecoder;
|
||||
|
||||
FlexDecoder.mixin(DecodeBuffer.prototype);
|
||||
|
||||
function DecodeBuffer(options) {
|
||||
if (!(this instanceof DecodeBuffer)) return new DecodeBuffer(options);
|
||||
|
||||
if (options) {
|
||||
this.options = options;
|
||||
if (options.codec) {
|
||||
var codec = this.codec = options.codec;
|
||||
if (codec.bufferish) this.bufferish = codec.bufferish;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DecodeBuffer.prototype.codec = preset;
|
||||
|
||||
DecodeBuffer.prototype.fetch = function() {
|
||||
return this.codec.decode(this);
|
||||
};
|
||||
Reference in New Issue
Block a user