Skip to content

Commit

Permalink
Update to ast-types 0.8.18
Browse files Browse the repository at this point in the history
... to include `TypeParameter` information (d5ce0400511bdf6b063c13728c4fa09edd9e122d). See also flow/flow-codemod#6 (comment) .
  • Loading branch information
fkling committed Jul 20, 2016
1 parent 2ad8a66 commit 718e769
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,28 @@ function genericPrintNoParens(path, options, print) {
fromString(", ").join(path.map(print, "params")),
">"
]);
case "TypeParameter":
switch (n.variance) {
case 'plus':
parts.push('+');
break;
case 'minus':
parts.push('-');
break;
default:
}

parts.push(path.call(print, 'name'));

if (n.bound) {
parts.push(path.call(print, 'bound'));
}

if (n['default']) {
parts.push('=', path.call(print, 'default'));
}

return concat(parts);

case "TypeofTypeAnnotation":
return concat([
Expand All @@ -1449,6 +1471,7 @@ function genericPrintNoParens(path, options, print) {
case "LetExpression": // TODO
case "GraphExpression": // TODO
case "GraphIndexExpression": // TODO
case "NullTypeAnnotation":

// XML types that nobody cares about or needs to print.
case "XMLDefaultDeclaration":
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"fs": false
},
"dependencies": {
"ast-types": "0.8.17",
"ast-types": "0.8.18",
"esprima": "~2.7.1",
"private": "~0.1.5",
"source-map": "~0.5.0"
Expand Down

0 comments on commit 718e769

Please sign in to comment.