parseListOf<T, R> function
Parses s
to a List<R>, where R
is the result of parse
.
def
The default value if s
is invalid.
Implementation
List<R>? parseListOf<T, R>(Object? s, ParserFunction<T, R> parser,
[List<R>? def]) {
if (s == null) return def;
if (s is List) return s.map((e) => parser(e)).toList();
return [parser(s as T)];
}