@@ -28,24 +28,24 @@ export function isDomSelector (selector: any): boolean {
28
28
}
29
29
}
30
30
31
- export function isVueComponent ( component : any ) : boolean {
32
- if ( typeof component === 'function' && component . options ) {
31
+ export function isVueComponent ( c : any ) : boolean {
32
+ if ( isConstructor ( c ) ) {
33
33
return true
34
34
}
35
35
36
- if ( component === null || typeof component !== 'object' ) {
36
+ if ( c === null || typeof c !== 'object' ) {
37
37
return false
38
38
}
39
39
40
- if ( component . extends || component . _Ctor ) {
40
+ if ( c . extends || c . _Ctor ) {
41
41
return true
42
42
}
43
43
44
- if ( typeof component . template === 'string' ) {
44
+ if ( typeof c . template === 'string' ) {
45
45
return true
46
46
}
47
47
48
- return typeof component . render === 'function'
48
+ return typeof c . render === 'function'
49
49
}
50
50
51
51
export function componentNeedsCompiling ( component : Component ) : boolean {
@@ -76,16 +76,16 @@ export function isNameSelector (nameOptionsObject: any): boolean {
76
76
return ! ! nameOptionsObject . name
77
77
}
78
78
79
- export function isConstructor ( el ) {
80
- return typeof el === 'function'
79
+ export function isConstructor ( c : any ) {
80
+ return typeof c === 'function' && c . cid
81
81
}
82
82
83
- export function isDynamicComponent ( cmp ) {
84
- return typeof cmp === 'function' && ! cmp . cid
83
+ export function isDynamicComponent ( c : any ) {
84
+ return typeof c === 'function' && ! c . cid
85
85
}
86
86
87
- export function isComponentOptions ( el ) {
88
- return typeof el === 'object' && ( el . template || el . render )
87
+ export function isComponentOptions ( c : any ) {
88
+ return typeof c === 'object' && ( c . template || c . render )
89
89
}
90
90
91
91
export function templateContainsComponent (
@@ -98,8 +98,8 @@ export function templateContainsComponent (
98
98
} )
99
99
}
100
100
101
- export function isPlainObject ( obj : any ) : boolean {
102
- return Object . prototype . toString . call ( obj ) === '[object Object]'
101
+ export function isPlainObject ( c : any ) : boolean {
102
+ return Object . prototype . toString . call ( c ) === '[object Object]'
103
103
}
104
104
105
105
export function isRequiredComponent ( name : string ) : boolean {
0 commit comments