{"_id":"sorted-indexof","_rev":"237619","name":"sorted-indexof","description":"Given two sorted arrays, a and b, efficiently return an array of indexes of b's elements in a.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2023-03-24T16:40:21.000Z","created":"2017-06-02T16:25:30.732Z","1.0.0":"2017-06-02T16:25:30.732Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sorted-indexof.git"},"versions":{"1.0.0":{"name":"sorted-indexof","version":"1.0.0","description":"Given two sorted arrays, a and b, efficiently return an array of indexes of b's elements in a.","main":"index.js","dependencies":{},"devDependencies":{"standard":"^10.0.2","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sorted-indexof.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sorted-indexof/issues"},"homepage":"https://github.com/mafintosh/sorted-indexof","gitHead":"7baec339aaf0fae77e459c9f5d0081414a57f4f9","_id":"sorted-indexof@1.0.0","_shasum":"17c742ff7cf187e2f59a15df9b81f17a62ce0899","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"17c742ff7cf187e2f59a15df9b81f17a62ce0899","size":2041,"noattachment":false,"key":"/sorted-indexof/-/sorted-indexof-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/sorted-indexof/download/sorted-indexof-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sorted-indexof-1.0.0.tgz_1496420729828_0.6786240069195628"},"directories":{},"publish_time":1496420730732,"_hasShrinkwrap":false,"_cnpm_publish_time":1496420730732,"_cnpmcore_publish_time":"2021-12-17T00:24:32.591Z"}},"readme":"# sorted-indexof\n\nGiven two sorted arrays, a and b, efficiently return an array of indexes\nof b's elements in a.\n\nRuns in `O(n+m)` where n and m are the sizes of the sorted arrays.\n\n```\nnpm install sorted-indexof\n```\n\n[![Build Status](https://travis-ci.org/mafintosh/sorted-indexof.svg?branch=master)](https://travis-ci.org/mafintosh/sorted-indexof)\n\n## Usage\n\n``` js\nvar indexOf = require('sorted-indexof')\n\nvar a = ['b', 'c', 'd', 'e', 'f']\nvar b = ['a', 'b', 'c', 'f', 'g', 'h']\n\nconsole.log(indexOf(a, b))\n```\n\nRunning the above returns\n\n```\n[ -1, 0, 1, 4, -1, -1 ]\n```\n\nWhich corresponds to taking each element of `b` and running `a.indexOf(el)`.\n\n## API\n\n#### `var indexes = indexOf(a, b)`\n\nReturns an array of indexes of `b`s elements in `a`.\nAn an element in `b` does not exist in `a`, `-1` is inserted.\n\nNote that `a` and `b` MUST be sorted.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/sorted-indexof","bugs":{"url":"https://github.com/mafintosh/sorted-indexof/issues"},"license":"MIT"}