{"_id":"@a11d/bidirectional-map","_rev":"2-3415a7130c4cb3a30e4f8be13b3066e5","name":"@a11d/bidirectional-map","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@a11d/bidirectional-map","version":"0.1.0","keywords":["map","bidirectional","bimap","bijective-map"],"author":{"name":"a11delavar"},"license":"MIT","_id":"@a11d/bidirectional-map@0.1.0","maintainers":[{"name":"arshia11d","email":"a11delavar@outlook.com"}],"homepage":"https://github.com/a11delavar/lit#readme","bugs":{"url":"https://github.com/a11delavar/lit/issues"},"dist":{"shasum":"e3dbfebb0045d54e8d2aee9b13f216a3a3a2f6a5","tarball":"https://registry.npmjs.org/@a11d/bidirectional-map/-/bidirectional-map-0.1.0.tgz","fileCount":8,"integrity":"sha512-SkX5ikySxj3lBJh9Ooi4kJxOLF5xP1Mo0OIW2bysgTkQQz00Qv+kscu/kDd2ISBgo0nRiP4/KgdyaGDZo1QfdQ==","signatures":[{"sig":"MEUCIQCgz9UnkyWPF/Rk9OkckTHDWu2q1uawpSbrWVBE4dmkKAIgN6EwkQPY6qDbIScVi+IBJNU/kjurNvtTZ346QFtp3Dk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39775},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","gitHead":"851e4753e1f384607659e8dde30ee98d94aa9624","_npmUser":{"name":"arshia11d","email":"a11delavar@outlook.com"},"repository":{"url":"git+https://github.com/a11delavar/lit.git","type":"git"},"_npmVersion":"10.2.5","description":"A bidirectional map for JavaScript","directories":{},"_nodeVersion":"21.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bidirectional-map_0.1.0_1703513418802_0.3182427849720939","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@a11d/bidirectional-map","version":"0.1.1","description":"Map with bidirectional lookups - query by key or value","repository":{"type":"git","url":"git+https://github.com/a11delavar/lit.git"},"keywords":["map","bidirectional","bimap","bijective-map","reverse-lookup"],"author":{"name":"a11delavar"},"license":"MIT","homepage":"https://github.com/a11delavar/lit#readme","type":"module","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"fe645e24e144d274aa728b08410b15d9da3b608f","_id":"@a11d/bidirectional-map@0.1.1","bugs":{"url":"https://github.com/a11delavar/lit/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.6.4","dist":{"integrity":"sha512-ja4w+rmCaYD0tLARK14agXq1v4x1h7P9vV+1WQjHRVVOBwmXBJmjUwI84K6HlZXVqWiXcI+p3RRdF9IfbcESgQ==","shasum":"4fa99f65b14a376ac9859db9374b7c5426230816","tarball":"https://registry.npmjs.org/@a11d/bidirectional-map/-/bidirectional-map-0.1.1.tgz","fileCount":9,"unpackedSize":38450,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD4fTgX+TEOQLiIfpJJ+U36A3SNA9963qJ9oYVkFY7y6AIgBR2+JL3fM/BFoEz9bjceVNoWlsUyKA5OlmntExaaOPE="}]},"_npmUser":{"name":"arshia11d","email":"a@delavar.net"},"directories":{},"maintainers":[{"name":"arshia11d","email":"a@delavar.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bidirectional-map_0.1.1_1765220626458_0.2391870126461193"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-25T14:10:18.741Z","modified":"2025-12-08T19:03:46.838Z","0.1.0":"2023-12-25T14:10:18.944Z","0.1.1":"2025-12-08T19:03:46.615Z"},"bugs":{"url":"https://github.com/a11delavar/lit/issues"},"author":{"name":"a11delavar"},"license":"MIT","homepage":"https://github.com/a11delavar/lit#readme","keywords":["map","bidirectional","bimap","bijective-map","reverse-lookup"],"repository":{"type":"git","url":"git+https://github.com/a11delavar/lit.git"},"description":"Map with bidirectional lookups - query by key or value","maintainers":[{"name":"arshia11d","email":"a@delavar.net"}],"readme":"# `@a11d/bidirectional-map`\n\nA Map implementation that maintains a bidirectional relationship between keys and values, allowing lookups in both directions.\n\n```typescript\nimport '@a11d/bidirectional-map'\n\nconst map = new BidirectionalMap([\n\t['en', 'English'],\n\t['fr', 'French'],\n])\n\nmap.get('en') // 'English'\nmap.getKey('English') // 'en'\n```\n\n## Installation\n\n```bash\nnpm install @a11d/bidirectional-map\n```\n\n## API\n\nImplements the standard `Map<K, V>` interface with additional methods:\n\n<details>\n<summary><code>getKey(value: V): K | undefined</code> — Get key by value (reverse lookup)</summary>\n\n```typescript\nconst map = new BidirectionalMap([['en', 'English'], ['fr', 'French']])\nmap.getKey('English') // 'en'\nmap.getKey('Spanish') // undefined\n```\n</details>\n\n<details>\n<summary><code>hasValue(value: V): boolean</code> — Check if a value exists</summary>\n\n```typescript\nconst map = new BidirectionalMap([['en', 'English']])\nmap.hasValue('English') // true\nmap.hasValue('French') // false\n```\n</details>\n\n<details>\n<summary><code>deleteValue(value: V): boolean</code> — Remove entry by value</summary>\n\n```typescript\nconst map = new BidirectionalMap([['en', 'English']])\nmap.deleteValue('English') // true\nmap.has('en') // false\n```\n</details>\n\n## Global Type\n\nThe package automatically registers itself globally, so TypeScript recognizes `BidirectionalMap` without explicit imports:\n\n```typescript\n// Type is available globally\nconst map: BidirectionalMap<string, number> = new BidirectionalMap()\n```\n","readmeFilename":"README.md"}