complete hide action part with button for hide or show all table header
This commit is contained in:
12
src/core/utils/flattenObjectOfObjects.jsx
Normal file
12
src/core/utils/flattenObjectOfObjects.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
export const flattenObjectOfObjects = (obj, res = {}) => {
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
if (typeof obj[key] === "object" && obj[key] !== null) {
|
||||
flattenObjectOfObjects(obj[key], res);
|
||||
} else {
|
||||
res[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
Reference in New Issue
Block a user