muschema
Version:
Schemas for mudb
33 lines • 1.23 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 MuFloat32 = (function (_super) {
__extends(MuFloat32, _super);
function MuFloat32(value) {
return _super.call(this, +(value || 0), 'float32') || this;
}
MuFloat32.prototype.diff = function (base, target, stream) {
if (base !== target) {
stream.grow(4);
stream.writeFloat32(target);
return true;
}
return false;
};
MuFloat32.prototype.patch = function (base, stream) {
return stream.readFloat32();
};
return MuFloat32;
}(_number_1.MuNumber));
exports.MuFloat32 = MuFloat32;
//# sourceMappingURL=float32.js.map