MCPcopy Create free account
hub / github.com/chavyleung/scripts / getUserCfgs

Function getUserCfgs

box/chavy.boxjs.js:580–600  ·  view source on GitHub ↗

* 获取用户配置

()

Source from the content-addressed store, hash-verified

578 * 获取用户配置
579 */
580function getUserCfgs() {
581 const defcfgs = {
582 gist_cache_key: [],
583
584 favapps: [],
585 appsubs: [],
586 viewkeys: [],
587 isPinedSearchBar: true,
588 httpapi: 'examplekey@127.0.0.1:6166',
589 http_backend: ''
590 }
591 const usercfgs = Object.assign(defcfgs, $.getjson($.KEY_usercfgs, {}))
592
593 // 处理异常数据:删除所有为 null 的订阅
594 if (usercfgs.appsubs.includes(null)) {
595 usercfgs.appsubs = usercfgs.appsubs.filter((sub) => sub)
596 $.setjson(usercfgs, $.KEY_usercfgs)
597 }
598
599 return usercfgs
600}
601
602/**
603 * 获取`应用订阅`缓存

Callers 7

getBoxDataFunction · 0.70
apiUpdateFunction · 0.70
apiAddAppSubFunction · 0.70
apiAddAppSubRawFunction · 0.70
apiDeleteAppSubFunction · 0.70
reloadAppSubCachesFunction · 0.70
upgradeUserDataFunction · 0.70

Calls 2

getjsonMethod · 0.45
setjsonMethod · 0.45

Tested by

no test coverage detected