@di-zed/yandex-smart-home
Version:
The Yandex Smart Home skills for the different device types.
40 lines (39 loc) • 771 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Config Provider.
*/
class ConfigProvider {
/**
* Set configurations.
*
* @param config
* @returns ConfigProvider
*/
setConfig(config) {
this.config = config;
return this;
}
/**
* Get configurations.
*
* @returns ConfigInterface | undefined
*/
getConfig() {
return this.config;
}
/**
* Get configuration option.
*
* @param key
* @returns any
*/
getConfigOption(key) {
const config = this.getConfig();
if (config !== undefined) {
return config[key];
}
return undefined;
}
}
exports.default = new ConfigProvider();