-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.js
43 lines (35 loc) · 805 Bytes
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import Conf from 'conf';
import {readPackageUp} from 'read-package-up';
const {packageJson} = await readPackageUp({cwd: new URL('.', import.meta.url)});
const config_ = new Conf({projectName: packageJson.name});
class Config {
keys = {
darkProfile: 'darkProfile',
lightProfile: 'lightProfile',
};
/**
* @return {string|undefined}
*/
get darkProfile() {
return config_.get(this.keys.darkProfile);
}
/**
* @param {string} profile
*/
set darkProfile(profile) {
config_.set(this.keys.darkProfile, profile);
}
/**
* @return {string|undefined}
*/
get lightProfile() {
return config_.get(this.keys.lightProfile);
}
/**
* @param {string} profile
*/
set lightProfile(profile) {
config_.set(this.keys.lightProfile, profile);
}
}
export const config = new Config();