Skip to content

Commit a954541

Browse files
committed
chore: update
1 parent 066532d commit a954541

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/babel-plugin-jsx/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ export default declare<VueJSXPluginOptions, BabelCore.PluginObj<State>>(
120120
});
121121
}
122122

123-
const vueImportMap: Record<
124-
string,
125-
(t.MemberExpression | t.Identifier)[]
126-
> = {};
123+
const vueImportMap: Record<string, t.Identifier[]> = {};
127124
state.set('vueImportMap', vueImportMap);
128125
path.node.body.forEach((statement) => {
129126
if (t.isImportDeclaration(statement)) {

packages/babel-plugin-jsx/src/utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ export const shouldTransformedToSlots = (tag: string, state?: State) => {
3838
if (state) {
3939
const vueImportMap = state.get('vueImportMap');
4040
for (const name of [FRAGMENT, KEEP_ALIVE]) {
41-
if (vueImportMap[name]) {
42-
if (vueImportMap[name].some((id: t.Identifier) => id.name === tag)) {
43-
return false;
44-
}
41+
if (
42+
vueImportMap[name] &&
43+
vueImportMap[name].some((id: t.Identifier) => id.name === tag)
44+
) {
45+
return false;
4546
}
4647
}
4748
}

0 commit comments

Comments
 (0)