{"id":15686824,"url":"https://github.com/lambdalisue/deno-set-operations","last_synced_at":"2025-08-22T15:04:57.477Z","repository":{"id":46578872,"uuid":"382752056","full_name":"lambdalisue/deno-set-operations","owner":"lambdalisue","description":"🦕 Deno module which provides basic set operations","archived":false,"fork":false,"pushed_at":"2024-04-06T11:09:13.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-10T22:57:47.406Z","etag":null,"topics":["deno","jsr","set"],"latest_commit_sha":null,"homepage":"https://jsr.io/@lambdalisue/set-operations","language":"TypeScript","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/lambdalisue.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},"funding":{"github":"lambdalisue"}},"created_at":"2021-07-04T03:13:53.000Z","updated_at":"2024-04-06T11:09:32.000Z","dependencies_parsed_at":"2024-01-26T01:27:07.615Z","dependency_job_id":"9e53f24a-3465-43dc-890c-0b9bee5c707d","html_url":"https://github.com/lambdalisue/deno-set-operations","commit_stats":{"total_commits":13,"total_committers":4,"mean_commits":3.25,"dds":"0.46153846153846156","last_synced_commit":"cb04ca18ccf0e6189811c7343897d5fed233f614"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lambdalisue/deno-set-operations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-set-operations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-set-operations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-set-operations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-set-operations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdalisue","download_url":"https://codeload.github.com/lambdalisue/deno-set-operations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdalisue%2Fdeno-set-operations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657543,"owners_count":24797934,"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-22T02:00:08.480Z","response_time":65,"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":["deno","jsr","set"],"created_at":"2024-10-03T17:41:28.951Z","updated_at":"2025-08-22T15:04:57.447Z","avatar_url":"https://github.com/lambdalisue.png","language":"TypeScript","funding_links":["https://github.com/sponsors/lambdalisue"],"categories":[],"sub_categories":[],"readme":"# set-operations\n\n[![jsr](https://img.shields.io/jsr/v/%40lambdalisue/set-operations?logo=javascript\u0026logoColor=white)](https://jsr.io/@lambdalisue/set-operations)\n[![denoland](https://img.shields.io/github/v/release/lambdalisue/deno-set-operations?logo=deno\u0026label=denoland)](https://github.com/lambdalisue/deno-set-operations/releases)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/set_operations/mod.ts)\n[![Test](https://github.com/lambdalisue/deno-set-operations/actions/workflows/test.yml/badge.svg)](https://github.com/lambdalisue/deno-set-operations/actions/workflows/test.yml)\n\nThis module provides basic set operations. Most of codes are just translated\nfrom\n[JavaScript code in MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#implementing_basic_set_operations)\nto TypeScript.\n\n## Usage\n\n### `isDisjoint`\n\nCheck if the `setA` has no elements in common with `setB`.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { isDisjoint } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"isDisjoint works properly\", () =\u003e {\n  assertEquals(isDisjoint(new Set(\"abc\"), new Set(\"def\")), true);\n  assertEquals(isDisjoint(new Set(\"abc\"), new Set(\"cde\")), false);\n});\n```\n\n### `isSubset`\n\nCheck if every elements in `setA` is in the `setB`.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { isSubset } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"isSubset works properly\", () =\u003e {\n  assertEquals(isSubset(new Set(\"abc\"), new Set(\"abcdef\")), true);\n  assertEquals(isSubset(new Set(\"abc\"), new Set(\"def\")), false);\n  assertEquals(isSubset(new Set(\"abcdef\"), new Set(\"abc\")), false);\n});\n```\n\n### `isSuperset`\n\nCheck if every elements in `setB` is in the `setA`.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { isSuperset } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"isSuperset works properly\", () =\u003e {\n  assertEquals(isSuperset(new Set(\"abc\"), new Set(\"abcdef\")), false);\n  assertEquals(isSuperset(new Set(\"abc\"), new Set(\"def\")), false);\n  assertEquals(isSuperset(new Set(\"abcdef\"), new Set(\"abc\")), true);\n});\n```\n\n### `union`\n\nCreate a new set with elements from the `setA` and the `setB`.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { union } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"union works properly\", () =\u003e {\n  assertEquals(union(new Set(\"abc\"), new Set(\"def\")), new Set(\"abcdef\"));\n  assertEquals(union(new Set(\"abcdef\"), new Set(\"def\")), new Set(\"abcdef\"));\n  assertEquals(union(new Set(\"abc\"), new Set(\"abcdef\")), new Set(\"abcdef\"));\n});\n```\n\n### `intersection`\n\nCreate a new set with elements common to the `setA` and the `setB`.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { intersection } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"intersection works properly\", () =\u003e {\n  assertEquals(intersection(new Set(\"abc\"), new Set(\"def\")), new Set());\n  assertEquals(intersection(new Set(\"abcdef\"), new Set(\"def\")), new Set(\"def\"));\n  assertEquals(intersection(new Set(\"abc\"), new Set(\"abcdef\")), new Set(\"abc\"));\n});\n```\n\n### `difference`\n\nCreate a new set with elements in the `setA` that are not in the `setB`.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { difference } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"difference works properly\", () =\u003e {\n  assertEquals(difference(new Set(\"abc\"), new Set(\"def\")), new Set(\"abc\"));\n  assertEquals(difference(new Set(\"abcdef\"), new Set(\"def\")), new Set(\"abc\"));\n  assertEquals(difference(new Set(\"abc\"), new Set(\"abcdef\")), new Set());\n});\n```\n\n### `symmetricDifference`\n\nCreate a new set with elements in either the `setA` or `setB` but not both.\n\n```typescript\nimport { assertEquals } from \"https://deno.land/std/assert/mod.ts\";\nimport { symmetricDifference } from \"https://deno.land/x/set_operations@$MODULE_VERSION/mod.ts\";\n\nDeno.test(\"symmetricDifference works properly\", () =\u003e {\n  assertEquals(\n    symmetricDifference(new Set(\"abc\"), new Set(\"def\")),\n    new Set(\"abcdef\"),\n  );\n  assertEquals(\n    symmetricDifference(new Set(\"abcdef\"), new Set(\"def\")),\n    new Set(\"abc\"),\n  );\n  assertEquals(\n    symmetricDifference(new Set(\"abc\"), new Set(\"abcdef\")),\n    new Set(\"def\"),\n  );\n});\n```\n\n## License\n\nThe code follows MIT license written in [LICENSE](./LICENSE). Contributors need\nto agree that any modifications sent in this repository follow the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdalisue%2Fdeno-set-operations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdalisue%2Fdeno-set-operations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdalisue%2Fdeno-set-operations/lists"}