@@ -141,10 +141,10 @@ module.exports = {
141
141
const propPattern = value . propNamePattern ;
142
142
const prop = propName || propPattern ;
143
143
const options = {
144
- allowList : typeof value === 'string' ? [ ] : ( value . allowedFor || [ ] ) ,
145
- allowPatternList : typeof value === 'string' ? [ ] : value . allowedForPatterns || [ ] ,
146
- disallowList : typeof value === 'string' ? [ ] : ( value . disallowedFor || [ ] ) ,
147
- disallowPatternList : typeof value === 'string' ? [ ] : value . disallowedForPatterns || [ ] ,
144
+ allowList : [ ] . concat ( value . allowedFor || [ ] ) ,
145
+ allowPatternList : [ ] . concat ( value . allowedForPatterns || [ ] ) ,
146
+ disallowList : [ ] . concat ( value . disallowedFor || [ ] ) ,
147
+ disallowPatternList : [ ] . concat ( value . disallowedForPatterns || [ ] ) ,
148
148
message : typeof value === 'string' ? null : value . message ,
149
149
isPattern : ! ! value . propNamePattern ,
150
150
} ;
@@ -169,11 +169,11 @@ module.exports = {
169
169
return false ;
170
170
}
171
171
172
- function checkIsTagForbiddenByAllowList ( ) {
173
- return options . allowList . indexOf ( tagName ) === - 1 ;
174
- }
172
+ function checkIsTagForbiddenByAllowOptions ( ) {
173
+ if ( options . allowList . indexOf ( tagName ) !== - 1 ) {
174
+ return false ;
175
+ }
175
176
176
- function checkIsTagForbiddenByAllowPatternList ( ) {
177
177
if ( options . allowPatternList . length === 0 ) {
178
178
return true ;
179
179
}
@@ -183,15 +183,11 @@ module.exports = {
183
183
) ;
184
184
}
185
185
186
- function checkIsTagForbiddenByAllowOptions ( ) {
187
- return checkIsTagForbiddenByAllowList ( ) && checkIsTagForbiddenByAllowPatternList ( ) ;
188
- }
189
-
190
- function checkIsTagForbiddenByDisallowList ( ) {
191
- return options . disallowList . indexOf ( tagName ) !== - 1 ;
192
- }
186
+ function checkIsTagForbiddenByDisallowOptions ( ) {
187
+ if ( options . disallowList . indexOf ( tagName ) !== - 1 ) {
188
+ return true ;
189
+ }
193
190
194
- function checkIsTagForbiddenByDisallowPatternList ( ) {
195
191
if ( options . disallowPatternList . length === 0 ) {
196
192
return false ;
197
193
}
@@ -201,10 +197,6 @@ module.exports = {
201
197
) ;
202
198
}
203
199
204
- function checkIsTagForbiddenByDisallowOptions ( ) {
205
- return checkIsTagForbiddenByDisallowList ( ) || checkIsTagForbiddenByDisallowPatternList ( ) ;
206
- }
207
-
208
200
const hasDisallowOptions = options . disallowList . length > 0 || options . disallowPatternList . length > 0 ;
209
201
210
202
// disallowList should have a least one item (schema configuration)
0 commit comments