@@ -368,12 +368,19 @@ const convertBCDSupportToCanIUseStat = function convertBCDSupportToCanIUseStat(a
368368 } , { } ) ;
369369}
370370
371- const convertBCDEntryToCanIUseEntry = function convertBCDEntryToCanIUseEntry ( entryKey , entryData , titlePrefix ) {
371+ const convertBCDEntryToCanIUseEntry = function convertBCDEntryToCanIUseEntry ( bcdResult ) {
372+ const {
373+ key,
374+ origKey,
375+ data,
376+ prefix,
377+ } = bcdResult ;
378+
372379 const toReturn = {
373- key : entryKey ,
374- title : `${ bcdTitleMap [ titlePrefix ] ?? `${ titlePrefix } ` } : ${ entryData . description } ` ,
380+ key,
381+ title : `${ bcdTitleMap [ prefix ] ?? `${ prefix } ` } : ${ data . description ?? origKey } ` ,
375382 description : '' ,
376- spec : entryData . spec_url ,
383+ spec : data . spec_url ,
377384 notes : '' ,
378385 notes_by_num : [ ] ,
379386 stats : { } , // To be filled on the next few lines …
@@ -382,7 +389,7 @@ const convertBCDEntryToCanIUseEntry = function convertBCDEntryToCanIUseEntry(ent
382389 agents_bcd . forEach ( ( agent_bcd , i ) => {
383390 // Map BCD agent to CIU agent
384391 const agent_caniuse = agents [ i ] ;
385- toReturn . stats [ agent_caniuse ] = convertBCDSupportToCanIUseStat ( agent_caniuse , entryData . support [ agent_bcd ] ) ;
392+ toReturn . stats [ agent_caniuse ] = convertBCDSupportToCanIUseStat ( agent_caniuse , data . support [ agent_bcd ] ) ;
386393 } ) ;
387394
388395 return toReturn ;
@@ -420,6 +427,7 @@ const findResult = function findResult(name) {
420427 if ( entryKey === name || entry [ '__compat' ] . description ?. includes ( name ) ) {
421428 bcdResults . push ( {
422429 key : `mdn-${ section } _${ subsectionKey } _${ entryKey } ` ,
430+ origKey : entryKey ,
423431 data : subEntry ,
424432 prefix : `${ section } .${ subsectionKey } ` ,
425433 } ) ;
@@ -428,6 +436,7 @@ const findResult = function findResult(name) {
428436 if ( subEntryKey === name || subEntry [ '__compat' ] ?. description ?. includes ( name ) ) {
429437 bcdResults . push ( {
430438 key : `mdn-${ section } _${ subsectionKey } _${ entryKey } _${ subEntryKey } ` ,
439+ origKey : subEntryKey ,
431440 data : subEntry [ '__compat' ] ,
432441 prefix : `${ section } .${ subsectionKey } ` ,
433442 } ) ;
@@ -437,7 +446,7 @@ const findResult = function findResult(name) {
437446 }
438447 }
439448 }
440- bcdResults = bcdResults . map ( bcdResult => convertBCDEntryToCanIUseEntry ( bcdResult . key , bcdResult . data , bcdResult . prefix ) ) ;
449+ bcdResults = bcdResults . map ( bcdResult => convertBCDEntryToCanIUseEntry ( bcdResult ) ) ;
441450
442451 // return array of matches
443452 if ( caniuseResults . length > 0 || bcdResults . length > 0 ) {
0 commit comments