From dfab33f10a1e916c92c71aedfa569e32aa94a124 Mon Sep 17 00:00:00 2001 From: luo3house <96865086+luo3house@users.noreply.github.com> Date: Thu, 11 May 2023 23:25:53 +0800 Subject: [PATCH] chore: fix type check (#644) --- packages/react-vant/src/components/utils/create/bem.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-vant/src/components/utils/create/bem.ts b/packages/react-vant/src/components/utils/create/bem.ts index 26c871487..abc8d6515 100644 --- a/packages/react-vant/src/components/utils/create/bem.ts +++ b/packages/react-vant/src/components/utils/create/bem.ts @@ -22,7 +22,10 @@ function gen(name: string, mods?: Mods): string { } if (Array.isArray(mods)) { - return mods.reduce((ret, item) => ret + gen(name, item), '') + return (mods as Mod[]).reduce( + (ret, item) => ret + gen(name, item), + '' + ) } return Object.keys(mods).reduce( (ret, key) => ret + (mods[key] ? gen(name, key) : ''),