Skip to content

Commit 7ebb88d

Browse files
fix: don't use anything from "@babel/types" in runtime (#2132)
1 parent 5ae8363 commit 7ebb88d

File tree

1 file changed

+3
-4
lines changed
  • packages/babel-plugin-extract-messages/src

1 file changed

+3
-4
lines changed

packages/babel-plugin-extract-messages/src/index.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import type * as BabelTypesNamespace from "@babel/types"
2-
import {
2+
import type {
33
Expression,
44
Identifier,
55
Node,
66
ObjectExpression,
77
ObjectProperty,
8-
isObjectExpression,
98
} from "@babel/types"
109
import type { PluginObj, PluginPass, NodePath } from "@babel/core"
1110
import type { Hub } from "@babel/traverse"
@@ -161,7 +160,7 @@ function extractFromObjectExpression(
161160
;(exp.properties as ObjectProperty[]).forEach(({ key, value }, i) => {
162161
const name = (key as Identifier).name
163162

164-
if (name === "values" && isObjectExpression(value)) {
163+
if (name === "values" && t.isObjectExpression(value)) {
165164
props.placeholders = valuesObjectExpressionToPlaceholdersRecord(
166165
t,
167166
value,
@@ -274,7 +273,7 @@ export default function ({ types: t }: { types: BabelTypes }): PluginObj {
274273
if (
275274
key === "values" &&
276275
t.isJSXExpressionContainer(item.value) &&
277-
isObjectExpression(item.value.expression)
276+
t.isObjectExpression(item.value.expression)
278277
) {
279278
acc.placeholders = valuesObjectExpressionToPlaceholdersRecord(
280279
t,

0 commit comments

Comments
 (0)