Browse Source

type: remove useless assertion (#41385)

pull/41391/head
lijianan 2 years ago
committed by GitHub
parent
commit
af5f9950f7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .dumi/hooks/useLocale.ts

4
.dumi/hooks/useLocale.ts

@ -9,6 +9,6 @@ export default function useLocale<Key extends string>(
localeMap?: LocaleMap<Key>,
): [Record<Key, string>, 'cn' | 'en'] {
const { id } = useDumiLocale();
const localeType = id === 'zh-CN' ? 'cn' : ('en' as const);
return [localeMap?.[localeType]!, localeType];
const localeType = id === 'zh-CN' ? 'cn' : 'en';
return [localeMap?.[localeType], localeType];
}

Loading…
Cancel
Save