From 6a8817f52005c30e3355a47321048ef33448c8ba Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Mon, 30 Jan 2023 20:29:00 +0800 Subject: [PATCH] fix imports --- packages/babel-plugin-transform-typescript/src/enum.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/babel-plugin-transform-typescript/src/enum.ts b/packages/babel-plugin-transform-typescript/src/enum.ts index 88e622bd638e..11de316ab90f 100644 --- a/packages/babel-plugin-transform-typescript/src/enum.ts +++ b/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; @@ -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; }