Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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).
- Host: GitHub
- URL: https://github.com/titarenko/combine-properties
- Owner: titarenko
- Created: 2016-04-18T19:22:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-18T19:39:19.000Z (over 8 years ago)
- Last Synced: 2024-12-04T07:39:37.417Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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