mapIsLast<T> method

Iterable<T> mapIsLast<T>(
  1. T f(
    1. E e,
    2. bool isLast
    )
)

Implementation

Iterable<T> mapIsLast<T>(T Function(E e, bool isLast) f) {
  var i = -1;

  return map((e) {
    i++;
    return f(e, i == (length - 1));
  });
}