{"id":23124908,"url":"https://github.com/landau/zipmap","last_synced_at":"2025-08-17T03:32:23.043Z","repository":{"id":15392505,"uuid":"18124260","full_name":"landau/zipmap","owner":"landau","description":"Returns a map with the keys mapped to the corresponding vals.","archived":false,"fork":false,"pushed_at":"2023-12-15T02:27:11.000Z","size":9,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T19:45:33.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/landau.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-26T02:22:22.000Z","updated_at":"2019-07-15T20:56:52.000Z","dependencies_parsed_at":"2024-06-19T04:11:18.226Z","dependency_job_id":"9292ed4b-a46d-4d96-88c6-d2236e2a229f","html_url":"https://github.com/landau/zipmap","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"08cc5e0b5fc963d503f6de2563959c2ca4056325"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/landau/zipmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/landau%2Fzipmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/landau%2Fzipmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/landau%2Fzipmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/landau%2Fzipmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/landau","download_url":"https://codeload.github.com/landau/zipmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/landau%2Fzipmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270802985,"owners_count":24648682,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-17T08:11:59.809Z","updated_at":"2025-08-17T03:32:22.728Z","avatar_url":"https://github.com/landau.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/landau/zipmap.svg)](https://travis-ci.org/landau/zipmap)\n\nzipmap\n======\n\nReturns a map with the keys mapped to the corresponding vals. `zipmap` also accepts a single value of objects or pairs.\n\n\u003e Note: If you use objects, you must use the props `key` and `value`\n\n```js\n/**\n * Returns a map with the keys mapped to the corresponding vals.\n *\n * @param {array} keys\n * @param {array} [vals]\n *\n * @return {object}\n */\nfunction zipmap(keys, vals) { }\n```\n\n## Install\n\n`npm i -S zipmap`\n\n## Usage\n\n```js\nvar assert = require('assert');\nvar zipmap = require('zipmap');\n\nvar keys = ['a', 'b', 'c'];\nvar vals = [1, 2, 3];\n\nvar map = zipmap(keys, vals);\nassert.deepEqual(map, { a: 1, b: 2, c: 3 });\n```\n\nOr use an array of objects\n\n```js\nvar objs = [\n  { key: 'foo', value: 'bar' },\n  { key: 'hi', value: 'bye' },\n];\n\nvar out = {\n  foo: 'bar',\n  hi: 'bye'\n};\n\nvar map = zipmap(objs);\nassert.deepEqual(map, out);\n```\n\nor use an array of pairs\n\n```js\nvar pairs = [\n  ['foo', 'bar'],\n  ['hi', 'bye']\n];\n\nvar out = {\n  foo: 'bar',\n  hi: 'bye'\n};\n\nvar map = zipmap(pairs);\nassert.deepEqual(map, out);\n```\n\n## Changelog\n\n#### 1.1.1\n\n- Return empty obj when given an array of len 0\n\n#### 1.1.0\n\n- Add single argument handling which allows objects or pairs\n","funding_links":[],"categories":["模块","Modules"],"sub_categories":["对象","Object"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flandau%2Fzipmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flandau%2Fzipmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flandau%2Fzipmap/lists"}