Skip to content

Commit

Permalink
fix typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 10, 2022
1 parent 25fa840 commit 2eca5ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/babel-traverse/src/path/inference/index.ts
Expand Up @@ -28,7 +28,7 @@ import type * as t from "@babel/types";
* Infer the type of the current `NodePath`.
*/

export function getTypeAnnotation(this: NodePath): t.FlowType {
export function getTypeAnnotation(this: NodePath): t.FlowType | t.TSType {
let type = this.getData("typeAnnotation");
if (type != null) {
return type;
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-traverse/src/path/inference/inferers.ts
Expand Up @@ -42,7 +42,7 @@ export function TSAsExpression(node) {

TSAsExpression.validParent = true;

export function TSNonNullExpression() {
export function TSNonNullExpression(this: NodePath<t.TSNonNullExpression>) {
return this.get("expression").getTypeAnnotation();
}

Expand Down

0 comments on commit 2eca5ca

Please sign in to comment.