[优化] 同步上游更新 (@821938089)

This commit is contained in:
HapeLee
2025-12-20 03:33:17 +08:00
parent 9e8ab55e02
commit 060ec9ce1a
44 changed files with 373 additions and 205 deletions
+16 -1
View File
@@ -49,12 +49,27 @@ export const convertSourcesToMap = (sources: Source[]): Map<string, Source> => {
return map
}
export const normalizeSource = (source: any) => {
for (const key in source) {
const value = source[key]
if (
value === '' ||
value === null ||
(typeof value === 'string' && !value.trim())
) {
delete source[key]
} else if (value instanceof Object) {
normalizeSource(value)
}
}
}
export const emptyBookSource = {
ruleSearch: {},
ruleBookInfo: {},
ruleToc: {},
ruleContent: {},
ruleReview: {},
//ruleReview: {},
ruleExplore: {},
} as BookSoure
export const emptyRssSource = {} as RssSource