Skip to content

Commit 3333a85

Browse files
committed
refactor
1 parent a8039cf commit 3333a85

File tree

1 file changed

+8
-40
lines changed

1 file changed

+8
-40
lines changed

src/parser/converts/attr.ts

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -60,71 +60,39 @@ export function* convertAttributes(
6060
yield convertAttribute(attr, parent, ctx);
6161
continue;
6262
}
63-
if (attr.type === "SpreadAttribute") {
63+
if (attr.type === "SpreadAttribute" || attr.type === "Spread") {
6464
yield convertSpreadAttribute(attr, parent, ctx);
6565
continue;
6666
}
67-
if (attr.type === "Spread") {
68-
yield convertSpreadAttribute(attr, parent, ctx);
69-
continue;
70-
}
71-
if (attr.type === "BindDirective") {
72-
yield convertBindingDirective(attr, parent, ctx);
73-
continue;
74-
}
75-
if (attr.type === "Binding") {
67+
if (attr.type === "BindDirective" || attr.type === "Binding") {
7668
yield convertBindingDirective(attr, parent, ctx);
7769
continue;
7870
}
79-
if (attr.type === "OnDirective") {
71+
if (attr.type === "OnDirective" || attr.type === "EventHandler") {
8072
yield convertEventHandlerDirective(attr, parent, ctx);
8173
continue;
8274
}
83-
if (attr.type === "EventHandler") {
84-
yield convertEventHandlerDirective(attr, parent, ctx);
85-
continue;
86-
}
87-
if (attr.type === "ClassDirective") {
88-
yield convertClassDirective(attr, parent, ctx);
89-
continue;
90-
}
91-
if (attr.type === "Class") {
75+
if (attr.type === "ClassDirective" || attr.type === "Class") {
9276
yield convertClassDirective(attr, parent, ctx);
9377
continue;
9478
}
9579
if (attr.type === "StyleDirective") {
9680
yield convertStyleDirective(attr, parent, ctx);
9781
continue;
9882
}
99-
if (attr.type === "TransitionDirective") {
83+
if (attr.type === "TransitionDirective" || attr.type === "Transition") {
10084
yield convertTransitionDirective(attr, parent, ctx);
10185
continue;
10286
}
103-
if (attr.type === "Transition") {
104-
yield convertTransitionDirective(attr, parent, ctx);
105-
continue;
106-
}
107-
if (attr.type === "AnimateDirective") {
108-
yield convertAnimationDirective(attr, parent, ctx);
109-
continue;
110-
}
111-
if (attr.type === "Animation") {
87+
if (attr.type === "AnimateDirective" || attr.type === "Animation") {
11288
yield convertAnimationDirective(attr, parent, ctx);
11389
continue;
11490
}
115-
if (attr.type === "UseDirective") {
91+
if (attr.type === "UseDirective" || attr.type === "Action") {
11692
yield convertActionDirective(attr, parent, ctx);
11793
continue;
11894
}
119-
if (attr.type === "Action") {
120-
yield convertActionDirective(attr, parent, ctx);
121-
continue;
122-
}
123-
if (attr.type === "LetDirective") {
124-
yield convertLetDirective(attr, parent, ctx);
125-
continue;
126-
}
127-
if (attr.type === "Let") {
95+
if (attr.type === "LetDirective" || attr.type === "Let") {
12896
yield convertLetDirective(attr, parent, ctx);
12997
continue;
13098
}

0 commit comments

Comments
 (0)