File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ export function validateProp (
21
21
const absent = ! hasOwn ( propsData , key )
22
22
let value = propsData [ key ]
23
23
// handle boolean props
24
- if ( isBooleanType ( prop . type ) ) {
24
+ if ( isType ( Boolean , prop . type ) ) {
25
25
if ( absent && ! hasOwn ( prop , 'default' ) ) {
26
26
value = false
27
- } else if ( value === '' || value === hyphenate ( key ) ) {
27
+ } else if ( ! isType ( String , prop . type ) && ( value === '' || value === hyphenate ( key ) ) ) {
28
28
value = true
29
29
}
30
30
}
@@ -168,12 +168,12 @@ function getType (fn) {
168
168
return match && match [ 1 ]
169
169
}
170
170
171
- function isBooleanType ( fn ) {
171
+ function isType ( type , fn ) {
172
172
if ( ! Array . isArray ( fn ) ) {
173
- return getType ( fn ) === 'Boolean'
173
+ return getType ( fn ) === getType ( type )
174
174
}
175
175
for ( let i = 0 , len = fn . length ; i < len ; i ++ ) {
176
- if ( getType ( fn [ i ] ) === 'Boolean' ) {
176
+ if ( getType ( fn [ i ] ) === getType ( type ) ) {
177
177
return true
178
178
}
179
179
}
You can’t perform that action at this time.
0 commit comments