File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -2103,17 +2103,21 @@ exports.isValidObject = function isValidObject(
2103
2103
for ( fieldName in object ) {
2104
2104
field = object [ fieldName ] ;
2105
2105
2106
- if ( ! hasType ( schema [ fieldName ] , 'undefined' ) || fieldName === '_core' ) {
2107
- // case of _core
2108
- if ( fieldName !== '_core' ) {
2109
- typeSchema = schema [ fieldName ] . type ;
2110
- } else {
2111
- typeSchema = 'boolean' ;
2112
- }
2113
-
2114
- // cas of _id
2115
- if ( fieldName === '_id' ) {
2116
- typeSchema = 'string' ;
2106
+ if (
2107
+ ! hasType ( schema [ fieldName ] , 'undefined' ) ||
2108
+ fieldName === '_core' ||
2109
+ fieldName === '_id'
2110
+ ) {
2111
+ switch ( true ) {
2112
+ case fieldName === '_core' :
2113
+ typeSchema = 'boolean' ;
2114
+ break ;
2115
+ case fieldName === '_id' :
2116
+ typeSchema = 'string' ;
2117
+ break ;
2118
+ default :
2119
+ typeSchema = schema [ fieldName ] . type ;
2120
+ break ;
2117
2121
}
2118
2122
} else {
2119
2123
if ( strict ) {
You can’t perform that action at this time.
0 commit comments