{"_id":"@afoot/index-lookup","_rev":"1-018c2aeae6cdb47a47ad598d8446eec9","name":"@afoot/index-lookup","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@afoot/index-lookup","version":"0.1.0","description":"Generate an index of ids from an array of objects for quick lookup.","author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"keywords":["module","typescript","array"],"entry":"index.ts","license":"MIT","scripts":{"prebuild":"npm run clean","build":"rollup -c rollup.config.js -i src/index.ts","build:prod":"npm run build && npm run types","prepack":"npm run build:prod && npm run prep:umd","clean":"rm -rf dist/*","types":"tsc","test":"jest","test:coverage":"jest --coverage","docs":"typedoc","prep:umd":"node ./scripts/init-umd-config.js"},"browserslist":["defaults"],"repository":{"type":"git","url":"https://github.com/niftinessafoot/"},"type":"module","types":"dist/types/index.d.ts","main":"dist/umd/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","require":"./dist/umd/index.js","import":"./dist/esm/index.js","default":"./dist/umd/index.js"},"./standalone":{"types":"./dist/types/index.d.ts","require":"./dist/umd/standalone.js","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js"},"./legacy":"./dist/umd/legacy.js"},"devDependencies":{"@babel/cli":"^7.20.7","@babel/core":"^7.20.12","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@rollup/plugin-babel":"^6.0.3","@types/jest":"^29.4.0","@typescript-eslint/eslint-plugin":"^5.51.0","@typescript-eslint/parser":"^5.51.0","eslint":"^8.33.0","eslint-config-prettier":"^8.6.0","eslint-plugin-tsdoc":"^0.2.17","jest":"^29.4.1","jest-environment-jsdom":"^29.4.1","prettier":"^2.8.3","rollup":"^2.79.1","rollup-plugin-terser":"^7.0.2","typedoc":"^0.23.24","typedoc-plugin-markdown":"^3.14.0","typescript":"^4.9.5"},"gitHead":"6720ec7ff0c14cbd9440aa34c77726a2e377c69d","_id":"@afoot/index-lookup@0.1.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-ATLHXVR2O5a+7dPPsAID5+5CU9/RElWLl1t22HkWeif9s1QfHFyohBB27V7ClP578+pQYjyOqbbB3Yj93LXk3Q==","shasum":"2411f9649554f9dec165af6c172c3582100b6efb","tarball":"https://registry.npmjs.org/@afoot/index-lookup/-/index-lookup-0.1.0.tgz","fileCount":16,"unpackedSize":15579,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGvPpTJcZJVpTmXWUML0KgJVxN2Ngp2st8oozrKoa+flAiBTuzKEbtJL14I/YjpZz/uyWYbBsOT6fvOw/5Ndlv0mkg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4a0pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiGQ//d75JyGRq2fajNV+T5VM/+RGcm1GnoTt2kuuNa8VzYBW/DuW6\r\nQ6WVPWcyRPXim81HTjyQBfErG3lPgBpaPDxAlp22OrIKRN4ZDU+3r+zIduyh\r\nOYkk70jjC+OAHBXD2RW6eFR6K9eS99sKx7ZchXwHVz5o3/iWcXboMKC+Y9i8\r\n+5LFVny+wxNm+BGCZHI2XUayJ8irdKZ3IhbyfeE0oEGcGORRRB4QjzNQjhjM\r\nuhgH8hZrDSW6nv11qYHdiZ2We3bvrgODTrowT4+OfWwB9vH3UZ0JuhYlJDRo\r\nIXXqBOF631wLjxGMlLtGNwuF2rTAV/6Byu1jNJwKZJr1MQV/7yaRFddJLY/K\r\ntQ5gTc7gOYer7cbe7WKwk/bCKpvVQZylGmvVMM0ubDXuq3BLx2r3HaoEC0Lw\r\npcmVdzwCv09oJtfYGR6BHXqB4VJeSql2XhPFwhqLU2HkNxXC6i5o4zgn51aM\r\nNU4sgsgfuP9IuP+OVdmQvQedSbu0we9bxoLNJ7RN+9DJev8bE+wfgRVYaKhU\r\n2cC4yzHbGN9nJf3p7NqIDOncrxQDuqADRR6KIKUnC9PQ0ibuXnwsTSvWjXL0\r\niwK6x+yjjHkrxrkhJVo7DHLvcp3hU4VXFQjS+g1OrXMYNbVqXHen7zhmqV/3\r\nVlmSU2aBq+4t1AG1IVaTUuTQNOby5/ZK7js=\r\n=m9M+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"directories":{},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/index-lookup_0.1.0_1675734312988_0.46142900732787884"},"_hasShrinkwrap":false},"0.1.1":{"name":"@afoot/index-lookup","version":"0.1.1","description":"Generate an index of ids from an array of objects for quick lookup.","author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"keywords":["module","typescript","array"],"entry":"index.ts","license":"MIT","scripts":{"prebuild":"npm run clean","build":"rollup -c rollup.config.js -i src/index.ts","build:prod":"npm run build && npm run types","prepack":"npm run build:prod && npm run prep:umd","clean":"rm -rf dist/*","types":"tsc","test":"jest","test:coverage":"jest --coverage","docs":"typedoc","prep:umd":"node ./scripts/init-umd-config.js"},"browserslist":["defaults"],"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/index-lookup.git"},"homepage":"https://github.com/niftinessafoot/index-lookup","type":"module","types":"dist/types/index.d.ts","main":"dist/umd/index.js","module":"dist/esm/index.js","exports":{".":{"types":"./dist/types/index.d.ts","require":"./dist/umd/index.js","import":"./dist/esm/index.js","default":"./dist/umd/index.js"},"./standalone":{"types":"./dist/types/index.d.ts","require":"./dist/umd/standalone.js","import":"./dist/esm/standalone.js","default":"./dist/umd/legacy.js"},"./legacy":"./dist/umd/legacy.js"},"devDependencies":{"@babel/cli":"^7.20.7","@babel/core":"^7.20.12","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@rollup/plugin-babel":"^6.0.3","@types/jest":"^29.4.0","@typescript-eslint/eslint-plugin":"^5.51.0","@typescript-eslint/parser":"^5.51.0","eslint":"^8.33.0","eslint-config-prettier":"^8.6.0","eslint-plugin-tsdoc":"^0.2.17","jest":"^29.4.1","jest-environment-jsdom":"^29.4.1","prettier":"^2.8.3","rollup":"^2.79.1","rollup-plugin-terser":"^7.0.2","typedoc":"^0.23.24","typedoc-plugin-markdown":"^3.14.0","typescript":"^4.9.5"},"gitHead":"db967df29dde91d5cf459cd646f3373e84e2e4c9","bugs":{"url":"https://github.com/niftinessafoot/index-lookup/issues"},"_id":"@afoot/index-lookup@0.1.1","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-gJrKGsOQQeigsGx9E8ZvNOOyX8Lruk+3mniIzWPu5ZbW37nlAqz7Li0ZsHnrnBDN9lrVSZ/8lyyRwN2UkeDXKg==","shasum":"e353697b66b8761c9369598488b0902c88f72a91","tarball":"https://registry.npmjs.org/@afoot/index-lookup/-/index-lookup-0.1.1.tgz","fileCount":16,"unpackedSize":15655,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnUqVwYfeqY0kmQundi/dZUw1wZLo7iwc+OUZuaxWZeAiAroTgGxny9jR6hyD+PsYZ8VQUB2b6dX6MHIwhWZ9Kd2g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4a+uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKkxAAi9AcY8eQ9EUQ4LPBZPSdmeUc/Y3XsfeyO8ihdh4HdwpvFfRD\r\nGTb8Mp91R9I/4Py2XkmPVnq4W2oBzRR9ft4XlAab4KUtZDV8beVGAA2OJ1RX\r\ngiMAsF2uKmcD+2VXwt9WxIwAaTt/bEuNm1w9IFfouFOyKnoUY26Nf5JhMWzW\r\nxrNFwL6ZqFG61Mj+SZLFjEeO9UILTQOirV7xHF0UeDeEQ6+uV84hEfI1nnJD\r\nXMnlam3Ezgbh1HBC7MIAU8OXkDWi+O4ei+++FpOhv17V0uOBhONzVGJVI8BA\r\n5YUS5yuTWWiG4DoF7PDBiR1ZximpvfZ4iNcDiBEMGUJMaO1dwfG/cCs21fgS\r\n7bQWxKVudGUhMTkfKGI3+jtApbsvVmQ8z56lTF8UKR78gLTUpIzr+dqnedAr\r\nPufbalQmFN7U+QcH6DZAs3OKxCYfgmTHq4z4tjWdsJ1CtXYg14li54sWYQjp\r\nMrp7/Fev/N355tuoe+B4PSPoXAGkRvfCKl8UNXKl685kRfGdwwvfIgdTBl/H\r\nI3dK53rITg5AK1I4y4cD1q2DjqnImW4bnI6je7DElQ1Z7QRFbbABstl0cJC0\r\nKgDClRUS2v9VDfc2rB1uJUjpsJ04Wz4CogqnsE2XkT2njmYW5gOT4vD8+Sk/\r\nos7zDRG9dbLA6uAb722L39xWyhR9RbNGsqY=\r\n=Ye7+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"},"directories":{},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/index-lookup_0.1.1_1675734958544_0.3613774402740966"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-07T01:45:12.901Z","0.1.0":"2023-02-07T01:45:13.241Z","modified":"2023-02-07T01:55:58.819Z","0.1.1":"2023-02-07T01:55:58.734Z"},"maintainers":[{"name":"niftinessafoot","email":"niftinessafoot@gmail.com"}],"description":"Generate an index of ids from an array of objects for quick lookup.","keywords":["module","typescript","array"],"repository":{"type":"git","url":"git+https://github.com/niftinessafoot/index-lookup.git"},"author":{"name":"Matthew Smith","email":"code@niftinessafoot.com","url":"https://www.niftinessafoot.com"},"license":"MIT","readme":"# Index Lookup\n\nAn ESM module for generating a lookup index from an array of object literals.\n\nMade this specifically when working with MongoDB documents and pairing reference IDs between query results.\n\n## usage\n\n```js\nimport { indexLookup } from '@afoot/index-lookup';\nconst fetchResults = [\n  {\n    _id: 'abc',\n    name: 'Tacos',\n    ingredients: ['beans', 'cheese'],\n  },\n  {\n    _id: 'def',\n    name: 'Pizza',\n    ingredients: ['tomatoes', 'cheese'],\n  },\n];\n\nconst lookup = indexLookup('_id', fetchResults);\nconsole.log(lookup); // Returns ['abc','def'];\n// You now have a quick lookup to find corresponding objects.\nconst otherResults = [\n    {\n      name: 'Tom',\n      favoriteFoodId: 'def'\n    };\n  ]\nconst foodId = lookup.indexOf(otherResults[0].favoriteFood); // returns 1\nconst favoriteFoodName = fetchResults[foodId].name; // Returns `Pizza`\n```\n\n## license\n\n[MIT](./LICENSE) © [Matthew Smith](http://www.niftinessafoot.com)\n\n## made with ❤️ and ☕️ by\n\n![Niftiness Afoot!](https://gist.githubusercontent.com/niftinessafoot/2dba588395cb557293d5f09aebcd2ab0/raw/770293c76bead4f0986ff959f3ea8880017d92c0/bot.svg?sanitize=true) [Matthew Smith](https://github.com/niftinessafoot)\n","readmeFilename":"README.md","homepage":"https://github.com/niftinessafoot/index-lookup","bugs":{"url":"https://github.com/niftinessafoot/index-lookup/issues"}}