import { isAnyArray } from 'is-any-array'; function max(input) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (!isAnyArray(input)) { throw new TypeError('input must be an array'); } if (input.length === 0) { throw new TypeError('input must not be empty'); } var _options$fromIndex = options.fromIndex, fromIndex = _options$fromIndex === void 0 ? 0 : _options$fromIndex, _options$toIndex = options.toIndex, toIndex = _options$toIndex === void 0 ? input.length : _options$toIndex; if (fromIndex < 0 || fromIndex >= input.length || !Number.isInteger(fromIndex)) { throw new Error('fromIndex must be a positive integer smaller than length'); } if (toIndex <= fromIndex || toIndex > input.length || !Number.isInteger(toIndex)) { throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length'); } var maxValue = input[fromIndex]; for (var i = fromIndex + 1; i < toIndex; i++) { if (input[i] > maxValue) maxValue = input[i]; } return maxValue; } export { max as default };