feat: complete 2.0.7.12 platform overhaul
This commit is contained in:
@@ -24,12 +24,12 @@ export const defaultBranding: Branding = {
|
||||
feedbackEmail: "support@ymhut.cn",
|
||||
};
|
||||
|
||||
function valueOf(source: any, key: keyof Branding) {
|
||||
const value = source?.[key];
|
||||
function valueOf(source: unknown, key: keyof Branding) {
|
||||
const value = source && typeof source === "object" ? (source as Record<string, unknown>)[key] : undefined;
|
||||
return typeof value === "string" && value.trim() ? value.trim() : "";
|
||||
}
|
||||
|
||||
export function normalizeBranding(source: any): Branding {
|
||||
export function normalizeBranding(source: unknown): Branding {
|
||||
const siteName = valueOf(source, "siteName") || defaultBranding.siteName;
|
||||
const siteIconUrl = valueOf(source, "siteIconUrl") || defaultBranding.siteIconUrl;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user