arrayNodeOrNull<T> method
Get JsonArray or null by String key.
Throws SquintException if key is not found.
Implementation
JsonArray<List<T>>? arrayNodeOrNull<T>(
String key, {
Function? decoder,
List? childType,
}) {
final element = byKey(key);
if (element.data == null) {
return null;
}
var array = byKey(key).data as List;
if (decoder != null) {
array = array.map((value) => decoder(value)).toList();
}
return JsonArray<List<T>>(
key: key,
data: array.cast<T>().toList(),
);
}