source: node_modules/es-toolkit/dist/compat/array/sortedIndexOf.js

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 554 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const sortedIndex = require('./sortedIndex.js');
6const isEqualsSameValueZero = require('../../_internal/isEqualsSameValueZero.js');
7
8function sortedIndexOf(array, value) {
9 if (!array?.length) {
10 return -1;
11 }
12 const index = sortedIndex.sortedIndex(array, value);
13 if (index < array.length && isEqualsSameValueZero.isEqualsSameValueZero(array[index], value)) {
14 return index;
15 }
16 return -1;
17}
18
19exports.sortedIndexOf = sortedIndexOf;
Note: See TracBrowser for help on using the repository browser.