flatten-objects

1.3.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i flatten-objects

Weekly Downloads

5

Version

1.3.1

License

ISC

Unpacked Size

12.5 kB

Total Files

12

Last publish

Collaborators

  • samuraitruong