Skip to content

Commit bd55bdc

Browse files
committed
refacor: Update parse function
1 parent bb00414 commit bd55bdc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FragmentMeta, isFragment } from './fragment';
2-
import { Template, Types } from './types';
2+
import { Template, TemplateObj, Types } from './types';
33

44
export interface ParseContext {
55
params: string[];
@@ -9,8 +9,8 @@ export interface ParseContext {
99
paramAlias: Record<string, string>,
1010
}
1111

12-
export const parse = (type: string, name: string | undefined, nodes: Template, ctx: ParseContext): string => {
13-
name = name || capitalize(Object.keys(nodes)[0] || type);
12+
export const parse = (type: string, name: string | undefined, nodes: TemplateObj, ctx: ParseContext): string => {
13+
name = name || capitalize(Object.keys(nodes)[0]);
1414

1515
const body = cycleParse(nodes, ctx, -2);
1616
const params = ctx.params.map((key) => {

0 commit comments

Comments
 (0)