Skip to content

Commit

Permalink
#57
Browse files Browse the repository at this point in the history
- honor reserved names
  • Loading branch information
timostamm committed Jan 30, 2021
1 parent 63c82d0 commit fb86982
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/plugin/src/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,14 @@ export class Interpreter {

private static createTypescriptNameForMethod(descriptor: MethodDescriptorProto): string {
let escapeCharacter = '$';
let reservedClassProperties = ["__proto__", "toString", "name", "constructor", "methods", "typeName", "options", "_transport"];
let reservedClassProperties = [
// js built in
"__proto__", "toString", "name", "constructor",
// generic clients
"methods", "typeName", "options", "_transport",
// @grpc/grpc-js clients
"close", "getChannel", "waitForReady", "makeUnaryRequest", "makeClientStreamRequest", "makeServerStreamRequest", "makeBidiStreamRequest"
];
let name = descriptor.name;
assert(name !== undefined);
name = rt.lowerCamelCase(name);
Expand Down

0 comments on commit fb86982

Please sign in to comment.