muschema
Version:
Schemas for mudb
33 lines • 1.24 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var _number_1 = require("./_number");
var MuInt16 = (function (_super) {
__extends(MuInt16, _super);
function MuInt16(value) {
return _super.call(this, (value || 0) << 16 >> 16, 'int16') || this;
}
MuInt16.prototype.diff = function (base, target, stream) {
if ((base << 16 >> 16) !== (target << 16 >> 16)) {
stream.grow(2);
stream.writeInt16(target);
return true;
}
return false;
};
MuInt16.prototype.patch = function (base, stream) {
return stream.readInt16();
};
return MuInt16;
}(_number_1.MuNumber));
exports.MuInt16 = MuInt16;
//# sourceMappingURL=int16.js.map