{"id":21831386,"url":"https://github.com/nodef/extra-set","last_synced_at":"2025-04-14T07:08:17.428Z","repository":{"id":33820285,"uuid":"133403268","full_name":"nodef/extra-set","owner":"nodef","description":"A pack of functions for working with Sets.","archived":false,"fork":false,"pushed_at":"2025-04-08T16:42:58.000Z","size":585,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T21:42:05.558Z","etag":null,"topics":["add","cartesian-product","chunk","compare","concat","count","count-as","difference","drop","entries","every","extra","filter","find","set"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/extra-set","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/nodef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-14T18:14:04.000Z","updated_at":"2025-04-08T16:42:58.000Z","dependencies_parsed_at":"2024-06-19T16:03:01.445Z","dependency_job_id":"ee0a0edd-0083-4aaf-91f8-40ed143bff9d","html_url":"https://github.com/nodef/extra-set","commit_stats":{"total_commits":126,"total_committers":1,"mean_commits":126.0,"dds":0.0,"last_synced_commit":"aad4c4b012ed5e5752aac01934010b7de4e3597a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodef","download_url":"https://codeload.github.com/nodef/extra-set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637831,"owners_count":21137538,"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":["add","cartesian-product","chunk","compare","concat","count","count-as","difference","drop","entries","every","extra","filter","find","set"],"created_at":"2024-11-27T19:10:06.409Z","updated_at":"2025-04-14T07:08:17.417Z","avatar_url":"https://github.com/nodef.png","language":"TypeScript","readme":"A pack of functions for working with Sets.\u003cbr\u003e\n📦 [Node.js](https://www.npmjs.com/package/extra-set),\n🌐 [Web](https://www.npmjs.com/package/extra-set.web),\n📜 [Files](https://unpkg.com/extra-set/),\n📰 [Docs](https://nodef.github.io/extra-set/),\n📘 [Wiki](https://github.com/nodef/extra-set/wiki/).\n\nA [Set] is a collection of unique values. This package includes common set\nfunctions related to querying **about** sets, **generating** them, **comparing**\none with another, finding their **size**, **adding** and **removing** elements,\nobtaining its **properties**, getting a **part** of it, getting a **subset**\nelements in it, **finding** an element in it, performing **functional**\noperations, **manipulating** it in various ways, **combining** together sets or\nits elements, of performing **set** **operations** upon it.\n\nAll functions except `from*()` take set as 1st parameter. Methods like\n`concat()` are pure and do not modify the set itself, while methods like\n`concat$()` *do modify (update)* the set itself.\n\nThis package is available in *Node.js* and *Web* formats. The web format\nis exposed as `extra_set` standalone variable and can be loaded from\n[jsDelivr CDN].\n\n\u003e Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).\n\n[Set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\n[jsDelivr CDN]: https://cdn.jsdelivr.net/npm/extra-set.web/index.js\n\n\u003cbr\u003e\n\n```javascript\nconst set = require('extra-set');\n// import * as set from \"extra-set\";\n// import * as set from \"https://unpkg.com/extra-set/index.mjs\"; (Deno)\n\nvar x = new Set([1, 2, 3, 4, 5]);\nvar y = new Set([2, 4]);\nset.difference(x, y);\n// → Set(3) { 1, 3, 5 }\n\nvar x = new Set([1, 2, 3]);\nvar y = new Set([3, 4]);\nset.isDisjoint(x, y);\n// → false\n\nvar x = new Set([1, 2, 3, 4]);\nvar y = new Set([3, 4, 5, 6]);\nset.symmetricDifference(x, y);\n// → Set(4) { 1, 2, 5, 6 }\n\nvar x = new Set([1, 2, 3]);\n[...set.subsets(x)];\n// → [\n// →   Set(0) {},\n// →   Set(1) { 1 },\n// →   Set(1) { 2 },\n// →   Set(2) { 1, 2 },\n// →   Set(1) { 3 },\n// →   Set(2) { 1, 3 },\n// →   Set(2) { 2, 3 },\n// →   Set(3) { 1, 2, 3 }\n// → ]\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## Index\n\n| Property | Description |\n|  ----  |  ----  |\n| [is] | Check if value is a set. |\n| [values] | List all values. |\n| [entries] | List all value-value pairs. |\n|  |  |\n| [from] | Convert an iterable to set. |\n| [from$] | Convert an iterable to set. |\n|  |  |\n| [compare] | Compare two sets. |\n| [isEqual] | Check if two sets are equal. |\n|  |  |\n| [size] | Find the size of a set. |\n| [isEmpty] | Check if a set is empty. |\n|  |  |\n| [add] | Add a value to set. |\n| [add$] | Add a value to set. |\n| [remove] | Delete a value from set. |\n| [remove$] | Delete a value from set. |\n|  |  |\n| [count] | Count values which satisfy a test. |\n| [countAs] | Count occurrences of values. |\n| [min] | Find smallest value. |\n| [max] | Find largest value. |\n| [range] | Find smallest and largest entries. |\n|  |  |\n| [head] | Get first value from set (default order). |\n| [tail] | Get a set without its first value (default order). |\n| [take] | Keep first n values only (default order). |\n| [take$] | Keep first n values only (default order). |\n| [drop] | Remove first n values (default order). |\n| [drop$] | Remove first n values (default order). |\n|  |  |\n| [subsets] | List all possible subsets. |\n| [randomValue] | Pick an arbitrary value. |\n| [randomEntry] | Pick an arbitrary entry. |\n| [randomSubset] | Pick an arbitrary subset. |\n| [hasSubset] | Checks if set has a subset. |\n|  |  |\n| [has] | Check if set has a value. |\n| [find] | Find first value passing a test (default order). |\n| [findAll] | Find all values passing a test. |\n|  |  |\n| [forEach] | Call a function for each value. |\n| [some] | Check if any value satisfies a test. |\n| [every] | Check if all values satisfy a test. |\n| [map] | Transform values of a set. |\n| [map$] | Transform values of a set. |\n| [reduce] | Reduce values of set to a single value. |\n| [filter] | Keep values which pass a test. |\n| [filter$] | Keep values which pass a test. |\n| [reject] | Discard values which pass a test. |\n| [reject$] | Discard values which pass a test. |\n| [flat] | Flatten nested set to given depth. |\n| [flatMap] | Flatten nested set, based on map function. |\n|  |  |\n| [partition] | Segregate values by test result. |\n| [partitionAs] | Segregates values by similarity. |\n| [chunk] | Break set into chunks of given size. |\n|  |  |\n| [concat] | Append values from sets. |\n| [concat$] | Append values from sets. |\n| [join] | Join values together into a string. |\n|  |  |\n| [isDisjoint] | Check if sets have no value in common. |\n| [union] | Obtain values present in any set. |\n| [union$] | Obtain values present in any set. |\n| [intersection] | Obtain values present in both sets. |\n| [intersection$] | Obtain values present in both sets. |\n| [difference] | Obtain values not present in another set. |\n| [difference$] | Obtain values not present in another set. |\n| [symmetricDifference] | Obtain values not present in both sets. |\n| [symmetricDifference$] | Obtain values not present in both sets. |\n| [cartesianProduct] | List cartesian product of sets. |\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n[![](https://img.youtube.com/vi/mvO6zaIUO18/maxresdefault.jpg)](https://www.youtube.com/watch?v=mvO6zaIUO18)\n[![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)\n[![DOI](https://zenodo.org/badge/133403268.svg)](https://zenodo.org/badge/latestdoi/133403268)\n[![Coverage Status](https://coveralls.io/repos/github/nodef/extra-set/badge.svg?branch=master)](https://coveralls.io/github/nodef/extra-set?branch=master)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/f0511916d4a805c040f6/test_coverage)](https://codeclimate.com/github/nodef/extra-set/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/f0511916d4a805c040f6/maintainability)](https://codeclimate.com/github/nodef/extra-set/maintainability)\n![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/extra-set)\n\n\n[is]: https://github.com/nodef/extra-set/wiki/is\n[values]: https://github.com/nodef/extra-set/wiki/values\n[entries]: https://github.com/nodef/extra-set/wiki/entries\n[from]: https://github.com/nodef/extra-set/wiki/from\n[from$]: https://github.com/nodef/extra-set/wiki/from$\n[compare]: https://github.com/nodef/extra-set/wiki/compare\n[isEqual]: https://github.com/nodef/extra-set/wiki/isEqual\n[size]: https://github.com/nodef/extra-set/wiki/size\n[isEmpty]: https://github.com/nodef/extra-set/wiki/isEmpty\n[add]: https://github.com/nodef/extra-set/wiki/add\n[add$]: https://github.com/nodef/extra-set/wiki/add$\n[remove]: https://github.com/nodef/extra-set/wiki/remove\n[remove$]: https://github.com/nodef/extra-set/wiki/remove$\n[count]: https://github.com/nodef/extra-set/wiki/count\n[countAs]: https://github.com/nodef/extra-set/wiki/countAs\n[min]: https://github.com/nodef/extra-set/wiki/min\n[max]: https://github.com/nodef/extra-set/wiki/max\n[range]: https://github.com/nodef/extra-set/wiki/range\n[head]: https://github.com/nodef/extra-set/wiki/head\n[tail]: https://github.com/nodef/extra-set/wiki/tail\n[take]: https://github.com/nodef/extra-set/wiki/take\n[take$]: https://github.com/nodef/extra-set/wiki/take$\n[drop]: https://github.com/nodef/extra-set/wiki/drop\n[drop$]: https://github.com/nodef/extra-set/wiki/drop$\n[subsets]: https://github.com/nodef/extra-set/wiki/subsets\n[randomValue]: https://github.com/nodef/extra-set/wiki/randomValue\n[randomEntry]: https://github.com/nodef/extra-set/wiki/randomEntry\n[randomSubset]: https://github.com/nodef/extra-set/wiki/randomSubset\n[hasSubset]: https://github.com/nodef/extra-set/wiki/hasSubset\n[has]: https://github.com/nodef/extra-set/wiki/has\n[find]: https://github.com/nodef/extra-set/wiki/find\n[findAll]: https://github.com/nodef/extra-set/wiki/findAll\n[forEach]: https://github.com/nodef/extra-set/wiki/forEach\n[some]: https://github.com/nodef/extra-set/wiki/some\n[every]: https://github.com/nodef/extra-set/wiki/every\n[map]: https://github.com/nodef/extra-set/wiki/map\n[map$]: https://github.com/nodef/extra-set/wiki/map$\n[reduce]: https://github.com/nodef/extra-set/wiki/reduce\n[filter]: https://github.com/nodef/extra-set/wiki/filter\n[filter$]: https://github.com/nodef/extra-set/wiki/filter$\n[reject]: https://github.com/nodef/extra-set/wiki/reject\n[reject$]: https://github.com/nodef/extra-set/wiki/reject$\n[flat]: https://github.com/nodef/extra-set/wiki/flat\n[flatMap]: https://github.com/nodef/extra-set/wiki/flatMap\n[partition]: https://github.com/nodef/extra-set/wiki/partition\n[partitionAs]: https://github.com/nodef/extra-set/wiki/partitionAs\n[chunk]: https://github.com/nodef/extra-set/wiki/chunk\n[concat]: https://github.com/nodef/extra-set/wiki/concat\n[concat$]: https://github.com/nodef/extra-set/wiki/concat$\n[join]: https://github.com/nodef/extra-set/wiki/join\n[isDisjoint]: https://github.com/nodef/extra-set/wiki/isDisjoint\n[union]: https://github.com/nodef/extra-set/wiki/union\n[union$]: https://github.com/nodef/extra-set/wiki/union$\n[intersection]: https://github.com/nodef/extra-set/wiki/intersection\n[intersection$]: https://github.com/nodef/extra-set/wiki/intersection$\n[difference]: https://github.com/nodef/extra-set/wiki/difference\n[difference$]: https://github.com/nodef/extra-set/wiki/difference$\n[symmetricDifference]: https://github.com/nodef/extra-set/wiki/symmetricDifference\n[symmetricDifference$]: https://github.com/nodef/extra-set/wiki/symmetricDifference$\n[cartesianProduct]: https://github.com/nodef/extra-set/wiki/cartesianProduct\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodef%2Fextra-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-set/lists"}