88import fs from 'node:fs/promises'
99import hljs from 'highlight.js'
1010import { zone } from 'mdast-zone'
11- import { u } from 'unist-builder'
1211
1312/** @type {{common: Array<string>, uncommon: Array<string>} } */
1413const data = JSON . parse (
@@ -28,7 +27,7 @@ export default function support() {
2827
2928 zone ( tree , 'support' , ( start , _ , end ) => [
3029 start ,
31- u ( 'list' , { spread : false } , items ) ,
30+ { type : 'list' , spread : false , children : items } ,
3231 end
3332 ] )
3433 }
@@ -45,23 +44,25 @@ async function item(name) {
4544 const fn = mod . default
4645 const language = fn ( hljs )
4746 /** @type {Array<PhrasingContent> } */
48- const content = [ u ( 'inlineCode' , name ) ]
47+ const content = [ { type : 'inlineCode' , value : name } ]
4948 let index = - 1
5049
5150 if ( language . aliases ) {
52- content . push ( u ( 'text' , ' (' ) )
51+ content . push ( { type : 'text' , value : ' (' } )
5352
5453 while ( ++ index < language . aliases . length ) {
55- if ( index ) content . push ( u ( 'text' , ', ' ) )
56- content . push ( u ( 'inlineCode' , language . aliases [ index ] ) )
54+ if ( index ) content . push ( { type : 'text' , value : ', ' } )
55+ content . push ( { type : 'inlineCode' , value : language . aliases [ index ] } )
5756 }
5857
59- content . push ( u ( 'text' , ')' ) )
58+ content . push ( { type : 'text' , value : ')' } )
6059 }
6160
62- content . push ( u ( 'text' , ' — ' + language . name ) )
61+ content . push ( { type : 'text' , value : ' — ' + language . name } )
6362
64- return u ( 'listItem' , { checked : data . common . includes ( name ) } , [
65- u ( 'paragraph' , content )
66- ] )
63+ return {
64+ type : 'listItem' ,
65+ checked : data . common . includes ( name ) ,
66+ children : [ { type : 'paragraph' , children : content } ]
67+ }
6768}
0 commit comments