@@ -1227,7 +1227,7 @@ function initConfiguration(name, type, isMethod) {
12271227 } ;
12281228 }
12291229 break ;
1230- case typeof type === 'array' && typeof type [ 0 ] === 'boolean' :
1230+ case Array . isArray ( type ) && type [ 0 ] === 'boolean' :
12311231 if ( isMethod ) {
12321232 result = {
12331233 name : name ,
@@ -1244,7 +1244,7 @@ function initConfiguration(name, type, isMethod) {
12441244 } ;
12451245 }
12461246 break ;
1247- case typeof type === 'array' && typeof type [ 0 ] === 'string' :
1247+ case Array . isArray ( type ) && type [ 0 ] === 'string' :
12481248 if ( isMethod ) {
12491249 result = {
12501250 name : name ,
@@ -1261,7 +1261,7 @@ function initConfiguration(name, type, isMethod) {
12611261 } ;
12621262 }
12631263 break ;
1264- case typeof type === 'array' && typeof type [ 0 ] === 'number' :
1264+ case Array . isArray ( type ) && type [ 0 ] === 'number' :
12651265 if ( isMethod ) {
12661266 result = {
12671267 name : name ,
@@ -1278,7 +1278,7 @@ function initConfiguration(name, type, isMethod) {
12781278 } ;
12791279 }
12801280 break ;
1281- case typeof type === 'array' && typeof type [ 0 ] === 'object' :
1281+ case Array . isArray ( type ) && type [ 0 ] === 'object' :
12821282 if ( isMethod ) {
12831283 result = {
12841284 name : name ,
@@ -1295,7 +1295,7 @@ function initConfiguration(name, type, isMethod) {
12951295 } ;
12961296 }
12971297 break ;
1298- case typeof type === 'array' && typeof type [ 0 ] === 'date' :
1298+ case Array . isArray ( type ) && type [ 0 ] === 'date' :
12991299 if ( isMethod ) {
13001300 result = {
13011301 name : name ,
@@ -1312,7 +1312,7 @@ function initConfiguration(name, type, isMethod) {
13121312 } ;
13131313 }
13141314 break ;
1315- case typeof type === 'array' && typeof type [ 0 ] === 'any' :
1315+ case Array . isArray ( type ) && type [ 0 ] === 'any' :
13161316 if ( isMethod ) {
13171317 result = {
13181318 name : name ,
@@ -1329,7 +1329,7 @@ function initConfiguration(name, type, isMethod) {
13291329 } ;
13301330 }
13311331 break ;
1332- case typeof type === 'array' :
1332+ case Array . isArray ( type ) :
13331333 if ( isMethod ) {
13341334 result = {
13351335 name : name ,
@@ -1370,7 +1370,8 @@ function generateConfiguration(model) {
13701370 if ( model . hasOwnProperty ( propName ) && propName . indexOf ( '_' ) !== 0 ) {
13711371 switch ( true ) {
13721372 // property type
1373- case typeof model [ propName ] === 'string' :
1373+ case typeof model [ propName ] === 'string' ||
1374+ Array . isArray ( model [ propName ] ) :
13741375 model [ propName ] = initConfiguration ( propName , model [ propName ] , false ) ;
13751376 break ;
13761377
@@ -1825,7 +1826,11 @@ exports.isValidType = function isValidType(value, typeName) {
18251826 isValid = checkCustomSchema ( value [ i ] , typeName [ 0 ] ) ;
18261827 break ;
18271828 case exports . isClassName ( typeName [ 0 ] ) :
1828- if ( value [ i ] !== '' && value [ i ] !== null ) {
1829+ if (
1830+ value [ i ] !== '' &&
1831+ value [ i ] !== null &&
1832+ typeof value [ i ] !== 'string'
1833+ ) {
18291834 isValid = exports . inheritFrom (
18301835 getClassName ( value [ i ] ) ,
18311836 typeName [ 0 ]
@@ -1864,7 +1869,7 @@ exports.isValidType = function isValidType(value, typeName) {
18641869 }
18651870 break ;
18661871 case exports . isClassName ( typeName ) :
1867- if ( value !== '' && value !== null ) {
1872+ if ( value !== '' && value !== null && typeof value !== 'string' ) {
18681873 result = exports . inheritFrom ( getClassName ( value ) , typeName ) ;
18691874 }
18701875 break ;
0 commit comments