style: format code for all

This commit is contained in:
LZHD
2021-07-06 01:01:42 +08:00
committed by 踏学吾痕
parent e1200f2dbe
commit 77a1a47110
114 changed files with 7068 additions and 1068 deletions

View File

@@ -1,25 +1,25 @@
let config: object = {}
let config: object = {};
const setConfig = (cfg?: any) => {
config = Object.assign(config, cfg)
}
config = Object.assign(config, cfg);
};
const getConfig = (key?: string) => {
if (typeof key === "string") {
const arr = key.split(".")
const arr = key.split(".");
if (arr && arr.length) {
let data = config
let data = config;
arr.forEach(v => {
if (data && typeof data[v] !== "undefined") {
data = data[v]
data = data[v];
} else {
data = null
data = null;
}
})
return data
});
return data;
}
}
return config
}
return config;
};
export { getConfig, setConfig }
export { getConfig, setConfig };