@@ -74,13 +74,13 @@ function traverse(tree, cb) {
74
74
if ( Array . isArray ( tree ) ) {
75
75
for ( let i = 0 , l = tree . length ; i < l ; i ++ ) {
76
76
let item = tree [ i ] ;
77
- if ( typeof ( item ) !== 'object' ) {
77
+ if ( typeof item !== 'object' ) {
78
78
tree [ i ] = traverse ( item , cb ) ;
79
79
} else {
80
80
tree [ i ] = traverse ( cb ( item ) , cb ) ;
81
81
}
82
82
}
83
- } else if ( typeof ( tree ) === 'object' ) {
83
+ } else if ( typeof tree === 'object' ) {
84
84
if ( tree . hasOwnProperty ( 'content' ) ) traverse ( tree . content , cb ) ;
85
85
} else {
86
86
return cb ( tree ) ;
@@ -89,11 +89,11 @@ function traverse(tree, cb) {
89
89
}
90
90
91
91
function compare ( expected , actual ) {
92
- if ( typeof ( actual ) !== typeof ( expected ) ) {
92
+ if ( typeof actual !== typeof expected ) {
93
93
return false ;
94
94
}
95
95
96
- if ( typeof ( expected ) !== 'object' || expected === null ) {
96
+ if ( typeof expected !== 'object' || expected === null ) {
97
97
return expected === actual ;
98
98
}
99
99
@@ -102,7 +102,7 @@ function compare(expected, actual) {
102
102
}
103
103
104
104
if ( Array . isArray ( expected ) ) {
105
- if ( typeof ( actual . length ) !== 'number' ) {
105
+ if ( typeof actual . length !== 'number' ) {
106
106
return false ;
107
107
}
108
108
let aa = Array . prototype . slice . call ( actual ) ;
@@ -112,10 +112,10 @@ function compare(expected, actual) {
112
112
return Object . keys ( expected ) . every ( key => {
113
113
let eo = expected [ key ] ;
114
114
let ao = actual [ key ] ;
115
- if ( typeof ( eo ) === 'object' && eo !== null && ao !== null ) {
115
+ if ( typeof eo === 'object' && eo !== null && ao !== null ) {
116
116
return compare ( eo , ao ) ;
117
117
}
118
- if ( typeof ( eo ) === 'boolean' ) {
118
+ if ( typeof eo === 'boolean' ) {
119
119
return ( eo && ao ) || ( ! eo && ! ao ) ;
120
120
}
121
121
return ao === eo ;
0 commit comments