*improve object path check

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

View File

@ -77,7 +77,10 @@ export default class Config {
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(".");