2019-08-25 09:39:20 +03:00
|
|
|
"use strict";
|
|
|
|
import { Coder } from "./abstract-coder";
|
|
|
|
export class NullCoder extends Coder {
|
|
|
|
constructor(localName) {
|
|
|
|
super("null", "", localName, false);
|
|
|
|
}
|
2020-11-23 11:43:28 +03:00
|
|
|
defaultValue() {
|
|
|
|
return null;
|
|
|
|
}
|
2019-08-25 09:39:20 +03:00
|
|
|
encode(writer, value) {
|
|
|
|
if (value != null) {
|
|
|
|
this._throwError("not null", value);
|
|
|
|
}
|
|
|
|
return writer.writeBytes([]);
|
|
|
|
}
|
|
|
|
decode(reader) {
|
|
|
|
reader.readBytes(0);
|
|
|
|
return reader.coerce(this.name, null);
|
|
|
|
}
|
|
|
|
}
|
2020-07-13 15:03:56 +03:00
|
|
|
//# sourceMappingURL=null.js.map
|