From 2a1078a3a266922ab2b790678613fd1da1373e68 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 19 Dec 2022 13:49:11 -0500 Subject: [PATCH] *Update dist --- dist/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 52b9102..ea76f62 100644 --- a/dist/index.js +++ b/dist/index.js @@ -65,7 +65,9 @@ class Config { for (const key of Object.keys(settings)) { const value = json[key]; let keyPath = key.split("."); - let isArray = typeof parseInt(keyPath.pop()) === "number"; + let isArray = key.includes(".") && + keyPath.length > 1 && + typeof parseInt(keyPath.pop()) === "number"; if (isArray) { let itemPath = keyPath.join("."); let item = this.get(itemPath, []); @@ -127,7 +129,7 @@ class Config { } (0, bsert_1.default)(typeof key === "string", "Key must be a string."); key = this.normalize(key); - return object_path_1.default.get(this.data, key); + return object_path_1.default.get(this.data, key, fallback); } typeOf(key) { const value = this.get(key);