*Heavily simplify config loading and just pass it to the set method, don't try to handle arrays special

This commit is contained in:
Derrick Hammer 2022-12-22 09:44:40 -05:00
parent 792ec3976f
commit 9e8e44b9c5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 0 additions and 15 deletions

View File

@ -75,21 +75,6 @@ export default class Config {
for (const key of Object.keys(settings)) { for (const key of Object.keys(settings)) {
const value = settings[key]; const value = settings[key];
let keyPath = key.split(".");
let isArray =
key.includes(".") &&
keyPath.length > 1 &&
typeof parseInt(keyPath.pop()) === "number";
if (isArray) {
let itemPath = keyPath.join(".");
let item = this.get(itemPath, []);
item.push(value);
this.set(itemPath, item);
continue;
}
this.set(key, value); this.set(key, value);
} }
} }