import { xCheck } from "./xCheck.js";
import { xGetFromToIndex } from "./xGetFromToIndex.js";
/**
 * Computes the index of the minimum of the given values.
 * @param array - array of numbers
 * @param options - options
 * @returns - index
 */
export function xMinIndex(array, options = {}) {
    xCheck(array);
    const { fromIndex, toIndex } = xGetFromToIndex(array, options);
    let minIndex = fromIndex;
    for (let i = fromIndex + 1; i <= toIndex; i++) {
        if (array[i] < array[minIndex]) {
            minIndex = i;
        }
    }
    return minIndex;
}
//# sourceMappingURL=xMinIndex.js.map