flatten-objects
v1.3.1
Published
A simple function to destructure object to multiple object if it contains array in any property
Downloads
28
Readme
flatten-objects
A very simple function that generate the multiple array of object when it contains any array in properties
for example
- Input
{
a: 1,
b: [1,2,3]
}-> Result
[
{ a: 1, b: 1 },
{ a: 1, b: 2 },
{ a: 1, b: 3 },
];Usage
import flattenObject from 'flatten-objects';
result = flattenObject({ a: 1, b: [1, 2, 3] });
console.log(result);