🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

array-binarysearch

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-binarysearch - npm Package Compare versions

Comparing version

to
0.0.4

10

index.js
const compare = require('number-compare');
function binarySearch(arr, val, fn=compare, ths=null, bgn=0, end=arr.length) {
function binarySearch(arr, val, bgn=0, end=arr.length) {
while(bgn<end) {
var m = (bgn+end)>>>1;
if(arr[m]<val) bgn = m+1;
else if(arr[m]>val) end = m;
else return m;
}
return -1;
};

2

package.json
{
"name": "array-binarysearch",
"version": "0.0.3",
"version": "0.0.4",
"description": "Get index of value in sorted array.",

@@ -5,0 +5,0 @@ "main": "index.js",