{"id":16351581,"url":"https://github.com/tomeraberbach/svkc","last_synced_at":"2026-03-04T21:02:27.394Z","repository":{"id":65503744,"uuid":"388322914","full_name":"TomerAberbach/svkc","owner":"TomerAberbach","description":"0️⃣ JavaScript's keyed collections (Map \u0026 Set) with SameValue semantics!","archived":false,"fork":false,"pushed_at":"2024-10-15T03:38:24.000Z","size":562,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T19:12:15.373Z","etag":null,"topics":["es6-map","es6-set","map","samevalue","samevaluezero","set"],"latest_commit_sha":null,"homepage":"https://npm.im/svkc","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TomerAberbach.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","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":"2021-07-22T04:09:55.000Z","updated_at":"2024-10-15T03:35:39.000Z","dependencies_parsed_at":"2024-06-23T05:42:36.976Z","dependency_job_id":"4c702a03-faa4-45b1-a575-d02dcbd9a93e","html_url":"https://github.com/TomerAberbach/svkc","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"62da7364ad27f37d7c603de2513f66960320e46f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fsvkc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fsvkc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fsvkc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fsvkc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomerAberbach","download_url":"https://codeload.github.com/TomerAberbach/svkc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244717354,"owners_count":20498282,"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":["es6-map","es6-set","map","samevalue","samevaluezero","set"],"created_at":"2024-10-11T01:23:16.314Z","updated_at":"2025-11-04T11:02:49.192Z","avatar_url":"https://github.com/TomerAberbach.png","language":"TypeScript","funding_links":["https://github.com/sponsors/TomerAberbach"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  svkc\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/svkc\"\u003e\n    \u003cimg src=\"https://badgen.net/npm/v/svkc\" alt=\"version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TomerAberbach/svkc/actions\"\u003e\n    \u003cimg src=\"https://github.com/TomerAberbach/svkc/workflows/CI/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://unpkg.com/svkc/dist/index.js\"\u003e\n    \u003cimg src=\"https://deno.bundlejs.com/?q=svkc\u0026badge\" alt=\"gzip size\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://unpkg.com/svkc/dist/index.js\"\u003e\n    \u003cimg src=\"https://deno.bundlejs.com/?q=svkc\u0026config={%22compression%22:{%22type%22:%22brotli%22}}\u0026badge\" alt=\"brotli size\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/sponsors/TomerAberbach\"\u003e\n    \u003cimg src=\"https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86\" alt=\"Sponsor\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  JavaScript's keyed collections (Map \u0026 Set) with \u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness\"\u003eSameValue\u003c/a\u003e semantics!\n\u003c/div\u003e\n\n## Features\n\n- **Familiar:** `SameValueMap` and `SameValueSet` extend JavaScript's built-in\n  `Map` and `Set`\n- **Compliant:** maintains all the invariants of `Map` and `Set` including\n  method return values and even iteration order!\n- **Tiny:** less than 350 bytes minzipped!\n\n## Install\n\n```sh\n$ npm i svkc\n```\n\n## Huh?\n\nA key in a `Map` or a value in a `Set` can only occur once. But how is the key\nor value's uniqueness determined? JavaScript's `Map` and `Set` use the\n[`sameValueZero` algorithm](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value-zero_equality)\nwhen checking if two keys or values are equal. The algorithm considers +0 and -0\nto be equal, but they are actually two different values due to how\n[IEEE floating point numbers](https://www.johndcook.com/blog/2010/06/15/why-computers-have-signed-zero)\nwork. This means that both `new Map([[0, 'zero'], [-0, 'negative zero']]).size`\nand `new Set([0, -0]).size` return 1 rather than 2.\n\nThis package provides `SameValueMap` and `SameValueSet` that behave identically\nto `Map` and `Set` except they consider +0 and -0 to be different values.\n\n## Usage\n\nJust use like a normal `Map` or `Set`!\n\n```js\nimport { SameValueMap, SameValueSet } from 'svkc'\n\nconst sameValueMap = new SameValueMap()\nsameValueMap.set(1, `one`)\nsameValueMap.set(0, `zero`)\nsameValueMap.set(-0, `negative zero`)\nsameValueMap.set(-1, `negative one`)\n\nconsole.log(sameValueMap.get(0))\n//=\u003e zero\n\nconsole.log(sameValueMap.get(-0))\n//=\u003e negative zero\n\nconsole.log([...sameValueMap])\n//=\u003e [ [ 1, 'one' ], [ 0, 'zero' ], [ -0, 'negative zero' ], [ -1, 'negative one' ] ]\n\nsameValueMap.delete(0)\n\nconsole.log(sameValueMap.has(0))\n//=\u003e false\n\nconsole.log(sameValueMap.has(-0))\n//=\u003e true\n\nconst sameValueSet = new SameValueSet()\nsameValueSet.add(1)\nsameValueSet.add(0)\nsameValueSet.add(-0)\nsameValueSet.add(-1)\n\nconsole.log(sameValueSet.has(0))\n//=\u003e true\n\nconsole.log(sameValueSet.has(-0))\n//=\u003e true\n\nconsole.log([...sameValueSet])\n//=\u003e [ 1, 0, -0, -1 ]\n\nsameValueSet.delete(0)\n\nconsole.log(sameValueSet.has(0))\n//=\u003e false\n\nconsole.log(sameValueSet.has(-0))\n//=\u003e true\n```\n\n## Contributing\n\nStars are always welcome!\n\nFor bugs and feature requests,\n[please create an issue](https://github.com/TomerAberbach/svkc/issues/new).\n\n## License\n\n[MIT](https://github.com/TomerAberbach/svkc/blob/main/license-mit) ©\n[Tomer Aberbach](https://github.com/TomerAberbach) \\\n[Apache 2.0](https://github.com/TomerAberbach/svkc/blob/main/license-apache) ©\n[Google](https://github.com/TomerAberbach/svkc/blob/main/notice-apache)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomeraberbach%2Fsvkc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomeraberbach%2Fsvkc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomeraberbach%2Fsvkc/lists"}