Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/titarenko/combine-properties

Generates all possible objects (combinations of property values).
https://github.com/titarenko/combine-properties

Last synced: about 1 month ago
JSON representation

Generates all possible objects (combinations of property values).

Awesome Lists containing this project

README

        

# combine-properties

Generates all possible objects (combinations of property values).

## Installation

```bash
npm i combine-properties --save
```

## Usage

```js
var combine = require('combine-properties')
var result = combine({
a: [1, 2, 3],
b: ['a', 'b']
})
// result[0] === { a: 1, b: 'a' }
// result[1] === { a: 2, b: 'a' }
// result[2] === { a: 3, b: 'a' }
// result[3] === { a: 1, b: 'b' }
// result[4] === { a: 2, b: 'b' }
// result[5] === { a: 3, b: 'b' }
```

## License

MIT