loupedeck-commander 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/ApplicationConfig.mjs +19 -0
- package/config.yaml +2 -0
- package/package.json +1 -1
- package/profile-1.yaml +2 -0
- package/profile-2.yaml +2 -0
|
@@ -3,6 +3,7 @@ import { readConfigFile as readConfigFile, writeJSONFile,syncParams, writeYAMLFi
|
|
|
3
3
|
export class ApplicationConfig {
|
|
4
4
|
application = 'undefined'
|
|
5
5
|
profiles = []
|
|
6
|
+
parameters = {}
|
|
6
7
|
initialized = false
|
|
7
8
|
|
|
8
9
|
loadFromFile (fileName) {
|
|
@@ -19,8 +20,12 @@ export class ApplicationConfig {
|
|
|
19
20
|
}
|
|
20
21
|
else{
|
|
21
22
|
this.application = config.application
|
|
23
|
+
this.parameters = new ParametersConfig()
|
|
24
|
+
|
|
25
|
+
|
|
22
26
|
for (let i = 0; i < config.profiles.length; i++) {
|
|
23
27
|
const profile = new Profile(config.profiles[i],config.profiles.length,i)
|
|
28
|
+
profile.setParams(config.parameters)
|
|
24
29
|
if (profile.loaded){
|
|
25
30
|
this.profiles.push(profile)
|
|
26
31
|
}else{
|
|
@@ -104,6 +109,20 @@ class Profile {
|
|
|
104
109
|
return this.loaded
|
|
105
110
|
}
|
|
106
111
|
|
|
112
|
+
setParams(parameters){
|
|
113
|
+
if (parameters === undefined)
|
|
114
|
+
return
|
|
115
|
+
|
|
116
|
+
let keys = Object.keys(parameters)
|
|
117
|
+
for (var i=0;i<keys.length;i++){
|
|
118
|
+
let key = keys[i]
|
|
119
|
+
if (!(key in this.parameters)){
|
|
120
|
+
this.parameters[key] = parameters[key]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
|
|
107
126
|
saveToFile (fileName) {
|
|
108
127
|
fileName = fileName.toLowerCase()
|
|
109
128
|
|
package/config.yaml
CHANGED
package/package.json
CHANGED
package/profile-1.yaml
CHANGED