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.1.1 to 0.1.2

2

index.js

@@ -22,2 +22,4 @@

module.exports.closest = function(arr,search,opts,comparitor) {
if(arr.length === 1) return 0;
if(typeof opts === 'function') {

@@ -24,0 +26,0 @@ opts = {};

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.1.1",
"version": "0.1.2",
"repository": {

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

[![Build Status](https://secure.travis-ci.org/soldair/node-binarysearch.png)](http://travis-ci.org/soldair/node-binarysearch)
node-binarysearch
=================
binarysearch
============

@@ -7,0 +7,0 @@ 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.

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

});
test("can get closest with one item",function(t){
var key = bs.closest([1],3,{end:true});
t.equals(key,0,key+' should have got 0 as key because there is only 1');
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