Skip to content

Commit 49edeb7

Browse files
committed
refactor
1 parent 4aa135d commit 49edeb7

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
@@ -59,71 +59,39 @@ export function* convertAttributes(
5959
yield convertAttribute(attr, parent, ctx);
6060
continue;
6161
}
62-
if (attr.type === "SpreadAttribute") {
62+
if (attr.type === "SpreadAttribute" || attr.type === "Spread") {
6363
yield convertSpreadAttribute(attr, parent, ctx);
6464
continue;
6565
}
66-
if (attr.type === "Spread") {
67-
yield convertSpreadAttribute(attr, parent, ctx);
68-
continue;
69-
}
70-
if (attr.type === "BindDirective") {
71-
yield convertBindingDirective(attr, parent, ctx);
72-
continue;
73-
}
74-
if (attr.type === "Binding") {
66+
if (attr.type === "BindDirective" || attr.type === "Binding") {
7567
yield convertBindingDirective(attr, parent, ctx);
7668
continue;
7769
}
78-
if (attr.type === "OnDirective") {
70+
if (attr.type === "OnDirective" || attr.type === "EventHandler") {
7971
yield convertEventHandlerDirective(attr, parent, ctx);
8072
continue;
8173
}
82-
if (attr.type === "EventHandler") {
83-
yield convertEventHandlerDirective(attr, parent, ctx);
84-
continue;
85-
}
86-
if (attr.type === "ClassDirective") {
87-
yield convertClassDirective(attr, parent, ctx);
88-
continue;
89-
}
90-
if (attr.type === "Class") {
74+
if (attr.type === "ClassDirective" || attr.type === "Class") {
9175
yield convertClassDirective(attr, parent, ctx);
9276
continue;
9377
}
9478
if (attr.type === "StyleDirective") {
9579
yield convertStyleDirective(attr, parent, ctx);
9680
continue;
9781
}
98-
if (attr.type === "TransitionDirective") {
82+
if (attr.type === "TransitionDirective" || attr.type === "Transition") {
9983
yield convertTransitionDirective(attr, parent, ctx);
10084
continue;
10185
}
102-
if (attr.type === "Transition") {
103-
yield convertTransitionDirective(attr, parent, ctx);
104-
continue;
105-
}
106-
if (attr.type === "AnimateDirective") {
107-
yield convertAnimationDirective(attr, parent, ctx);
108-
continue;
109-
}
110-
if (attr.type === "Animation") {
86+
if (attr.type === "AnimateDirective" || attr.type === "Animation") {
11187
yield convertAnimationDirective(attr, parent, ctx);
11288
continue;
11389
}
114-
if (attr.type === "UseDirective") {
90+
if (attr.type === "UseDirective" || attr.type === "Action") {
11591
yield convertActionDirective(attr, parent, ctx);
11692
continue;
11793
}
118-
if (attr.type === "Action") {
119-
yield convertActionDirective(attr, parent, ctx);
120-
continue;
121-
}
122-
if (attr.type === "LetDirective") {
123-
yield convertLetDirective(attr, parent, ctx);
124-
continue;
125-
}
126-
if (attr.type === "Let") {
94+
if (attr.type === "LetDirective" || attr.type === "Let") {
12795
yield convertLetDirective(attr, parent, ctx);
12896
continue;
12997
}

0 commit comments

Comments
 (0)