{"_id":"@bemoje/arr-sorted-index-of","_rev":"5-3565c45999fcd38eb7f9f33f7622713f","name":"@bemoje/arr-sorted-index-of","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bemoje/arr-sorted-index-of","version":"1.0.0","keywords":["binary","search","-based","indexof","sorted","arrays","arr","array","element","find","[compare]","[comparenumeric=false]","sort","numerically","defaults","lexicographic/alphabetic","[comparedescending=false]","descending","order","ascending","[comparearray=false]","nested","compared","recursively","[compareby=undefined]","index","callbackelement","object","keys","dot-notation","support","returns","-1","found","elements","position","callback","type","definition","getter","arrsortedindexof"],"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","_id":"@bemoje/arr-sorted-index-of@1.0.0","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"homepage":"https://github.com/bemoje/bemoje-arr-sorted-index-of#readme","bugs":{"url":"https://github.com/bemoje/bemoje-arr-sorted-index-of/issues","email":"bemoje@gmail.com"},"dist":{"shasum":"b642a424e9c57aea6dbb2c07859f654e5a4437b3","tarball":"https://registry.npmjs.org/@bemoje/arr-sorted-index-of/-/arr-sorted-index-of-1.0.0.tgz","fileCount":5,"integrity":"sha512-YWWNGwdmHuYvsvphH839PZtRrUZGilcyRgI3kCaMaofj+tGFyyJKBecRYN/XLC1F++u3cbFZaNHLix31tpLHhA==","signatures":[{"sig":"MEUCIFYZUMbp8mexqixdSIuVD2F1OKmtZ1gufLpYKTCWrQtKAiEAnZgmsfxso5wJRUDzJFhNm0KavKE0ikmbodLohIIN4C8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqX25CRA9TVsSAnZWagAAyLcP/RM2OFXRsB87JrVstRdb\nAkAa6OW9enkSP30IYIwJowz1miKPAvGYvDufUvTv9qyxaV+F8HvMDZcpMatf\n2D8jtE6xNUWlzYlCVywpdio05rEbhFWC9era7MAABgnvgwDpSdBGjGkFY7mF\ngEtfcf02c89KvL8IdA1nd0O57hnN/cfzYdLay0xFhdMWwh35BxdZ31LXcfym\n2edtLU8sxv/pj48J6gBh+Xkqaf4mSaJJrBBuZZybx37yKqsFce8ZG6bverGg\nNMmHf1F/T4rRPQ1TINfnOBpVxTOTKlXmDiE/q0Exo59iIK2UmKJ53nEob+hm\nAlq2Mj4QrdgONdmFkp4WLqCQRONc7bQpVMOrFHiTJ5XtjYFlzxd7Ph4AQseA\ng7WNbdaZelLQT3xTYxvMOfys8uP+2c3pwJRQCOfLVqld8zx3f5FlmKeYbPMt\nspgwkAx6yO6YD9zWgPibtYUwRFd67MV3MX75/8tKRGfPKRgH1DLCD5IKU+CD\nwpFSxLcbvyw1BHJaxlCpbyWrvaJuVaRUMaKsZT7hyDsUqcVg/YkGMS4W2w3h\nM8G9C/cnfTrS6Y2aMfKYMyqJlk/bN4FyUYnH6SW5+neHHVqkqXjp3Cfoe9/2\n/ot+f/PPHPsRHZ4ybCvXEMk27LgKBz7jw3cvjDLPQkZsjNjM8eYAuhVYlYni\nqUW0\r\n=RRNm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/arr-sorted-index-of.umd.js","github":{"user":"bemoje"},"module":"dist/arr-sorted-index-of.esm.js","browser":"dist/arr-sorted-index-of.umd.js","scripts":{"docs":"documentation build src/** -f md -o docs/api.md && documentation build src/** -f html -o docs","repo":"node -r esm scripts/repo.js","test":"jest","bench":"node -r esm benchmark/arr-sorted-index-of.benchmark.js","build":"npm run test && npm run bench && npm run rollup && npm run docs && npm run description && npm run keywords && npm run readme","clean":"rimraf","major":"npm run repo bumpVersionMajor","minor":"npm run repo bumpVersionMinor","patch":"npm run repo bumpVersionPatch","start":"node -r esm src/arr-sorted-index-of.js","commit":"npm run repo gitCommit","readme":"npm run repo writeReadme","rename":"npm run repo rename","rollup":"rollup -c","example":"node -r esm examples/arr-sorted-index-of.example.js","publish":"npm run repo npmPublish","version":"npm run repo version","keywords":"npm run repo keywords","git-create":"rimraf .git && npm run repo gitCreate","git-delete":"rimraf .git && bash scripts/github-delete.sh bemoje bemoje-arr-sorted-index-of","description":"npm run repo description"},"_npmUser":{"name":"bemoje","email":"bemoje@gmail.com"},"repository":{"url":"git+https://github.com/bemoje/bemoje-arr-sorted-index-of.git","type":"git"},"_npmVersion":"6.12.1","description":"Binary search  -based indexOf for sorted arrays.","directories":{},"_nodeVersion":"12.13.0","dependencies":{"@bemoje/assert-args":"^1.0.0","@bemoje/assert-type":"^1.0.0","@bemoje/arr-sort-comparator":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^24.9.0","path":"^0.12.7","rimraf":"^3.0.2","rollup":"^1.32.1","fs-extra":"^9.0.0","hirestime":"^6.0.1","walk-sync":"^2.1.0","babel-core":"^6.26.3","babel-jest":"^25.4.0","documentation":"^12.3.0","babel-preset-env":"^1.7.0","keyword-extractor":"0.0.18","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/arr-sorted-index-of_1.0.0_1588166072962_0.6916460747278226","host":"s3://npm-registry-packages"},"deprecated":"Package is not maintained."},"1.0.1":{"name":"@bemoje/arr-sorted-index-of","version":"1.0.1","keywords":["binary","search","-based","indexof","sorted","arrays","arr","array","element","find","[compare]","[comparenumeric=false]","sort","numerically","defaults","lexicographic/alphabetic","[comparedescending=false]","descending","order","ascending","[comparearray=false]","nested","compared","recursively","[compareby=undefined]","index","callbackelement","object","keys","dot-notation","support","returns","-1","found","elements","position","comparator","function","callback","definition","compare","negative","number",">","positive","<","type","getter","arrsortedindexof"],"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","_id":"@bemoje/arr-sorted-index-of@1.0.1","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"homepage":"https://github.com/bemoje/bemoje-arr-sorted-index-of#readme","bugs":{"url":"https://github.com/bemoje/bemoje-arr-sorted-index-of/issues","email":"bemoje@gmail.com"},"dist":{"shasum":"09121d1c6429b875a1705f78afa4174a4e71abe8","tarball":"https://registry.npmjs.org/@bemoje/arr-sorted-index-of/-/arr-sorted-index-of-1.0.1.tgz","fileCount":5,"integrity":"sha512-yXAGpqD+XaiH+PtVe6DhHpHMDgpxs1cIWHBRdvZfJ368e5yyaj2w3Cji+U8XjHVsGfnwBIhFsy1+02oVPuTapA==","signatures":[{"sig":"MEQCICG/YZZqsuTW9mACUyl2NgERzmg20lpE6P+jLZ90PGmOAiBNnBuU2tbiwjae9dXt6Hqsy9DSrL9DDAEIwD24YhvOcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqfryCRA9TVsSAnZWagAA/L8P/Row4Ofy5zCwTA++oDOh\ntxYy+y3H0bEmzTrvRvzeEIlbQwhqaKr04cvUVUttQyFG0EnBQKilv+Vpu71F\naJcDkdgmCtznQc1P3echo+QbRo6wkYGHObSMCLquBWLJUZK+QA7oZJhzpO9m\nFy3+tGFJVqOW/x5kqn8j/FWZVA6I9UtcXNCVx6bkFliP15sBXtOqDcwrCFIU\nupvX9L2dcJVm56FwLdHnTD3suVdar0D7D8FnqVkV/qq2hqyHzZbFM+ZA81Qp\nU6sE//39UqzxKIHcbG9OYRynaNeX+gaolmQUJr5NhZpjONt8qhmm7wMbGc2d\nWebWHvzjEkNZDdtP5/SwxEiuI7zDKnNUBVpW9TvexStQxxQH8q1LZmPNt4FC\n397RhWzNatPAUhN2xonzAqCe1untk9ft8Bfq07QayVHZwGc70ha6B0qaD4Ei\nJMS4K6h6KQGpK7COMHlTmvBJylQG8Lk5VwQe92lnkV8Z++M5D4whv8U0BrLx\nIIDojjMkaaaMMB1CaU/0WaXnFGK2HcaXfZ08cJWaKP4jN4YmoAHrxlpiRYOa\n4s7/0UO64ePj5NsLSk6Sw1juocdzPLQcUSZUZUi0kexryGMvWBIeC+DQ1ScM\n11DQnwnaeaSzO0N5NRdvVrSDW3mQVDc6hsUjT7vh3q9xgErMth+72HAQpOoe\nvXqP\r\n=ku06\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/arr-sorted-index-of.umd.js","github":{"user":"bemoje"},"module":"dist/arr-sorted-index-of.esm.js","browser":"dist/arr-sorted-index-of.umd.js","gitHead":"7729906b83de442505ad269ae55c232d87331152","scripts":{"docs":"documentation build src/** -f md -o docs/api.md && documentation build src/** -f html -o docs","repo":"node -r esm scripts/repo.js","test":"jest","bench":"node -r esm benchmark/arr-sorted-index-of.benchmark.js","build":"npm run test && npm run bench && npm run rollup && npm run docs && npm run description && npm run keywords && npm run readme","clean":"rimraf","major":"npm run repo bumpVersionMajor","minor":"npm run repo bumpVersionMinor","patch":"npm run repo bumpVersionPatch","start":"node -r esm src/arr-sorted-index-of.js","commit":"npm run repo gitCommit","readme":"npm run repo writeReadme","rename":"npm run repo rename","rollup":"rollup -c","example":"node -r esm examples/arr-sorted-index-of.example.js","publish":"npm run repo npmPublish","version":"npm run repo version","keywords":"npm run repo keywords","git-create":"rimraf .git && npm run repo gitCreate","git-delete":"rimraf .git && bash scripts/github-delete.sh bemoje bemoje-arr-sorted-index-of","description":"npm run repo description"},"_npmUser":{"name":"bemoje","email":"bemoje@gmail.com"},"repository":{"url":"git+https://github.com/bemoje/bemoje-arr-sorted-index-of.git","type":"git"},"_npmVersion":"6.12.1","description":"Binary search  -based indexOf for sorted arrays.","directories":{},"_nodeVersion":"12.13.0","dependencies":{"@bemoje/assert-args":"^1.0.0","@bemoje/assert-type":"^1.0.0","@bemoje/arr-sort-comparator":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^24.9.0","path":"^0.12.7","rimraf":"^3.0.2","rollup":"^1.32.1","fs-extra":"^9.0.0","hirestime":"^6.0.1","walk-sync":"^2.1.0","babel-core":"^6.26.3","babel-jest":"^25.4.0","documentation":"^12.3.0","babel-preset-env":"^1.7.0","keyword-extractor":"0.0.18","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/arr-sorted-index-of_1.0.1_1588198129267_0.1951838274901312","host":"s3://npm-registry-packages"},"deprecated":"Package is not maintained."},"1.0.2":{"name":"@bemoje/arr-sorted-index-of","version":"1.0.2","keywords":["binary","search","-based","indexof","sorted","arrays","arr","array","element","find","[compare]","[comparenumeric=false]","sort","numerically","defaults","lexicographic/alphabetic","[comparedescending=false]","descending","order","ascending","[comparearray=false]","nested","compared","recursively","[compareby=undefined]","index","callbackelement","object","keys","dot-notation","support","returns","-1","found","elements","position","comparator","function","callback","definition","compare","negative","number",">","positive","<","type","getter","arrsortedindexof"],"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","_id":"@bemoje/arr-sorted-index-of@1.0.2","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"homepage":"https://github.com/bemoje/bemoje-arr-sorted-index-of#readme","bugs":{"url":"https://github.com/bemoje/bemoje-arr-sorted-index-of/issues","email":"bemoje@gmail.com"},"dist":{"shasum":"33c1fa6b2f767ecf6ba75f6f5032a4dd3277dd17","tarball":"https://registry.npmjs.org/@bemoje/arr-sorted-index-of/-/arr-sorted-index-of-1.0.2.tgz","fileCount":5,"integrity":"sha512-mNSEIY4xg2k3mP8sshPOfa7TY2F0tSkThRT0UFtSD5g090DaeBoUVBD0dkEC+uKNZgqVuFQ2C3gDwjbllkasuQ==","signatures":[{"sig":"MEYCIQD/K6urvdczu2NLMqUWkFZEaVuPzWu8mPE6g60eFqDj3QIhAImpahmPHLLCzHvB3wyyTZxboWUx9zOyzFlY9ftmgs7r","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqsGoCRA9TVsSAnZWagAA+4UP/RXp6wREK5FQBbbS8tr9\nqnb7sPpD5Gr61vCEiyI+kzk3NZKv/go88uwngfusjpxzXPCd8jsUYQfMHuLa\nwuVl94xY4Z72DDkHWBn+8YGNsMpYJx684kz2g7bIGa0p2uDy9iU7McX4PQOj\nDgHDncMPY49ydtPmBOYKiy9ciudqVbt+GTgJVeqoVPNJrroPJkeXAZFQ6AZe\nGCBS9aOlxsnI0czXt6SY88/jzBvv5Xp39OL8B7okPZfUX323up26pXqjNaHA\nJ3wMMfIcfRnYNrTsUfbeh8cvUXbySgM6Uy9tIQNxpxDCKCrGuyrIYrwjIzr+\nvoTyjtpdMCAyBEhVld37yf66XhjCUnaA/REroTCfFgAh9dpyXCHF34bYXoz1\nFyazmY/swBRlsJRjCTUl5TCjH5RDcka7Yy/3G2q3NtO3gjMm3yTcxML/Kv1H\nYkEle33JDpwsMJZGwxzR0VVgYnmNuF1HpLIocoRjuZr1eGED6mH+fM7mRD1y\nuU4Q+Ez6MIs1vpTIamH1r5H63SGWQaWF8HA/rSiYjLWzWXQwY/n54QjcIFAE\nXKc2tc8Cc8j3eOVE7nBQNdRyBYM5bcxIGXZ/OP37be2/R1bMPAzAEJTvU5Po\n1evmmCAmPU/Qs9oKXsIEN0nwD6wa+3UOFjPkn3pn/aelECjaGi0DS7MGveQr\npuL7\r\n=y4o8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/arr-sorted-index-of.umd.js","github":{"user":"bemoje"},"module":"dist/arr-sorted-index-of.esm.js","browser":"dist/arr-sorted-index-of.umd.js","gitHead":"3a98b6da79c4a9bfb03af23f905a20f724f209df","scripts":{"docs":"documentation build src/** -f md -o docs/api.md && documentation build src/** -f html -o docs","repo":"node -r esm scripts/repo.js","test":"jest","bench":"node -r esm benchmark/arr-sorted-index-of.benchmark.js","build":"npm run test && npm run bench && npm run rollup && npm run docs && npm run description && npm run keywords && npm run readme","clean":"rimraf","major":"npm run repo bumpVersionMajor","minor":"npm run repo bumpVersionMinor","patch":"npm run repo bumpVersionPatch","start":"node -r esm src/arr-sorted-index-of.js","commit":"npm run repo gitCommit","readme":"npm run repo writeReadme","rename":"npm run repo rename","rollup":"rollup -c","example":"node -r esm examples/arr-sorted-index-of.example.js","publish":"npm run repo npmPublish","version":"npm run repo version","keywords":"npm run repo keywords","git-create":"rimraf .git && npm run repo gitCreate","git-delete":"rimraf .git && bash scripts/github-delete.sh bemoje bemoje-arr-sorted-index-of","description":"npm run repo description"},"_npmUser":{"name":"bemoje","email":"bemoje@gmail.com"},"repository":{"url":"git+https://github.com/bemoje/bemoje-arr-sorted-index-of.git","type":"git"},"_npmVersion":"6.12.1","description":"Binary search  -based indexOf for sorted arrays.","directories":{},"_nodeVersion":"12.13.0","dependencies":{"@bemoje/assert-args":"^1.0.0","@bemoje/assert-type":"^1.0.0","@bemoje/arr-sort-comparator":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^24.9.0","path":"^0.12.7","rimraf":"^3.0.2","rollup":"^1.32.1","fs-extra":"^9.0.0","hirestime":"^6.0.1","walk-sync":"^2.1.0","babel-core":"^6.26.3","babel-jest":"^25.5.1","documentation":"^12.3.0","babel-preset-env":"^1.7.0","keyword-extractor":"0.0.18","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/arr-sorted-index-of_1.0.2_1588248999588_0.4152749116186645","host":"s3://npm-registry-packages"},"deprecated":"Package is not maintained."}},"time":{"created":"2020-04-29T13:14:32.911Z","modified":"2025-06-17T23:55:49.523Z","1.0.0":"2020-04-29T13:14:33.108Z","1.0.1":"2020-04-29T22:08:49.433Z","1.0.2":"2020-04-30T12:16:39.688Z"},"bugs":{"url":"https://github.com/bemoje/bemoje-arr-sorted-index-of/issues","email":"bemoje@gmail.com"},"author":{"url":"https://github.io/bemoje/","name":"Benjamin M. Jensen","email":"bemoje@gmail.com"},"license":"MIT","homepage":"https://github.com/bemoje/bemoje-arr-sorted-index-of#readme","keywords":["binary","search","-based","indexof","sorted","arrays","arr","array","element","find","[compare]","[comparenumeric=false]","sort","numerically","defaults","lexicographic/alphabetic","[comparedescending=false]","descending","order","ascending","[comparearray=false]","nested","compared","recursively","[compareby=undefined]","index","callbackelement","object","keys","dot-notation","support","returns","-1","found","elements","position","comparator","function","callback","definition","compare","negative","number",">","positive","<","type","getter","arrsortedindexof"],"repository":{"url":"git+https://github.com/bemoje/bemoje-arr-sorted-index-of.git","type":"git"},"description":"Binary search  -based indexOf for sorted arrays.","maintainers":[{"name":"bemoje","email":"bemoje@gmail.com"}],"readme":"# @bemoje/arr-sorted-index-of\n\nBinary search  -based indexOf for sorted arrays.\n\n#### Version\n\n<span><a href=\"https://npmjs.org/@bemoje/arr-sorted-index-of\" title=\"View this project on NPM\"><img src=\"https://img.shields.io/npm/v/@bemoje/arr-sorted-index-of\" alt=\"NPM version\" /></a></span>\n\n#### Travis CI\n\n<span><a href=\"https://npmjs.org/@bemoje/arr-sorted-index-of\" title=\"View this project on NPM\"><img src=\"https://travis-ci.org/bemoje/bemoje-arr-sorted-index-of.svg?branch=master\" alt=\"dependencies\" /></a></span>\n\n#### Dependencies\n\n<span><a href=\"https://npmjs.org/@bemoje/arr-sorted-index-of\" title=\"View this project on NPM\"><img src=\"https://david-dm.org/bemoje/bemoje-arr-sorted-index-of.svg\" alt=\"dependencies\" /></a></span>\n\n#### Stats\n\n<span><a href=\"https://npmjs.org/@bemoje/arr-sorted-index-of\" title=\"View this project on NPM\"><img src=\"https://img.shields.io/npm/dt/@bemoje/arr-sorted-index-of\" alt=\"NPM downloads\" /></a></span>\n<span><a href=\"https://github.com/bemoje/bemoje-arr-sorted-index-of/fork\" title=\"Fork this project\"><img src=\"https://img.shields.io/github/forks/bemoje/bemoje-arr-sorted-index-of\" alt=\"Forks\" /></a></span>\n\n#### Donate\n\n<span><a href=\"https://www.buymeacoffee.com/bemoje\" title=\"Donate to this project using Buy Me A Beer\"><img src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?label=Buy me a beer!\" alt=\"Buy Me A Beer donate button\" /></a></span>\n<span><a href=\"https://paypal.me/forstaaloen\" title=\"Donate to this project using Paypal\"><img src=\"https://img.shields.io/badge/paypal-donate-yellow.svg?label=PayPal\" alt=\"PayPal donate button\" /></a></span>\n\n## Installation\n\n```sh\nnpm install @bemoje/arr-sorted-index-of\nnpm install --save @bemoje/arr-sorted-index-of\nnpm install --save-dev @bemoje/arr-sorted-index-of\n```\n\n## Usage\n\n```javascript\n\nimport arrSortedIndexOf from '@bemoje/arr-sorted-index-of'\n\nconst alpha = ['a', 'b', 'c']\n\narrSortedIndexOf(alpha, 'b')\n//=> 1\n\narrSortedIndexOf(alpha, 'e')\n//=> -1\n\nconst numeric = [2, 13, 20]\n\narrSortedIndexOf(numeric, 20, {\n  numeric: true,\n})\n//=> 2\n\narrSortedIndexOf(numeric, 20, (a, b) => {\n  return a - b\n})\n//=> 2\n\nconst arrays = [\n  [192, 168, 0, 0],\n  [192, 168, 0, 1],\n  [192, 168, 1, 0],\n]\n\narrSortedIndexOf(arrays, [192, 168, 0, 1], {\n  numeric: true,\n  arrays: true,\n})\n//=> 1\n\nlet elem\n\nconst objectsByName = [\n  { name: 'bonzo', age: 9 },\n  { name: 'john', age: 7 },\n]\n\nelem = { name: 'john', age: 7 }\n\narrSortedIndexOf(objectsByName, elem, {\n  by: 'name',\n})\n//=> 1\n\nconst objectsByAge = [\n  { name: 'john', age: 7 },\n  { name: 'bonzo', age: 9 },\n]\n\nelem = { name: 'john', age: 7 }\n\narrSortedIndexOf(objectsByAge, elem, {\n  by: 'age',\n})\n//=> 0\n\nconst valuesByAge = [\n  ['john', 7],\n  ['bonzo', 9],\n]\n\nelem = ['bonzo', 9]\n\narrSortedIndexOf(objectsByAge, elem, {\n  by: 1,\n})\n//=> 1\n\nconst valuesByFirstInt = [\n  ['john', 'johnson', 7],\n  ['tracy', 'chapman', 9],\n]\n\nelem = ['tracy', 'chapman', 9]\n\narrSortedIndexOf(valuesByFirstInt, elem, {\n  by: (arrElem) => {\n    for (let val of arrElem) {\n      if (Number.isInteger(val)) {\n        return val\n      }\n    }\n  },\n})\n//=> 1\n\n```\n\n\n## Tests\nUses *Jest* to test module functionality. Run tests to get coverage details.\n\n```bash\nnpm run test\n```\n\n## API\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n#### Table of Contents\n\n-   [arrSortedIndexOf][1]\n\n    -   [Parameters][2]\n\n-   [comparator][3]\n\n    -   [Parameters][4]\n\n-   [getter][5]\n\n    -   [Parameters][6]\n\n## arrSortedIndexOf\n\nBinary search  -based indexOf for sorted arrays.\n\n##### Parameters\n\n-   `arr` **[Array][7]** The array to search\n\n-   `element` **any** The element to find\n\n-   `compare` **([comparator][8] \\| [object][9])?** \n\n    -   `compare.numeric` **[boolean][10]** Sort numerically. Defaults to lexicographic/alphabetic sort. (optional, default `false`)\n\n    -   `compare.descending` **[boolean][10]** Sort in descending order. Defaults to ascending order. (optional, default `false`)\n\n    -   `compare.array` **[boolean][10]** Sort arrays. Nested arrays are also compared recursively. (optional, default `false`)\n\n    -   `compare.by` **([number][11] \\| [string][12] \\| [getter][13])** Sort by either array index, a callback(element): any - or by object keys with dot-notation support. (optional, default `undefined`)\n\nReturns **[number][11]** Returns -1 if not found, if found, returns the elements index position.\n\n## comparator\n\nComparator function callback definition.\n\nType: [Function][14]\n\n##### Parameters\n\n-   `a` **any** The first value to compare\n\n-   `b` **any** The second value to compare\n\nReturns **[number][11]** A negative number if a > b, a positive number if a &lt; b, 0 otherwise.\n\n## getter\n\nCallback type definition.\n\nType: [Function][14]\n\n##### Parameters\n\n-   `a` **any** The value\n\nReturns **any** The value to be compared\n\n[1]: #arrsortedindexof\n\n[2]: #parameters\n\n[3]: #comparator\n\n[4]: #parameters-1\n\n[5]: #getter\n\n[6]: #parameters-2\n\n[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\n\n[8]: #comparator\n\n[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n\n[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String\n\n[13]: #getter\n\n[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function","readmeFilename":"readme.md"}