import { I } from "https://deno.land/x/ahh@v0.10.0/src/iter/mod.ts";
Creates an Iterator
that is Peekable
.
Examples
import { I } from "./mod.ts";
const iter = I.peekable(I.iter([1, 2, 3]));
console.log(iter.next()); // 1
console.log(iter.peek()); // 2
console.log(iter.next()); // 2
console.log(iter.next()); // 3
console.log(iter.peek()); // undefined
console.log(iter.next()); // undefined