Merging fixes from cloud. Detailed changes TBA with next release

This commit is contained in:
frikky
2022-10-11 16:19:27 +02:00
parent bd170df0f0
commit b85a56f4b5
9 changed files with 137 additions and 25 deletions
+7 -2
View File
@@ -77,10 +77,12 @@ export const FindJsonPath = (path, inputdata) => {
var parsedValues = [];
if (inputdata === undefined || inputdata === null) {
console.log("Input is ", inputdata, ". Returning.")
return inputdata
}
if (typeof inputdata !== "object") {
console.log("Input is NOT an object. Returning.")
return inputdata
}
@@ -90,6 +92,7 @@ export const FindJsonPath = (path, inputdata) => {
}
if (keysplit.length === 0) {
console.log("Couldn't find key: length is 0 for keysplit.")
return inputdata
}
@@ -114,9 +117,11 @@ export const FindJsonPath = (path, inputdata) => {
}
}
var found = false
for (const [key, value] of Object.entries(inputdata)) {
if (key === keysplit[0]) {
const newkey = key.valueOf().toLowerCase().replaceAll(" ", "_")
if (key === keysplit[0] || newkey === keysplit[0]) {
found = true
// Return if no more keys
// Else, dig deeper