@@ -99,30 +99,18 @@ if (is(element, isElement)) {
99
99
}
100
100
101
101
/* Should support object tests. */
102
- expectType < boolean > (
103
- is < Heading > ( heading , { type : 'heading' , depth : 2 } )
104
- )
105
- expectType < boolean > (
106
- is < Heading > ( element , { type : 'heading' , depth : 2 } )
107
- )
108
- expectError (
109
- is < Heading > ( heading , { type : 'heading' , depth : '2' } )
110
- )
102
+ expectType < boolean > ( is < Heading > ( heading , { type : 'heading' , depth : 2 } ) )
103
+ expectType < boolean > ( is < Heading > ( element , { type : 'heading' , depth : 2 } ) )
104
+ expectError ( is < Heading > ( heading , { type : 'heading' , depth : '2' } ) )
111
105
112
106
if ( is < Heading > ( heading , { type : 'heading' , depth : 2 } ) ) {
113
107
expectType < Heading > ( heading )
114
108
expectNotType < Element > ( heading )
115
109
}
116
110
117
- expectType < boolean > (
118
- is < Element > ( element , { type : 'element' , tagName : 'section' } )
119
- )
120
- expectType < boolean > (
121
- is < Element > ( heading , { type : 'element' , tagName : 'section' } )
122
- )
123
- expectError (
124
- is < Element > ( element , { type : 'element' , tagName : true } )
125
- )
111
+ expectType < boolean > ( is < Element > ( element , { type : 'element' , tagName : 'section' } ) )
112
+ expectType < boolean > ( is < Element > ( heading , { type : 'element' , tagName : 'section' } ) )
113
+ expectError ( is < Element > ( element , { type : 'element' , tagName : true } ) )
126
114
127
115
if ( is < Element > ( element , { type : 'element' , tagName : 'section' } ) ) {
128
116
expectType < Element > ( element )
@@ -181,9 +169,7 @@ unified().use(() => (tree) => {
181
169
convert < Heading > ( 'heading' )
182
170
expectError ( convert < Heading > ( 'element' ) )
183
171
convert < Heading > ( { type : 'heading' , depth : 2 } )
184
- expectError (
185
- convert < Element > ( { type : 'heading' , depth : 2 } )
186
- )
172
+ expectError ( convert < Element > ( { type : 'heading' , depth : 2 } ) )
187
173
convert < Heading > ( isHeading )
188
174
expectError ( convert < Element > ( isHeading ) )
189
175
convert ( )
0 commit comments