File tree Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Expand file tree Collapse file tree 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'
4040 * Equivalent hast node.
4141 */
4242export 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 : [ ] }
4544}
4645
4746/**
Original file line number Diff line number Diff line change @@ -123,15 +123,6 @@ test('fromDom', async function (t) {
123123 assert . deepEqual ( fromDom ( frag ) , { type : 'root' , children : [ ] } )
124124 } )
125125
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-
135126 await t . test ( 'should support a text w/o value' , async function ( ) {
136127 assert . deepEqual ( fromDom ( document . createTextNode ( '' ) ) , {
137128 type : 'text' ,
You can’t perform that action at this time.
0 commit comments