{"id":23053649,"url":"https://github.com/component/set","last_synced_at":"2025-08-15T04:30:53.650Z","repository":{"id":4696484,"uuid":"5843586","full_name":"component/set","owner":"component","description":"Set container","archived":false,"fork":false,"pushed_at":"2015-03-16T21:15:04.000Z","size":151,"stargazers_count":17,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T07:05:56.501Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/component.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-17T16:13:34.000Z","updated_at":"2020-01-11T05:06:53.000Z","dependencies_parsed_at":"2022-09-25T02:11:29.403Z","dependency_job_id":null,"html_url":"https://github.com/component/set","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/component/set","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/component","download_url":"https://codeload.github.com/component/set/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270523879,"owners_count":24600186,"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-15T02:00:12.559Z","response_time":110,"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-16T00:18:57.776Z","updated_at":"2025-08-15T04:30:53.389Z","avatar_url":"https://github.com/component.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# set\n\n  Generic Set container\n\n## Installation\n\n```\n$ component install component/set\n```\n\n## Example\n\n```js\nvar Set = require('set');\nvar set = new Set;\n\nset.add('foo');\nset.add('foo');\nset.add({ some: 'object' });\nset.remove('foo');\n\nset.values();\n// =\u003e [{ some: 'object' }]\n```\n\n## Equality\n\n  Set supports an `.equals(other)` method when present,\n  for example you may then add two separate `User` instances\n  that are identified as being the same via their name:\n\n```js\nUser.prototype.equals = function(user){\n  return this.name == user.name;\n};\n```\n\n## API\n\n### Set()\n\n  Create a new `Set`.\n\n### Set(values)\n\n  Create a new `Set` with `values` array. Duplicates will be removed.\n\n### Set#add(value)\n\n  Add `value` to the set.\n\n### Set#remove(value)\n\n  Remove `value` from the set, returning __true__ when present,\n  otherwise returning __false__.\n\n### Set#has(value)\n\n  Check if `value` is present.\n\n### Set#values()\n\n  Return an array of values.\n\n  Aliased as `.toJSON()`.\n\n### Set#each(fn)\n\n  Iterate each member and invoke `fn(val)`.\n\n### Set#size()\n\n  Return the set size.\n\n### Set#clear()\n\n  Empty the set and return the old values array.\n\n### Set#isEmpty()\n\n  Check if the set is empty.\n\n### Set#union(set)\n\n  Perform a union with `set` and return a new `Set`.\n\n### Set#intersect(set)\n\n  Perform an intersection with `set` and return a new `Set`.\n\n### Set#clone()\n\n  Clone the set and return a new `Set` of the same values.\n\n## License\n\n  MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomponent%2Fset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fset/lists"}