{"id":15861969,"url":"https://github.com/afeiship/next-intersection","last_synced_at":"2025-04-01T20:34:37.017Z","repository":{"id":57122729,"uuid":"283673281","full_name":"afeiship/next-intersection","owner":"afeiship","description":"Simple intersection implement.","archived":false,"fork":false,"pushed_at":"2020-11-20T09:32:31.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T22:55:54.510Z","etag":null,"topics":["intersection","next"],"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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-30T04:56:40.000Z","updated_at":"2020-11-20T09:32:34.000Z","dependencies_parsed_at":"2022-08-24T14:57:01.107Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-intersection","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-intersection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-intersection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-intersection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-intersection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-intersection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709932,"owners_count":20821297,"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":["intersection","next"],"created_at":"2024-10-05T22:22:14.007Z","updated_at":"2025-04-01T20:34:36.988Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","readme":"# next-intersection\n\u003e Simple intersection implement.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-intersection\n```\n\n## usage\n```js\nimport '@jswork/next-intersection';\n\nconst a1 = [1, 2, 3];\nconst a2 = [2, 3, 4];\n\nnx.intersection(a1, a2)\n// [2, 3]\n\n\nconst a1 = [\n  { id: 1, value: 'aa' },\n  { id: 2, value: 'bb' },\n  { id: 3, value: 'cc' }\n];\n\nconst a2 = [\n  { id: 3, value: 'cc' },\n  { id: 4, value: 'dd' }\n];\n\nconst ids = a2.map(item =\u003e item.id);\nconst res = nx.intersection(a1, a2, (_, value) =\u003e {\n  return ids.includes(value.id);\n});\n\n// [ { id: 3, value: 'cc' } ]\n```\n\n## resources\n- https://stackoverflow.com/questions/1885557/simplest-code-for-array-intersection-in-javascript\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-intersection/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-intersection\n[version-url]: https://npmjs.org/package/@jswork/next-intersection\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-intersection\n[license-url]: https://github.com/afeiship/next-intersection/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-intersection\n[size-url]: https://github.com/afeiship/next-intersection/blob/master/dist/next-intersection.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-intersection\n[download-url]: https://www.npmjs.com/package/@jswork/next-intersection\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-intersection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-intersection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-intersection/lists"}