{"_id":"key-master","_rev":"13-9b7dc2ae221b17286ffd3a07e221c3ae","name":"key-master","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","dist-tags":{"latest":"4.1.0"},"versions":{"1.0.0":{"name":"key-master","version":"1.0.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"tape":"^4.0.0"},"gitHead":"8c0cd3324fab1341d3910a8b7228e5f06568392a","_id":"key-master@1.0.0","_shasum":"44893abf74cce39e23b779e68fb72488d2fc3997","_from":".","_npmVersion":"2.9.0","_nodeVersion":"2.0.1","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"shasum":"44893abf74cce39e23b779e68fb72488d2fc3997","tarball":"https://registry.npmjs.org/key-master/-/key-master-1.0.0.tgz","integrity":"sha512-5P+ZhphHoESOGhRNDi0x8IgF4F8oUnmTQMp1kRzEoo+lNhUeSeYuT3BKm3WYWVRBOOKHM5jPZjQDppyvhGFlOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHvTlIQeAqK+7N8nWjwhVA0tATh651WbXPkFGTZRX1VwIhAJVhiXbv4X0UE2x1e+lyZfze3FSCdAVcdYGaZLiUIFYF"}]},"directories":{}},"1.1.0":{"name":"key-master","version":"1.1.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"tape":"^4.0.0"},"gitHead":"c05ef0ddc7f15e575a0200cf0e20031e85b2e5f9","_id":"key-master@1.1.0","_shasum":"b69cf8f40f46823ecb31ad9fde4789bb895e778c","_from":".","_npmVersion":"2.6.1","_nodeVersion":"0.10.35","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"dist":{"shasum":"b69cf8f40f46823ecb31ad9fde4789bb895e778c","tarball":"https://registry.npmjs.org/key-master/-/key-master-1.1.0.tgz","integrity":"sha512-Zq094B6XCf+XRvECjHawxTYbWtO0GTj/xANBGkuItjF8+FLVu9ZiBRtMUM8cOINNuCC4Ge8M2K6dEYakjFxEYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdgEoxpZksn/7Nwaj9VhE/+nnbeiT8kz/W+qFOrnoIUAIhAKCRmtUfQ4s3u3E2lAoWc2guZAbEeggyS0t6ovgeE7nT"}]},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"directories":{}},"1.2.0":{"name":"key-master","version":"1.2.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"tape":"^4.0.0"},"gitHead":"ffc09407c813aa038e45cf879c2bb7ec3443fdf1","_id":"key-master@1.2.0","_shasum":"de098efa9a5781bf6d27a84bbad69501426e6c9b","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"shasum":"de098efa9a5781bf6d27a84bbad69501426e6c9b","tarball":"https://registry.npmjs.org/key-master/-/key-master-1.2.0.tgz","integrity":"sha512-o/vlRNRTdZhcE1CrODQwXxL+jH/Uyom7ZqSysXV52R1gWsBzi96NyAbrowkyOyNFSQylZMUm3kCJGlFIFOy4YQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNdijtBvQJ6o+c4eAk4pBV5iu9FansaT2SZMhontC8SAIhAKtPqYwWi86n0yXvikhzrJVGt6/IVdCVTsErV6ZNgrpg"}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/key-master-1.2.0.tgz_1472254942198_0.7038593413308263"},"directories":{}},"2.0.0":{"name":"key-master","version":"2.0.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"tape":"^4.0.0"},"gitHead":"10ee045f7c36e44ea5f50c60f6c6aa0b695c3cfc","_id":"key-master@2.0.0","_shasum":"9f9366f03d4770118b5a697297aea4b8f9cf6b7c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"shasum":"9f9366f03d4770118b5a697297aea4b8f9cf6b7c","tarball":"https://registry.npmjs.org/key-master/-/key-master-2.0.0.tgz","integrity":"sha512-nMoXEYFvSEQV+hkw23Pdys7RGGt78G1ejURl4wBmrCRfZODVuKgPemlacI7Fxv/ySwdvWTK/yVbi4LvG3n3DvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDa5cZ7LXDRiq7I8vqfHFcgQIkYZCowO8GP24uHGTswAIgUb3SYKkctAU1IFdoqxmzmh0PnOV94i1gjMPdQSYcfp8="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/key-master-2.0.0.tgz_1472260109921_0.41565771913155913"},"directories":{}},"2.0.1":{"name":"key-master","version":"2.0.1","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"tape":"^4.0.0"},"gitHead":"4fd1161eee73489fe06352e4b2e7204a54a63786","_id":"key-master@2.0.1","_shasum":"eccef51f3754eeb493814d6655a450c7ff8d5020","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"dist":{"shasum":"eccef51f3754eeb493814d6655a450c7ff8d5020","tarball":"https://registry.npmjs.org/key-master/-/key-master-2.0.1.tgz","integrity":"sha512-6rLtxdFTpVhWr4I08nswtDhod82Ef3yaHPn2bXpIrQAagmNZFGtUAbY1JF+96TF/nhTQFMeAM7NBBvuy8O+y+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6XTVu9YdMLQhXGUsMftYy/MBBKeNida27FVaEMqH3AAiEAkAkm2W0Da4g0ChEOpY2f2tWa+mJrB+v48qhxJkJwWuI="}]},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/key-master-2.0.1.tgz_1473695068724_0.037697245599702"},"directories":{}},"2.0.2":{"name":"key-master","version":"2.0.2","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js && jsmd readme.md"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"jsmd":"0.3.1","tape":"^4.0.0"},"gitHead":"9af0a09544af1f01080643e67aa74677e08a202d","_id":"key-master@2.0.2","_shasum":"a7e2e13c468f8d13e5e607e781af96e785d81eae","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.2.1","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"shasum":"a7e2e13c468f8d13e5e607e781af96e785d81eae","tarball":"https://registry.npmjs.org/key-master/-/key-master-2.0.2.tgz","integrity":"sha512-77arYJbNr3dhcUgC6tHET7hESYHdtwdMKhH2GhMagSTvGBwVxJi9nwIptQL78AgkZJ5M7MB/G5R3G9a5VCmNrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkcf/NIZmBzWpBPReuevrw2aYzBndpFCR4niqxkE3AvQIhAP6kyHYjLgn4RKFc6TUTxkVGgu1VSGp3I1Rfxcc7xkjS"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/key-master-2.0.2.tgz_1486846955119_0.8226918911095709"},"directories":{}},"3.0.0":{"name":"key-master","version":"3.0.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js && jsmd readme.md"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"jsmd":"0.3.1","tape":"^4.0.0"},"gitHead":"65855dd3c10782ae78ed3bad35612437be2e950f","_id":"key-master@3.0.0","_npmVersion":"5.2.0","_nodeVersion":"8.1.2","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"integrity":"sha512-+aM6HOCj5VOwNG0INYC57jBN6jdkjAonK49KjDl1QhyWs/nULJPTa5XS2weY1cdjzuEBkDqgZumlM+nHPyMjpQ==","shasum":"fc0401eb007d4b41139ab9f0c29603ddceb51ef9","tarball":"https://registry.npmjs.org/key-master/-/key-master-3.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIETN6iV4IXNLSxhSks8UKE4d9z2fTN1LTz5ST6MM7V4bAiEAzzFAW5u68cARrDN7T+xlNB++DJDF5ZVu6LG5nXx4bFM="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/key-master-3.0.0.tgz_1500130158502_0.2698774167802185"},"directories":{}},"3.1.0":{"name":"key-master","version":"3.1.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js && jsmd readme.md"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"jsmd":"0.3.1","tape":"^4.0.0"},"gitHead":"f8de3cfdb3ce6fda327d7f089a54d4ce97d062a6","_id":"key-master@3.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"integrity":"sha512-peu6Yj3avUJUHLd2ES1NMNEtOkaJPn9BTwIJ0z1ah9CiSUwymuy6uQroPv3FcbFIlLtOKAo6dqVSEZZaY0HmYQ==","shasum":"68990134cd52285b6a7b4cb43b4f8b91c0826793","tarball":"https://registry.npmjs.org/key-master/-/key-master-3.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0SSRSorPcYFPEwDXqozXkaR8i+5Md2s2xvxa/3eZmhAiBx40Yv0k51aOesPTs7iPCPpEJasnLtIk2RwkHjwA7zXQ=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/key-master-3.1.0.tgz_1502995387472_0.6982062512543052"},"directories":{}},"4.0.0":{"name":"key-master","version":"4.0.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"test":"tape test.js && jsmd readme.md"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"jsmd":"1.0.0","tape":"4.9.1"},"gitHead":"f52862994648cf7c42e52c56f5c5343014fb2199","_id":"key-master@4.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"dist":{"integrity":"sha512-yEO7Twi4tG9q/Y0WinAiMoeDHIGJTfB8/f8KwVbP9Sz74g+zn4CjIGWl9d3hn7TiLJQR4zd0s83jT/4m20HP3w==","shasum":"605cefb0dd18d62088b24f21aa7cb8c6c328dd96","tarball":"https://registry.npmjs.org/key-master/-/key-master-4.0.0.tgz","fileCount":5,"unpackedSize":7350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn7AUCRA9TVsSAnZWagAAN5EP/iayYEjHQUjxkvv5CxBM\nb7Pgj/IjyYGooVJUE28Pf2j2edL3htOWkN8CFBgJotlldzn1QCllyuFOyTYE\nUCLdRJOW4QK1C/lXZaiTzuk6X+uXrsoxFxr0xFzUBbaJhgBDK6sx9ch7V7L+\nTIsCHV7Y9Pv7Ou9lcGA7Ellnj7PRBwJRd2v5/gYYjxk3RbkYP7Nkn79cmQtw\nFvTSv4Yijm8p94iPkbQyo8oI4fJ7IRXAr/kMz1SIeer3ARxaDLiK3DToIGIG\nMQ7qIUFeUj2mfmt4Fe1No03NgM8on4nLM/XM+Czz3j+H7nxgcmLatHGzsckK\nNzU5IcMNHzFSdWIkDMOdtyaFmarofcgozQ1gMvpiqFWUZgbwTpIU695z257T\nuc0Cm9h4Kw0myQdsDIfgAlt2wYbIhPBPg04Ca73OJffW+HjXWC5d0WWKwL1f\nldEjTENgCuLMLA+4lACEaJZihn56Pwptj9Qke33VMUftZPkg+E1tJAdGerOZ\ny26/elFTQWJZVDxeXlcjFiya7kAW/bvo2Y2nkcRHdjloodBI5zJUvMYPgaTg\nmN+tYLYY5XymfJLf6Kl8i0iJtMMDaumhTPpsqdNyl77Frv+ERUMtoLzVXC1z\n3An8ftSnRo8Q9H8E//s2HaBD+Mh3wMzaqb0dHioVLJWxhK9qbhOcuZOpsWSH\ndeUv\r\n=kICW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7lp/5/cx/nio3UK427f7QZdrZFDOHjj1shfgNwobY3AiAdQxkphKKepuzmXDZS8nXVKjWBw4qq8mY+LrB1Y1VzFA=="}]},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/key-master_4.0.0_1537191955799_0.46638693398172015"},"_hasShrinkwrap":false},"4.1.0":{"name":"key-master","version":"4.1.0","description":"hashmap + constructor function = a hashmap you don't have to check before calling get()","main":"index.js","scripts":{"build":"tsc --project .","test":"tslint --project . && tsc --project tsconfig-tests.json && tape test.js && jsmd readme.md"},"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"keywords":["map","hashmap"],"author":{"name":"TehShrike"},"license":"WTFPL","bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"homepage":"https://github.com/TehShrike/key-master","devDependencies":{"jsmd":"^1.0.1","tape":"4.9.1","ts-node":"^8.3.0","tslint":"^5.18.0","typescript":"^3.5.3"},"gitHead":"7edf21bfb5a0bfe0b563bce6df90cb2fe6687afb","_id":"key-master@4.1.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ZSrR9vmpWH6IKpZYtu+n2CJEyJxOL56vIbxGGws0SX/yfTy/mRzKBpKfWtM3+6H+rkWjjDe6J2EJteC57ZVecg==","shasum":"62449825b4531b0aba7afd39396efe1c371580b6","tarball":"https://registry.npmjs.org/key-master/-/key-master-4.1.0.tgz","fileCount":8,"unpackedSize":7896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQzkiCRA9TVsSAnZWagAA95AP/RReUBx3UuPAIrbNWl/3\nVPLxdST4JnS7c+3CKirMbmnZqLZCN4uQzC6N4M22GoPdPuTR5FCoXHcNcrln\nipVvN3GbtlBIjBDhJGU0tDDC+TJusHWxO1nhDhqRWUNtVjn4worvroZMBGTB\n0qwEsSvUAhwDIU65L8/q2zAgOkol3R9G6GzUwmWKk6SAJbx1vSTHAOD586bI\noasR+xtcWqt3kgUBE/R1zOXoRkNzcB3VueljtuvU3bbNHf3AFqLQAbSd3HZH\ndvW4wGmc8X/gBBkKwo5CJDQdh1hf+9bZQma0Du9PENo3n7kaXaYCYGUFEB7P\nbg9+yNV+18ysHNaaZSKK7H33kNB0Sfbmkx/OgHjfSPkYrBNtiQsIeJBL+vjm\nFkhKHY//JNy3CoIbt/40YJ60cNTaLXFLiJc3AXtefIcbxV1x4qkeXsVxeC0Y\nO6I8z2cs7bTHyOguAFnmvJSzko1Ma3ksEtyZMBZBqP8aJNuwsqi056Faxflj\nGzIiGcsrZvl7RW1w/sdqC1gW4a8SSBQZr6kRQVK4MDWbKliMqmBCAfyY7AkV\n/zTlnR0Ry2rCZX7D3zK144oWCxJvidwiT7lCSYHgwkPiN5JHgGyUZT7ZGUPa\nkS/fXX59eWeF6BGZXAiw6id9BYlRYOCMpLBQiOqL2sqSOPaXuUxOOc+zxCOk\nrHG9\r\n=YVnZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFTqMmz+qYxFD7qrAiunV0RcMTDhbDfY4S8QehVjee7gIgYl5S1zsjVdzxZSqBbWvNp4o+xk/gyflYh1OUB3XOPxQ="}]},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/key-master_4.1.0_1564686625823_0.26953658712900097"},"_hasShrinkwrap":false}},"readme":"# key-master\n\nReplaces \"maintain a map of constructed objects\" boilerplate.\n\n[![Build Status](https://travis-ci.org/TehShrike/key-master.svg)](https://travis-ci.org/TehShrike/key-master)\n![TypeScript supported](https://img.shields.io/npm/types/key-master.svg)\n\nSeen this pattern before?\n\n<!-- js\nrequire('ts-node/register')\nvar keyMaster = require('.')\nfunction actuallyDoStuff() {\n\n}\n-->\n\n```js\nconst defaultValue = key => [ key ]\n\nconst myMap = new Map()\n\n// ...\n\nfunction doStuff(thing) {\n\tif (!myMap.has(thing)) {\n\t\tmyMap.set(thing, defaultValue(thing))\n\t}\n\n\tactuallyDoStuff(myMap.get(thing))\n}\n```\n\nI figure I've typed that enough times in my life.  Now I'm going to just use this module.\n\n```js\nconst map = keyMaster(key => defaultValue(key))\n\nmap.get('howdy') // => [ 'howdy' ]\n\nactuallyDoStuff(map.get('howdy'))\n```\n\n# Usage\n\n- Install: `npm install key-master`\n- Use: `const keyMaster = require('key-master')`\n\nThis library uses ES2015 syntax, so if you're deploying to IE11, you'll need to be transpiling your project with Babel or something.\n\n## API\n\n`const map = keyMaster(defaultValueReturningFunction, [map])`\n\nThe `defaultValueReturningFunction` is called whenever the map doesn't already have a value for the given key.\n\nIt is passed the key as its first argument.\n\nThe `map` argument is optional. It can be anything implementing `.get`, `.set`, `.has`, and `.delete`. If not passed in, `keyMaster` will use a new JavaScript [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) by default.\n\n`const map = keyMaster(yourFactory)`\n\n`const map = keyMaster(yourFactory, new WeakMap())`\n\n`const map = keyMaster(yourFactory, new Map())`\n\n`const map = keyMaster(yourFactory, { get, set, has, delete })`\n\n### `value = map.get(key)`\n\nReturns the value in the map.  If there isn't a value for that key, the constructor calls the `defaultValueReturningFunction` that was passed to the constructor, passing in the key.  Whatever the constructor function returns is inserted into the map and returned by `get`.\n\n### `map.set(key, value)`\n\nInserts a value into the map, overwriting anything that might be there.\n\n### `map.delete(key)`\n\nRemoves a value from the map.\n\n### `bool = map.has(key)`\n\nReturns `true` if the key exists in the map, `false` if the key does not exist in the map.\n\n### `jsMap = map.getUnderlyingDataStructure()`\n\nReturns the underlying data structure.  If you passed in a map to the constructor, it returns that.  Otherwise, it returns the plain-old object that was used as a hashmap.\n\n## Using a plain-old-object as a map\n\nIf you want to use an object as a map instead of a `Map` or `WeakMap`, you can use this function to create a map to pass in:\n\n```js\nfunction makeObjectMap() {\n\tvar obj = Object.create(null)\n\n\treturn {\n\t\tget: function(key) {\n\t\t\treturn obj[key]\n\t\t},\n\t\tset: function(key, value) {\n\t\t\tobj[key] = value\n\t\t},\n\t\thas: function(key) {\n\t\t\treturn Object.prototype.hasOwnProperty.call(obj, key)\n\t\t},\n\t\tdelete: function(key) {\n\t\t\tdelete obj[key]\n\t\t},\n\t\tobject: obj\n\t}\n}\n```\n\n# License\n\n[WTFPL](http://wtfpl2.com)\n","maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"time":{"modified":"2022-06-19T08:29:31.609Z","created":"2015-05-12T23:52:47.583Z","1.0.0":"2015-05-12T23:52:47.583Z","1.1.0":"2015-05-13T15:32:38.612Z","1.2.0":"2016-08-26T23:42:23.140Z","2.0.0":"2016-08-27T01:08:31.780Z","2.0.1":"2016-09-12T15:44:30.433Z","2.0.2":"2017-02-11T21:02:37.048Z","3.0.0":"2017-07-15T14:49:19.451Z","3.1.0":"2017-08-17T18:43:08.408Z","4.0.0":"2018-09-17T13:45:55.904Z","4.1.0":"2019-08-01T19:10:26.049Z"},"homepage":"https://github.com/TehShrike/key-master","keywords":["map","hashmap"],"repository":{"type":"git","url":"git+https://github.com/TehShrike/key-master.git"},"author":{"name":"TehShrike"},"bugs":{"url":"https://github.com/TehShrike/key-master/issues"},"license":"WTFPL","readmeFilename":"readme.md"}