adjustIterable<T> function
Converts a value
to the given IterableKind. If the value is a Iterable
implementation, it will converted to the desired IterableKind. Trying to
convert singular values to a iterable will result in an exception.
Implementation
dynamic adjustIterable<T>(dynamic value, IterableKind kind) {
switch (kind) {
case IterableKind.none:
return value;
case IterableKind.list:
return (value as Iterable).toList();
case IterableKind.set:
return (value as Iterable).toSet();
}
}