binarysearch
Advanced tools
Comparing version 0.2.4 to 1.0.0
12
index.js
@@ -130,2 +130,3 @@ | ||
var indexMode,indexModeSearch; | ||
var stringMode; | ||
return function(v,search){ | ||
@@ -141,3 +142,12 @@ // support the object format of generated indexes | ||
return v - search; | ||
if(stringMode === undefined){ | ||
stringMode = false | ||
if(typeof search === 'string' || typeof v === "string"){ | ||
stringMode = true | ||
} | ||
} | ||
if(stringMode) v = v+'' | ||
return v > search ? 1 : v < search ? -1 : 0 | ||
}; | ||
@@ -144,0 +154,0 @@ }; |
{ | ||
"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.4", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -12,6 +12,3 @@ "url": "git://github.com/soldair/node-binarysearch.git" | ||
}, | ||
"contributors":[ | ||
"Ryan Day <soldair@gmail.com>", | ||
"Nicolas LaCasse <nicolas.lacasse@gmail.com> (https://github.com/nlacasse)" | ||
], | ||
"author": "Ryan Day <soldair@gmail.com>", | ||
"dependencies": {}, | ||
@@ -18,0 +15,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14365
327
1