File tree 2 files changed +2
-10
lines changed
2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
export function labelable ( node ) {
18
18
return Boolean (
19
- node &&
20
- typeof node === 'object' &&
21
- node . type === 'element' &&
19
+ node . type === 'element' &&
22
20
( node . tagName === 'button' ||
23
- ( node . tagName === 'input' &&
24
- ( node . properties && node . properties . type ) !== 'hidden' ) ||
21
+ ( node . tagName === 'input' && node . properties . type !== 'hidden' ) ||
25
22
node . tagName === 'keygen' ||
26
23
node . tagName === 'meter' ||
27
24
node . tagName === 'output' ||
Original file line number Diff line number Diff line change @@ -9,11 +9,6 @@ test('labelable', async function (t) {
9
9
] )
10
10
} )
11
11
12
- await t . test ( 'should return `false` without node' , async function ( ) {
13
- // @ts -expect-error: check that the runtime supports a missing node.
14
- assert . equal ( labelable ( ) , false )
15
- } )
16
-
17
12
await t . test ( 'should return `false` without element' , async function ( ) {
18
13
assert . equal ( labelable ( { type : 'text' , value : 'Alpha' } ) , false )
19
14
} )
You can’t perform that action at this time.
0 commit comments