This commit is contained in:
2025-05-19 20:36:21 -05:00
commit f5303487be
1865 changed files with 260387 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { toUtf8Bytes, toUtf8String } from "../../utils/utf8.js";
import { Typed } from "../typed.js";
import { DynamicBytesCoder } from "./bytes.js";
/**
* @_ignore
*/
export class StringCoder extends DynamicBytesCoder {
constructor(localName) {
super("string", localName);
}
defaultValue() {
return "";
}
encode(writer, _value) {
return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string")));
}
decode(reader) {
return toUtf8String(super.decode(reader));
}
}
//# sourceMappingURL=string.js.map