mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-08 01:10:03 +02:00
25 lines
647 B
TypeScript
25 lines
647 B
TypeScript
import { config } from '..'
|
|
import { log } from '../log'
|
|
import { dynamicConfig } from '../utils'
|
|
|
|
export const set = (key: string, value?: string) => {
|
|
if (key == 'version') {
|
|
console.log(
|
|
config.brands[dynamicConfig.get('brand')].release.displayVersion
|
|
)
|
|
return
|
|
}
|
|
|
|
if (!(key in dynamicConfig.defaultValues)) {
|
|
log.warning(`The key ${key} is not found within the dynamic config options`)
|
|
return
|
|
}
|
|
|
|
if (value) {
|
|
dynamicConfig.set(key as dynamicConfig.DefaultValuesKeys, value)
|
|
log.info(`Set ${key} to ${value}`)
|
|
return
|
|
}
|
|
|
|
console.log(dynamicConfig.get(key as dynamicConfig.DefaultValuesKeys))
|
|
}
|