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);