{"_id":"@5cover/moremaps","_rev":"3-9f632b80f82b7195d39b67f77708e2d1","name":"@5cover/moremaps","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@5cover/moremaps","version":"1.0.0","author":{"name":"5cover"},"license":"MIT","_id":"@5cover/moremaps@1.0.0","maintainers":[{"name":"5cover","email":"thediscover22450@gmail.com"}],"dist":{"shasum":"71643eca48404c51c2023055e2349483afcf406d","tarball":"https://registry.npmjs.org/@5cover/moremaps/-/moremaps-1.0.0.tgz","fileCount":17,"integrity":"sha512-WV5ij/7s1Kweufd4pt+hKjXPXiQlxI7m55SrgCttwedmpCzMM5ceQhhlyo6paZRdTpI5Ei7SLcZljILzFYDmsQ==","signatures":[{"sig":"MEUCIQD/0U4yzzoQ2vu+m5oUaxw7MfXhpEi/OIlibu2dBwMDmwIgENRrZ+FV1hTbwqKSt3B6GmymwK3Lcv/unbJNkIF6gfQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16950},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"lint":"eslint","test":"tsx --test","build":"tsc -p tsconfig.build.json","prepare":"eslint && tsx --test && tsc -p tsconfig.build.json"},"_npmUser":{"name":"5cover","email":"thediscover22450@gmail.com"},"_npmVersion":"11.6.0","description":"More maps... literally","directories":{},"_nodeVersion":"24.7.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","eslint":"^9.35.0","prettier":"^3.6.2","typescript":"^5.9.2","@types/node":"^24.5.1","@eslint/compat":"^1.3.2","typescript-eslint":"^8.44.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/moremaps_1.0.0_1758156252001_0.4482578345685866","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@5cover/moremaps","version":"1.0.1","author":{"name":"5cover"},"license":"MIT","_id":"@5cover/moremaps@1.0.1","maintainers":[{"name":"5cover","email":"thediscover22450@gmail.com"}],"dist":{"shasum":"5dd9085b6a5b997940db196b10146dd4cc1a3d06","tarball":"https://registry.npmjs.org/@5cover/moremaps/-/moremaps-1.0.1.tgz","fileCount":17,"integrity":"sha512-7lktXibgYK12rSzwjfwyusBtWJX9tC4+skeWiLv6VYPM+OJFdSvRm3l/Fb3dtKChuMVG5qm6+H0sPqt6NZ61TQ==","signatures":[{"sig":"MEUCIQCpGmzMZNiTHgRsC6rzF24KUWVLfRVSi05feKQ5wKeaLAIgemq+RzBK8ioQXCM9HahTGNLLU6cTxLdOCBHfBWFTJuk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16907},"main":"dist/index.js","type":"module","_from":"file:5cover-moremaps-1.0.1.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint","test":"tsx --test","build":"tsc -p tsconfig.build.json"},"_npmUser":{"name":"5cover","email":"thediscover22450@gmail.com"},"_resolved":"/tmp/8a9291daeea6d1a2e2f000baf795272c/5cover-moremaps-1.0.1.tgz","_integrity":"sha512-7lktXibgYK12rSzwjfwyusBtWJX9tC4+skeWiLv6VYPM+OJFdSvRm3l/Fb3dtKChuMVG5qm6+H0sPqt6NZ61TQ==","_npmVersion":"11.11.1","description":"More maps... literally","directories":{},"_nodeVersion":"25.8.2","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","eslint":"^10.1.0","prettier":"^3.8.1","@eslint/js":"^10.0.1","typescript":"^5.9.3","@types/node":"^24.12.0","@eslint/compat":"^1.4.1","typescript-eslint":"^8.58.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/moremaps_1.0.1_1775070626339_0.5908422302435741","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@5cover/moremaps","version":"1.1.0","description":"More maps... literally","license":"MIT","author":{"name":"5cover"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@eslint/compat":"^2.0.5","@eslint/js":"^10.0.1","@types/node":"^25.6.0","eslint":"^10.2.1","eslint-config-prettier":"^10.1.8","prettier":"^3.8.3","tsx":"^4.21.0","typescript":"^6.0.3","typescript-eslint":"^8.59.0"},"scripts":{"test":"tsx --test","build":"tsc -p tsconfig.build.json","lint":"eslint"},"_id":"@5cover/moremaps@1.1.0","_integrity":"sha512-a4CkG0O50ueZUfmRswU1Tbr9sR3c08omuQ1GFEw7EVsfOI5n+qbIJv6V6nscV8/k8ptxlEby/BE108PpCGYN0Q==","_resolved":"/tmp/657429c3c53574ffe057244e3dfdd998/5cover-moremaps-1.1.0.tgz","_from":"file:5cover-moremaps-1.1.0.tgz","_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-a4CkG0O50ueZUfmRswU1Tbr9sR3c08omuQ1GFEw7EVsfOI5n+qbIJv6V6nscV8/k8ptxlEby/BE108PpCGYN0Q==","shasum":"4621b12fc9d99a3998c5466177c849fd163c6e20","tarball":"https://registry.npmjs.org/@5cover/moremaps/-/moremaps-1.1.0.tgz","fileCount":17,"unpackedSize":18573,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCT1C8fHHvK9UpO8Svs9xJMti2jiZTPrxpo+98yVECE7wIhAKodNAsevC1PC8j1ZEs16prxAohHvYVEcPr2YEt3pts1"}]},"_npmUser":{"name":"5cover","email":"thediscover22450@gmail.com"},"directories":{},"maintainers":[{"name":"5cover","email":"thediscover22450@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/moremaps_1.1.0_1777218272533_0.17785683910244932"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-18T00:44:11.885Z","modified":"2026-04-26T15:44:32.920Z","1.0.0":"2025-09-18T00:44:12.188Z","1.0.1":"2026-04-01T19:10:26.497Z","1.1.0":"2026-04-26T15:44:32.789Z"},"author":{"name":"5cover"},"license":"MIT","description":"More maps... literally","maintainers":[{"name":"5cover","email":"thediscover22450@gmail.com"}],"readme":"# More Maps\n\n[![npm version](https://badge.fury.io/js/@5cover/moremaps.svg)](https://badge.fury.io/js/@5cover/moremaps)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA TypeScript library providing enhanced map implementations for JavaScript, including default value maps and object key maps.\n\n## Features\n\n- **DefaultPrimitiveMap**: A map that provides default values for primitive keys (string, number, bigint, boolean, undefined, symbol, null).\n- **DefaultObjectMap**: A map that provides default values for object keys, using custom key-to-primitive converters.\n- **ObjectMap**: A map for object keys, internally using primitive keys for efficient storage.\n- **mapObject**: Utility functions for creating prototype-less, \"map-safe\" objects.\n- **DefaultMap**: Interface for maps that guarantee a value from `get()`.\n\nAll implementations extend or implement the standard `Map` interface where applicable.\n\n## Installation\n\n```bash\nnpm install @5cover/moremaps\n```\n\n## Usage\n\n### DefaultPrimitiveMap\n\n```typescript\nimport DefaultPrimitiveMap from '@5cover/moremaps';\n\nconst map = new DefaultPrimitiveMap<string, number>((key) => key.length);\n\nconsole.log(map.get('hello')); // 5 (default value)\nmap.set('world', 10);\nconsole.log(map.get('world')); // 10\n```\n\n### DefaultObjectMap\n\n```typescript\nimport DefaultObjectMap from '@5cover/moremaps';\n\nconst map = new DefaultObjectMap<{ id: number }, number, string>(\n  () => 0, // default factory\n  (key) => JSON.stringify(key), // key to primitive\n  (prim) => JSON.parse(prim) // primitive to key\n);\n\nconsole.log(map.get({ id: 1 })); // 0 (default)\nmap.set({ id: 1 }, 42);\nconsole.log(map.get({ id: 1 })); // 42\n```\n\n### ObjectMap\n\n```typescript\nimport { ObjectMap } from '@5cover/moremaps';\n\nconst map = new ObjectMap<{ id: number }, string, number>(\n  (key) => key.id, // key to primitive\n  (prim) => ({ id: prim }) // primitive to key\n);\n\nmap.set({ id: 1 }, 'one');\nconsole.log(map.get({ id: 1 })); // 'one'\n```\n\n### mapObject\n\n```typescript\nimport * as mapObject from '@5cover/moremaps';\n\nconst obj = mapObject.create<string, number>();\nobj.key = 42;\nconsole.log(Object.getPrototypeOf(obj)); // null\n\nconst assigned = mapObject.assign({ a: 1, b: 2 });\nconsole.log(assigned.a); // 1\n```\n\n## API\n\nFor detailed API documentation, see the TypeScript definitions in the `dist/` folder or explore the source code in `src/`.\n\n## Contributing\n\nContributions are welcome! Please ensure code follows the project's linting and testing standards.\n\nRun tests:\n\n```bash\nnpm test\n```\n\nBuild:\n\n```bash\nnpm run build\n```\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","readmeFilename":"README.md"}