"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function findInsertPositionInArray(sortedArray, value, compareFn) {
  let left = 0;
  let right = sortedArray.length;
  while (left < right) {
    const mid = Math.floor((left + right) / 2);
    const comparison = compareFn(sortedArray[mid], value);
    if (comparison < 0) {
      left = mid + 1;
    } else {
      right = mid;
    }
  }
  return left;
}
function deleteInSortedArray(sortedArray, value, compareFn) {
  const idx = findInsertPositionInArray(sortedArray, value, compareFn);
  if (idx < sortedArray.length && compareFn(sortedArray[idx], value) === 0) {
    sortedArray.splice(idx, 1);
    return true;
  }
  return false;
}
exports.deleteInSortedArray = deleteInSortedArray;
exports.findInsertPositionInArray = findInsertPositionInArray;
//# sourceMappingURL=array-utils.cjs.map
