{"id":19050485,"url":"https://github.com/blakek/make-lookup","last_synced_at":"2025-06-17T11:09:01.566Z","repository":{"id":38254804,"uuid":"268855397","full_name":"blakek/make-lookup","owner":"blakek","description":"📒 Make a lookup object from an array of objects","archived":false,"fork":false,"pushed_at":"2023-03-04T21:52:16.000Z","size":2071,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T16:34:47.560Z","etag":null,"topics":["functional-programming","hash-lookup","javascript","lookup","lookup-table","map","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blakek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-02T16:41:32.000Z","updated_at":"2021-10-21T12:27:03.000Z","dependencies_parsed_at":"2023-12-09T11:44:10.644Z","dependency_job_id":null,"html_url":"https://github.com/blakek/make-lookup","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":0.5,"last_synced_commit":"f4d66438a3e37d59b96c8cd35068ff42d134de67"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/blakek/make-lookup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakek%2Fmake-lookup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakek%2Fmake-lookup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakek%2Fmake-lookup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakek%2Fmake-lookup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blakek","download_url":"https://codeload.github.com/blakek/make-lookup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakek%2Fmake-lookup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260346877,"owners_count":22995151,"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":["functional-programming","hash-lookup","javascript","lookup","lookup-table","map","typescript"],"created_at":"2024-11-08T23:15:05.983Z","updated_at":"2025-06-17T11:08:56.550Z","avatar_url":"https://github.com/blakek.png","language":"JavaScript","readme":"# make-lookup\n\n\u003e 📒 Make a lookup object from an array of objects\n\nTakes a list of items in an array an changes it to an object for fast access.\n\n## Install\n\nUsing [Yarn]:\n\n```bash\n$ yarn add @blakek/make-lookup\n```\n\n…or using [npm]:\n\n```bash\n$ npm i --save @blakek/make-lookup\n```\n\n## Usage\n\n```js\nimport { makeLookup } from '@blakek/make-lookup';\n\nconst users = [\n  { sites: { github: { username: 'blakek' } } },\n  { sites: { github: { username: 'gsandf' } } },\n  { sites: { github: { username: 'google' } } }\n];\n\nconst usersByUsername = makeLookup(users, 'sites.github.username');\n\nconsole.log(usersByUsername.blakek);\n// =\u003e { sites: { github: { username: 'blakek' } } }\n```\n\n## API\n\n### `makeLookup`\n\n```ts\nfunction makeLookup\u003cT\u003e(\n  inputArray: any[],\n  lookupProperty: Array\u003cnumber | string\u003e | string;\n): Record\u003cstring, T\u003e;\n```\n\nCreates a lookup object for a given array.\n\n`lookupProperty` is a path to the property in either dot notation or an array of\npath parts. See [blakek/deep] for details on this path.\n\n## Contributing\n\n[Node.js] and [Yarn] are required to work with this project.\n\nTo install all dependencies, run:\n\n```bash\nyarn\n```\n\n### Useful Commands\n\n|                     |                                                 |\n| ------------------- | ----------------------------------------------- |\n| `yarn build`        | Builds the project to `./dist`                  |\n| `yarn format`       | Format the source following the Prettier styles |\n| `yarn test`         | Run project tests                               |\n| `yarn test --watch` | Run project tests, watching for file changes    |\n\n## License\n\nMIT\n\n[blakek/deep]: https://github.com/blakek/deep\n[node.js]: https://nodejs.org/\n[npm]: https://npmjs.com/\n[yarn]: https://yarnpkg.com/en/docs/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakek%2Fmake-lookup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblakek%2Fmake-lookup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakek%2Fmake-lookup/lists"}