0.0.1 • Published 6 years ago

ts-list-zipper v0.0.1

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
6 years ago

ts-list-zipper

A zipper for use with arrays in TS.

import { Zipper } from "Zipper"

let zipper = Zipper.fromCons(1, [2, 3]);

console.log(zipper.current()); // 1

zipper.next();
console.log(zipper.current()); // 2

zipper.next();
console.log(zipper.current()); // 3

zipper.next();
console.log(zipper.current()); // 3

zipper.first();
console.log(zipper.current()); // 1