mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Remove semicolons.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import baseSortedIndex from './.internal/baseSortedIndex.js';
|
||||
import eq from './eq.js';
|
||||
import baseSortedIndex from './.internal/baseSortedIndex.js'
|
||||
import eq from './eq.js'
|
||||
|
||||
/**
|
||||
* This method is like `indexOf` except that it performs a binary
|
||||
@@ -12,18 +12,18 @@ import eq from './eq.js';
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* sortedIndexOf([4, 5, 5, 5, 6], 5);
|
||||
* sortedIndexOf([4, 5, 5, 5, 6], 5)
|
||||
* // => 1
|
||||
*/
|
||||
function sortedIndexOf(array, value) {
|
||||
const length = array == null ? 0 : array.length;
|
||||
const length = array == null ? 0 : array.length
|
||||
if (length) {
|
||||
const index = baseSortedIndex(array, value);
|
||||
const index = baseSortedIndex(array, value)
|
||||
if (index < length && eq(array[index], value)) {
|
||||
return index;
|
||||
return index
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return -1
|
||||
}
|
||||
|
||||
export default sortedIndexOf;
|
||||
export default sortedIndexOf
|
||||
|
||||
Reference in New Issue
Block a user