Refactor utils.jsx
This commit is contained in:
parent
caff2ce258
commit
66bd370f34
@ -136,11 +136,11 @@ export const sanitizeConfig = (config) => {
|
||||
|
||||
return {
|
||||
github: {
|
||||
username: config.github.username,
|
||||
sortBy: config.github.sortBy || 'stars',
|
||||
limit: config.github.limit || 8,
|
||||
username: config?.github?.username || '',
|
||||
sortBy: config?.github?.sortBy || 'stars',
|
||||
limit: config?.github?.limit || 8,
|
||||
exclude: {
|
||||
forks: config?.github?.exclude?.forks,
|
||||
forks: config?.github?.exclude?.forks || false,
|
||||
projects: config?.github?.exclude?.projects || [],
|
||||
},
|
||||
},
|
||||
@ -174,8 +174,9 @@ export const sanitizeConfig = (config) => {
|
||||
},
|
||||
themeConfig: {
|
||||
defaultTheme: config?.themeConfig?.defaultTheme || themes[0],
|
||||
disableSwitch: config?.themeConfig?.disableSwitch,
|
||||
respectPrefersColorScheme: config?.themeConfig?.respectPrefersColorScheme,
|
||||
disableSwitch: config?.themeConfig?.disableSwitch || false,
|
||||
respectPrefersColorScheme:
|
||||
config?.themeConfig?.respectPrefersColorScheme || false,
|
||||
themes: themes,
|
||||
customTheme: customTheme,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user