verifyMap function
Implementation
Option<String> verifyMap(
Map<String, dynamic> upperJson,
List<String> fields,
) {
var errors = <String>[];
fields.forEach((key) {
if (!upperJson.containsKey(key)) {
errors.add('field $key is required;');
}
});
if (errors.isNotEmpty) {
return some(errors
.toString()
.replaceFirst('[', '')
.replaceFirst(']', '')
.replaceAll(', ', '\n'));
}
{
return none();
}
}