File tree 2 files changed +6
-6
lines changed 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export function isVueComponent(c: any): boolean {
33
33
return true
34
34
}
35
35
36
- if ( c === null || typeof c !== 'object' ) {
36
+ if ( ! isPlainObject ( c ) ) {
37
37
return false
38
38
}
39
39
@@ -63,7 +63,7 @@ export function componentNeedsCompiling(component: Component): boolean {
63
63
64
64
export function isRefSelector ( refOptionsObject : any ) : boolean {
65
65
if (
66
- typeof refOptionsObject !== 'object' ||
66
+ ! isPlainObject ( refOptionsObject ) ||
67
67
Object . keys ( refOptionsObject || { } ) . length !== 1
68
68
) {
69
69
return false
@@ -73,7 +73,7 @@ export function isRefSelector(refOptionsObject: any): boolean {
73
73
}
74
74
75
75
export function isNameSelector ( nameOptionsObject : any ) : boolean {
76
- if ( typeof nameOptionsObject !== 'object' || nameOptionsObject === null ) {
76
+ if ( ! isPlainObject ( nameOptionsObject ) ) {
77
77
return false
78
78
}
79
79
@@ -89,7 +89,7 @@ export function isDynamicComponent(c: any) {
89
89
}
90
90
91
91
export function isComponentOptions ( c : any ) {
92
- return c !== null && typeof c === 'object' && ( c . template || c . render )
92
+ return isPlainObject ( c ) && ( c . template || c . render )
93
93
}
94
94
95
95
export function isFunctionalComponent ( c : any ) {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
warnDeprecated ,
20
20
isVueWrapper
21
21
} from 'shared/util'
22
+ import { isPlainObject } from 'shared/validators'
22
23
import { isElementVisible } from 'shared/is-visible'
23
24
import find from './find'
24
25
import createWrapper from './create-wrapper'
@@ -719,8 +720,7 @@ export default class Wrapper implements BaseWrapper {
719
720
Object . keys ( data ) . forEach ( key => {
720
721
// Don't let people set entire objects, because reactivity won't work
721
722
if (
722
- typeof data [ key ] === 'object' &&
723
- data [ key ] !== null &&
723
+ isPlainObject ( data [ key ] ) &&
724
724
// $FlowIgnore : Problem with possibly null this.vm
725
725
data [ key ] === this . vm [ key ]
726
726
) {
You can’t perform that action at this time.
0 commit comments