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

binarysearch

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binarysearch - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

3

index.js

@@ -28,2 +28,5 @@

if(arr.length === 0) return -1;
if(arr.length === 1) return 0;
opts = opts||{};

@@ -30,0 +33,0 @@ if(!comparitor) comparitor = module.exports._defaultComparitor();

2

package.json
{
"name": "binarysearch",
"description": "pure js binary search for sorted javascript arrays||array like objects. returns any || last || first || closest matched key for value, or slice between 2 values where values need not exist.",
"version": "0.2.0",
"version": "0.2.1",
"repository": {

@@ -6,0 +6,0 @@ "url": "git://github.com/soldair/node-binarysearch.git"

@@ -60,1 +60,7 @@ var test = require('tap').test;

test("closest returns -1 on empty array",function(t){
var key = bs.closest([],99);
t.equals(key,-1,key+' should be -1 because i have no data in the array to be close to');
t.end();
});
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