This commit is contained in:
2025-05-19 20:36:21 -05:00
commit f5303487be
1865 changed files with 260387 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { Coder } from "./abstract-coder.js";
import type { Reader, Writer } from "./abstract-coder.js";
const Empty = new Uint8Array([ ]);
/**
* @_ignore
*/
export class NullCoder extends Coder {
constructor(localName: string) {
super("null", "", localName, false);
}
defaultValue(): null {
return null;
}
encode(writer: Writer, value: any): number {
if (value != null) { this._throwError("not null", value); }
return writer.writeBytes(Empty);
}
decode(reader: Reader): any {
reader.readBytes(0);
return null;
}
}