skydiet-lib-node
Advanced tools
Comparing version 1.0.29 to 1.0.30
@@ -46,7 +46,17 @@ "use strict"; | ||
const ids = {}; | ||
const keys = []; | ||
let keys = []; | ||
for (const field of fieldsToGroup) { | ||
if (currentValue[field]) { | ||
keys.push(currentValue[field].toString()); | ||
ids[field] = currentValue[field]; | ||
// keys.push(currentValue[field].toString()) | ||
// ids[field] = currentValue[field] | ||
if (Array.isArray(currentValue[field])) { | ||
currentValue[field].forEach((f) => { | ||
keys = [...keys, f]; | ||
ids[f] = currentValue[field]; | ||
}); | ||
} | ||
else { | ||
keys.push(currentValue[field].toString()); | ||
ids[field] = currentValue[field]; | ||
} | ||
} | ||
@@ -53,0 +63,0 @@ } |
{ | ||
"name": "skydiet-lib-node", | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"description": "Biblioteca para funções skydiet", | ||
@@ -5,0 +5,0 @@ "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>", |
@@ -66,7 +66,17 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
const ids = {} as { [key: string]: any, id: any, items: any[] } | ||
const keys = [] | ||
let keys: any[] = [] | ||
for (const field of fieldsToGroup) { | ||
if (currentValue[field]) { | ||
keys.push(currentValue[field].toString()) | ||
ids[field] = currentValue[field] | ||
// keys.push(currentValue[field].toString()) | ||
// ids[field] = currentValue[field] | ||
if (Array.isArray(currentValue[field])) { | ||
currentValue[field].forEach((f: string) => { | ||
keys = [...keys, f] | ||
ids[f] = currentValue[field]; | ||
}) | ||
} else { | ||
keys.push(currentValue[field].toString()); | ||
ids[field] = currentValue[field]; | ||
} | ||
} | ||
@@ -73,0 +83,0 @@ } |
60847
1339