From 9e8e44b9c58a02150098ebefbbf61a9af9556834 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 22 Dec 2022 09:44:40 -0500 Subject: [PATCH] *Heavily simplify config loading and just pass it to the set method, don't try to handle arrays special --- src/index.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2db3c62..eec9b2e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,21 +75,6 @@ export default class Config { for (const key of Object.keys(settings)) { 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); } }