Namer applied to Typescript generator (#7488)

* Namer applied to Typescript generator

* fixes

* More fixes

Co-authored-by: Casper Neo <cneo@google.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
Casper
2022-08-29 19:44:35 -04:00
committed by GitHub
parent ce382d6dd3
commit bf5d23230a
2 changed files with 174 additions and 204 deletions

View File

@@ -33,6 +33,9 @@ class IdlNamer : public Namer {
std::string Type(const EnumDef &d) const { return Type(d.name); }
std::string Function(const Definition &s) const { return Function(s.name); }
std::string Function(const std::string& prefix, const Definition &s) const {
return Function(prefix + s.name);
}
std::string Field(const FieldDef &s) const { return Field(s.name); }
std::string Field(const FieldDef &d, const std::string &s) const {
@@ -131,6 +134,12 @@ class IdlNamer : public Namer {
suffix;
}
// This is a mix of snake case and keep casing, when Ts should be using
// lower camel case.
std::string LegacyTsMutateMethod(const FieldDef& d) {
return "mutate_" + d.name;
}
private:
std::string NamespacedString(const struct Namespace *ns,
const std::string &str) const {