Skip to content

Commit

Permalink
chore: fix type check (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
luo3house authored May 11, 2023
1 parent d0ff070 commit dfab33f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-vant/src/components/utils/create/bem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function gen(name: string, mods?: Mods): string {
}

if (Array.isArray(mods)) {
return mods.reduce<string>((ret, item) => ret + gen(name, item), '')
return (mods as Mod[]).reduce<string>(
(ret, item) => ret + gen(name, item),
''
)
}
return Object.keys(mods).reduce(
(ret, key) => ret + (mods[key] ? gen(name, key) : ''),
Expand Down

0 comments on commit dfab33f

Please sign in to comment.