enforceParsed
This commit is contained in:
parent
da98a3e86e
commit
b8a9d97a99
1 changed files with 6 additions and 0 deletions
|
@ -179,6 +179,12 @@ class Validator extends Matcher {
|
|||
return result.data;
|
||||
}
|
||||
|
||||
/// Validates, and filters input data after running [autoParse], and throws an error if it is invalid.
|
||||
///
|
||||
/// Otherwise, the filtered data is returned.
|
||||
Map<String, dynamic> enforceParsed(Map inputData, List<String> fields) =>
|
||||
enforce(autoParse(inputData, fields));
|
||||
|
||||
/// Creates a copy with additional validation rules.
|
||||
Validator extend(Map<String, dynamic> schema,
|
||||
{Map<String, dynamic> defaultValues: const {},
|
||||
|
|
Loading…
Reference in a new issue