add TSTypeOperator (#1396)

master
Danny Arnold 2017-04-23 17:25:25 +02:00 committed by Christopher Chedeau
parent 95d505843e
commit 15df9abf81
4 changed files with 15 additions and 0 deletions

View File

@ -1974,6 +1974,11 @@ function genericPrintNoParens(path, options, print, args) {
") => ",
path.call(print, "typeAnnotation"),
])
case "TSTypeOperator":
return concat([
"keyof ",
path.call(print, "typeAnnotation")
])
// TODO
case "ClassHeritage":
// TODO

View File

@ -0,0 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`typeOperator.ts 1`] = `
let a: (keyof T)[] = ["a", "b"];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let a: (keyof T)[] = ["a", "b"];
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, { parser: "typescript" });

View File

@ -0,0 +1 @@
let a: (keyof T)[] = ["a", "b"];