Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

binary-search

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binary-search - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

8

index.js

@@ -10,3 +10,3 @@ module.exports = function(haystack, needle, comparator) {

mid = 0,
high = (haystack.length - 1) >>> 0,
high = haystack.length - 1,
cmp = 0;

@@ -17,3 +17,3 @@

* to double (which gives the wrong results). */
mid = (low + ((high - low) >> 1)) >>> 0;
mid = low + (high - low >> 1);
cmp = comparator(haystack[mid], needle)|0;

@@ -23,7 +23,7 @@

if(cmp < 0)
low = (mid + 1) >>> 0;
low = mid + 1;
/* Too high. */
else if(cmp > 0)
high = (mid - 1) >>> 0;
high = mid - 1;

@@ -30,0 +30,0 @@ /* Key found. */

{
"name": "binary-search",
"version": "1.1.0",
"version": "1.1.1",
"description": "tiny binary search function with comparators",

@@ -5,0 +5,0 @@ "author": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc