import { iterator } from "./_internal/iterator.mjs";
//#region src/iterator/range.ts
function range(start, end, step = 1) {
	if (end == null) {
		end = start;
		start = 0;
	}
	if (!Number.isInteger(step) || step === 0) throw new Error(`The step value must be a non-zero integer, but got ${step}.`);
	const finalEnd = end;
	let current = start;
	return iterator(function() {
		if (step > 0 ? current >= finalEnd : current <= finalEnd) return {
			value: void 0,
			done: true
		};
		const value = current;
		current += step;
		return {
			value,
			done: false
		};
	});
}
//#endregion
export { range };
