use table settings

This commit is contained in:
2024-04-23 14:37:39 +03:30
parent 5c5aa33741
commit edc2cfd204
3 changed files with 29 additions and 13 deletions

View File

@@ -0,0 +1,10 @@
export const flattenArrayOfObjects = (array, key) => {
return array.reduce((acc, obj) => {
if (Array.isArray(obj[key])) {
acc.push(...flattenArrayOfObjects(obj[key]));
} else {
acc.push(obj);
}
return acc;
}, []);
};