{"id":16720283,"url":"https://github.com/tomokimiyauci/composite-key","last_synced_at":"2026-06-23T07:31:32.134Z","repository":{"id":175276769,"uuid":"653647775","full_name":"TomokiMiyauci/composite-key","owner":"TomokiMiyauci","description":"Composite keys, TC39 proposal-richer-keys of compositeKey implementation","archived":false,"fork":false,"pushed_at":"2024-07-06T05:02:40.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T01:26:02.039Z","etag":null,"topics":["composite","composite-key","gc","proposal-richer-keys","tc39","weak-map"],"latest_commit_sha":null,"homepage":"https://jsr.io/@miyauci/composite-key","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/TomokiMiyauci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-14T13:03:03.000Z","updated_at":"2025-02-24T18:09:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a6620bc-14fa-45b0-b8a9-493961dec68b","html_url":"https://github.com/TomokiMiyauci/composite-key","commit_stats":null,"previous_names":["tomokimiyauci/composite-key"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/TomokiMiyauci/composite-key","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fcomposite-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fcomposite-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fcomposite-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fcomposite-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomokiMiyauci","download_url":"https://codeload.github.com/TomokiMiyauci/composite-key/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fcomposite-key/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34680620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","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":["composite","composite-key","gc","proposal-richer-keys","tc39","weak-map"],"created_at":"2024-10-12T22:06:27.410Z","updated_at":"2026-06-23T07:31:32.112Z","avatar_url":"https://github.com/TomokiMiyauci.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# composite-key\n\n[![JSR](https://jsr.io/badges/@miyauci/composite-key)](https://jsr.io/@miyauci/composite-key)\n[![codecov](https://codecov.io/gh/TomokiMiyauci/composite-key/graph/badge.svg?token=gLgydtlHEF)](https://codecov.io/gh/TomokiMiyauci/composite-key)\n[![GitHub](https://img.shields.io/github/license/TomokiMiyauci/composite-key)](https://github.com/TomokiMiyauci/composite-key/blob/main/LICENSE)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n\nComposite keys, TC39\n[proposal-richer-keys, compositeKey](https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey)\nimplementation.\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\n- [Install](#install)\n- [Usage](#usage)\n  - [compositeKey](#compositekey)\n  - [compositeSymbol](#compositesymbol)\n  - [Polyfill](#polyfill)\n- [API](#api)\n- [License](#license)\n\n## Install\n\ndeno:\n\n```bash\ndeno add @miyauci/composite-key\n```\n\nnode:\n\n```bash\nnpx jsr add @miyauci/composite-key\n```\n\n## Usage\n\n### compositeKey\n\nReturn reference consisting of a component. This allows using a `Map`, `Set` and\n`WeakMap` to weakly and/or privately associate data with the lifetime of a group\nof values.\n\nIt requires at least one component must be object that can be placed in a\n`WeakMap`.\n\n```ts\nimport { compositeKey } from \"@miyauci/composite-key\";\nimport { assertEquals, assertNotEquals } from \"@std/assert\";\n\ndeclare const fn: (a: number, b: number) =\u003e number;\n\nassertEquals(compositeKey(fn, 0, 1), compositeKey(fn, 0, 1));\nassertNotEquals(compositeKey(fn, 1, 0), compositeKey(fn, 0, 1));\n\n// @ts-expect-error it require one of more object.\ncompositeKey(0, 1);\n```\n\n### compositeSymbol\n\nReturn `Symbol` consisting of a component. This allows strongly attaching data\nto an object that is associated with a group of values.\n\n```ts\nimport { compositeSymbol } from \"@miyauci/composite-key\";\nimport { assertEquals, assertNotEquals } from \"@std/assert\";\n\ndeclare const object: object;\n\nassertEquals(compositeSymbol(0, 1), compositeSymbol(0, 1));\nassertEquals(compositeSymbol(0, object), compositeSymbol(0, object));\n\nassertNotEquals(compositeSymbol(0), compositeSymbol(1));\nassertNotEquals(compositeSymbol(0, {}), compositeSymbol(0, {}));\n```\n\n### Polyfill\n\nPolyfill affects the global object. You must be very careful when using it.\n\n```ts\nimport \"@miyauci/composite-key/polyfill\";\nimport { assert } from \"@std/assert\";\n\nassert(compositeKey);\nassert(compositeSymbol);\n```\n\n## API\n\nSee [jsr doc](https://jsr.io/@miyauci/composite-key) for all APIs.\n\n## License\n\nCopyright © 2023-present [Tomoki Miyauchi](https://github.com/TomokiMiyauci).\n\nReleased under the [MIT](./LICENSE) license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomokimiyauci%2Fcomposite-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomokimiyauci%2Fcomposite-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomokimiyauci%2Fcomposite-key/lists"}