Merge pull request #23 from Seeker14491/ci

Set up GitHub Actions lints and checks
This commit is contained in:
SpikeHD
2022-07-15 21:11:06 -07:00
committed by GitHub
25 changed files with 328 additions and 149 deletions

View File

@@ -49,16 +49,16 @@ export interface Configuration {
akebi_path?: string
}
export async function setConfigOption(key: string, value: any): Promise<void> {
const config: any = await getConfig()
export async function setConfigOption<K extends keyof Configuration>(key: K, value: Configuration[K]): Promise<void> {
const config = await getConfig()
config[key] = value
await saveConfig(<Configuration> config)
}
export async function getConfigOption(key: string): Promise<any> {
const config: any = await getConfig()
const defaults: any = defaultConfig
export async function getConfigOption<K extends keyof Configuration>(key: K): Promise<Configuration[K]> {
const config = await getConfig()
const defaults = defaultConfig
return config[key] || defaults[key]
}