File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,8 @@ exports.valObjectMeta = {
8888 requiredOpts : [ ] ,
8989 otherOpts : [ 'dflt' , 'arrayOk' ] ,
9090 coerceFunction : function ( v , propOut , dflt , opts ) {
91- function isBoolean ( value ) {
92- return value === true || value === false ;
93- }
94-
95- if ( opts . arrayOk && isArrayOrTypedArray ( v ) && v . length > 0 && v . every ( isBoolean ) ) {
96- propOut . set ( v ) ;
97- } else if ( isBoolean ( v ) ) {
91+ const isBoolean = value => value === true || value === false ;
92+ if ( isBoolean ( v ) || ( opts . arrayOk && Array . isArray ( v ) && v . length > 0 && v . every ( isBoolean ) ) ) {
9893 propOut . set ( v ) ;
9994 } else {
10095 propOut . set ( dflt ) ;
@@ -238,9 +233,7 @@ exports.valObjectMeta = {
238233 coerceFunction : function ( v , propOut , dflt , opts ) {
239234 var regex = opts . regex || counterRegex ( dflt ) ;
240235 const isSubplotId = value => typeof value === 'string' && regex . test ( value ) ;
241- if ( opts . arrayOk && isArrayOrTypedArray ( v ) && v . length > 0 && v . every ( isSubplotId ) ) {
242- propOut . set ( v ) ;
243- } else if ( isSubplotId ( v ) ) {
236+ if ( isSubplotId ( v ) || ( opts . arrayOk && isArrayOrTypedArray ( v ) && v . length > 0 && v . every ( isSubplotId ) ) ) {
244237 propOut . set ( v ) ;
245238 } else {
246239 propOut . set ( dflt ) ;
You can’t perform that action at this time.
0 commit comments