validate static method

dynamic validate(
  1. Map<String, dynamic> map
)

Implementation

static validate(Map<String, dynamic> map) {
  final keys = map.keys.toList();
  for (final key in keys) {
    if (!availableOptions.contains(key)) {
      throw Exception(
        '''Invalid option: $key \n
          Available Options: ${availableOptions.join(', ')}''',
      );
    }
  }
  return map;
}