*Update dist

This commit is contained in:
Derrick Hammer 2022-12-19 13:49:11 -05:00
parent a3f3e157b9
commit 2a1078a3a2
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

6
dist/index.js vendored
View File

@ -65,7 +65,9 @@ class Config {
for (const key of Object.keys(settings)) { for (const key of Object.keys(settings)) {
const value = json[key]; const value = json[key];
let keyPath = key.split("."); 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) { if (isArray) {
let itemPath = keyPath.join("."); let itemPath = keyPath.join(".");
let item = this.get(itemPath, []); let item = this.get(itemPath, []);
@ -127,7 +129,7 @@ class Config {
} }
(0, bsert_1.default)(typeof key === "string", "Key must be a string."); (0, bsert_1.default)(typeof key === "string", "Key must be a string.");
key = this.normalize(key); 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) { typeOf(key) {
const value = this.get(key); const value = this.get(key);