@bjesuiter/serializr-helpers
Version:
Provides some helper functions and serialization PropertySchemas for mobxjs/serializr - library
30 lines (29 loc) • 1.15 kB
JavaScript
var MomentSerializationOptions = /** @class */ (function () {
function MomentSerializationOptions(builder) {
}
return MomentSerializationOptions;
}());
export { MomentSerializationOptions };
(function (MomentSerializationOptions) {
var Builder = /** @class */ (function () {
function Builder() {
}
/**
* If the moment value is undefined, which should have been serialized,
* this value will be returned. It must be a JSON compatible value.
* This means, it must be of one type of: string | boolean | number | object | [].
* If this is not set, this moment value will be skipped in serialization.
*
* Applies only to serialization.
* @param value
*/
Builder.prototype.useValueIfUndefined = function (value) {
this.valueIfUndefined = value;
};
Builder.prototype.build = function () {
return new MomentSerializationOptions(this);
};
return Builder;
}());
MomentSerializationOptions.Builder = Builder;
})(MomentSerializationOptions || (MomentSerializationOptions = {}));