{"id":22351907,"url":"https://github.com/screwdriver-cd/keymbinatorial","last_synced_at":"2025-03-26T12:10:15.207Z","repository":{"id":48822664,"uuid":"63627638","full_name":"screwdriver-cd/keymbinatorial","owner":"screwdriver-cd","description":"Module that generates the unique combinations of key values by taking a single value from each keys array ","archived":false,"fork":false,"pushed_at":"2022-11-21T18:33:29.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-04-25T23:21:00.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/keymbinatorial","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/screwdriver-cd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-18T18:36:46.000Z","updated_at":"2022-11-21T06:38:27.000Z","dependencies_parsed_at":"2023-01-23T10:00:06.564Z","dependency_job_id":null,"html_url":"https://github.com/screwdriver-cd/keymbinatorial","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fkeymbinatorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fkeymbinatorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fkeymbinatorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fkeymbinatorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/screwdriver-cd","download_url":"https://codeload.github.com/screwdriver-cd/keymbinatorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245650496,"owners_count":20650105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T12:16:28.741Z","updated_at":"2025-03-26T12:10:15.179Z","avatar_url":"https://github.com/screwdriver-cd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keymbinatorial\n[![Version][npm-image]][npm-url] ![Downloads][downloads-image] [![Build Status][status-image]][status-url] [![Open Issues][issues-image]][issues-url] ![License][license-image]\n\n\u003e Generates a unique combinations of key values by taking a single value from each keys array\n\n## Usage\n\n```bash\nnpm install keymbinatorial\n```\n\n```js\nvar keymbinatorial = require('keymbinatorial');\n\nlet objectToCombine = {\n    a: ['a', 'b', 'c'],\n    c: [1, 2],\n    e: [{ a: '1'}, {b: '2'}]\n};\n\n// combinations will be an array of unique combinations based on each key and the values in the array\nlet combinations = keymbinatorial(objectToCombine);\n\nconsole.log(combinations);\n/*\nwill output:\n[\n  { a: 'a', c: 1, e: { a: '1' } },\n  { a: 'a', c: 1, e: { b: '2' } },\n  { a: 'a', c: 2, e: { a: '1' } },\n  { a: 'a', c: 2, e: { b: '2' } },\n  { a: 'b', c: 1, e: { a: '1' } },\n  { a: 'b', c: 1, e: { b: '2' } },\n  { a: 'b', c: 2, e: { a: '1' } },\n  { a: 'b', c: 2, e: { b: '2' } },\n  { a: 'c', c: 1, e: { a: '1' } },\n  { a: 'c', c: 1, e: { b: '2' } },\n  { a: 'c', c: 2, e: { a: '1' } },\n  { a: 'c', c: 2, e: { b: '2' } }\n]\n*/\n```\n\nThe `keymbinatorial` function takes in an Nx1 object, where N is a set of keys that map to\nan array.\n\nFor each key in the object, the function builds up a list of objects containing a unique combination\nof keys to values in the array.\n\n## Testing\n\n```bash\nnpm test\n```\n\n## License\n\nCode licensed under the BSD 3-Clause license. See LICENSE file for terms.\n\n[npm-image]: https://img.shields.io/npm/v/keymbinatorial.svg\n[npm-url]: https://npmjs.org/package/keymbinatorial\n[downloads-image]: https://img.shields.io/npm/dt/keymbinatorial.svg\n[license-image]: https://img.shields.io/npm/l/keymbinatorial.svg\n[issues-image]: https://img.shields.io/github/issues/screwdriver-cd/screwdriver.svg\n[issues-url]: https://github.com/screwdriver-cd/screwdriver/issues\n[status-image]: https://cd.screwdriver.cd/pipelines/20/badge\n[status-url]: https://cd.screwdriver.cd/pipelines/20\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fkeymbinatorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrewdriver-cd%2Fkeymbinatorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fkeymbinatorial/lists"}