Update printer.ts to support kind = 'get'/'set' on TSMethodSignature
`TSMethodSignature` has a `kind` property which can be set to `method` (the default), `get`, and `set`. When `get` and `set`, the method is a getter or a setter, and as such, should be prefixed with either `get ` or `set `.
This commit is contained in:
parent
7f441d2c74
commit
f0f50943d8
1 changed files with 6 additions and 0 deletions
|
|
@ -2335,6 +2335,12 @@ function genericPrintNoParens(path: any, options: any, print: any) {
|
|||
return concat(parts);
|
||||
|
||||
case "TSMethodSignature":
|
||||
if (n.kind === 'get') {
|
||||
parts.push('get ')
|
||||
} else if (n.kind === 'set') {
|
||||
parts.push('set ')
|
||||
}
|
||||
|
||||
if (n.computed) {
|
||||
parts.push("[", path.call(print, "key"), "]");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue