Skip to content

Commit

Permalink
fix: handle case when there is no themeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 1, 2021
1 parent bdc6cab commit 034c737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shared/shared.ts
Expand Up @@ -37,10 +37,10 @@ function resolveLocales<T>(
}

export function createLangDictionary(siteData: {
themeConfig?: any
themeConfig?: Record<string, any>
locales?: Record<string, LocaleConfig>
}) {
const { locales } = siteData.themeConfig
const { locales } = siteData.themeConfig || {}
const siteLocales = siteData.locales
return locales && siteLocales
? Object.keys(locales).reduce((langs, path) => {
Expand Down

0 comments on commit 034c737

Please sign in to comment.