mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 17:29:14 +00:00
20 lines
343 B
JavaScript
20 lines
343 B
JavaScript
import { flattenDeep, isObject } from 'lodash';
|
|
|
|
const createArrayOfValues = obj => {
|
|
if (!isObject(obj)) {
|
|
return [];
|
|
}
|
|
|
|
return flattenDeep(
|
|
Object.values(obj).map(value => {
|
|
if (isObject(value)) {
|
|
return createArrayOfValues(value);
|
|
}
|
|
|
|
return value;
|
|
})
|
|
);
|
|
};
|
|
|
|
export default createArrayOfValues;
|