File tree 2 files changed +1
-11
lines changed
2 files changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,7 @@ import {webNamespaces} from 'web-namespaces'
40
40
* Equivalent hast node.
41
41
*/
42
42
export function fromDom ( tree , options ) {
43
- const result = tree ? transform ( tree , options || { } ) : undefined
44
- return result || { type : 'root' , children : [ ] }
43
+ return transform ( tree , options || { } ) || { type : 'root' , children : [ ] }
45
44
}
46
45
47
46
/**
Original file line number Diff line number Diff line change @@ -123,15 +123,6 @@ test('fromDom', async function (t) {
123
123
assert . deepEqual ( fromDom ( frag ) , { type : 'root' , children : [ ] } )
124
124
} )
125
125
126
- await t . test ( 'should handle a missing DOM tree' , async function ( ) {
127
- assert . deepEqual (
128
- // To do: remove.
129
- // @ts -expect-error runtime.
130
- fromDom ( ) ,
131
- { type : 'root' , children : [ ] }
132
- )
133
- } )
134
-
135
126
await t . test ( 'should support a text w/o value' , async function ( ) {
136
127
assert . deepEqual ( fromDom ( document . createTextNode ( '' ) ) , {
137
128
type : 'text' ,
You can’t perform that action at this time.
0 commit comments