Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Jan 30, 2023
1 parent 267299e commit 6a8817f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/babel-plugin-transform-typescript/src/enum.ts
@@ -1,7 +1,6 @@
import { template } from "@babel/core";
import { template, types } from "@babel/core";
import type { NodePath } from "@babel/traverse";
import type * as t from "@babel/types";
import { isIdentifier, isStringLiteral } from "@babel/types";
import assert from "assert";

type t = typeof t;
Expand Down Expand Up @@ -217,8 +216,10 @@ function evaluate(
const obj = expr.object;
const prop = expr.property;
if (
!isIdentifier(obj) ||
(expr.computed ? !isStringLiteral(prop) : !isIdentifier(prop))
!types.isIdentifier(obj) ||
(expr.computed
? !types.isStringLiteral(prop)
: !types.isIdentifier(prop))
) {
return;
}
Expand Down

0 comments on commit 6a8817f

Please sign in to comment.