Commit Graph

5 Commits

Author SHA1 Message Date
Jacob Trimble 47533d1173 Add an enumerable() method for loops.
This is a helper to aid in iterating over items.  This returns a list
of objects that contain:
- "item": The current value.
- "prev": The previous value in the list.
- "next": The next value in the list.
- "i": The zero-based index in the list.

Issue #1518

Change-Id: Id18ab977e3ae45dfbfd2b4137a1bffb6e53c6bce
2019-06-27 16:31:42 +00:00
Jacob Trimble 0dd64074b9 Only allow one statement per line.
With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.

Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
2019-05-13 22:11:50 +00:00
Joey Parrish 3b25bc9bf1 Fix compiler complaints about Iterable|Iterator
Instead of Iterable|Iterator, just use Iterable.  Iterators are, after
all, Iterable themselves.

Caught by a newer compiler/linter that we have not been able to fully
adopt yet.

Change-Id: I85c03a9193e6dc0b315b3bf30e70fe7be7c718df
2018-11-09 14:28:49 -08:00
Aaron Vaage 74b97ed428 Add Iterables Filter Method
Added a filter method for iterables so that we can filter any type
of collection without first needing to convert it over to an
array.

Change-Id: I28919e271672649d13d3b6c2e6902d0ff549a2ee
2018-11-01 14:24:17 -07:00
Aaron Vaage c47ecb859e Create Array-Like Methods For Iterable
To avoid always having to create arrays to do array-like methods
I have created a util that recreates some of those simple yet useful
methods that will act on any iterable or iterator.

This should make it easier to work with Set and Map.

Change-Id: Iec868fda4c9d018f813e824ea197ef914436fee3
2018-09-21 00:36:39 +00:00