File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,14 @@ export class ValidateHeaders extends Feature<ValidateHeadersOptions> {
41
41
HeadersClass : HeaderClass ,
42
42
{ whitelist, strict } : HeadersValidatorOptions = { } ,
43
43
) : HeadersProps {
44
- const groups = [
44
+ const validatorGroups = [
45
45
locale === DEFAULT_LOCALE_KEY
46
46
? ValidationGroup . Main
47
47
: ValidationGroup . I18n ,
48
48
] ;
49
49
50
50
const transformerGroups = whitelist
51
- ? groups
51
+ ? validatorGroups
52
52
: [ ValidationGroup . Main , ValidationGroup . I18n ] ;
53
53
54
54
const headers = plainToInstance ( HeadersClass , headersProps , {
@@ -63,16 +63,12 @@ export class ValidateHeaders extends Feature<ValidateHeadersOptions> {
63
63
forbidNonWhitelisted : true ,
64
64
whitelist : true ,
65
65
stopAtFirstError : false ,
66
- groups : [
67
- locale === DEFAULT_LOCALE_KEY
68
- ? ValidationGroup . Main
69
- : ValidationGroup . I18n ,
70
- ] ,
66
+ groups : validatorGroups ,
71
67
} ) ;
72
68
73
69
if ( errors . length > 0 ) {
74
70
throw new Error (
75
- `Validation groups: ${ groups } \n` +
71
+ `Validation groups: ${ validatorGroups } \n` +
76
72
errors
77
73
. map ( ( err ) => err . toString ( undefined , undefined , undefined , true ) )
78
74
. join ( '\n' ) ,
You can’t perform that action at this time.
0 commit comments