@@ -290,7 +290,9 @@ function transform(state, node) {
290
290
291
291
case 'mdxJsxFlowElement' : {
292
292
// Map the attributes array into name/value pairs
293
+ /** @type {Record<string, unknown> } */
293
294
const attributesMap = { }
295
+
294
296
if ( Array . isArray ( unsafe . attributes ) ) {
295
297
unsafe . attributes . forEach ( ( attr ) => {
296
298
if (
@@ -317,7 +319,7 @@ function transform(state, node) {
317
319
}
318
320
319
321
case 'mdxJsxTextElement' : {
320
- // Handle text elements the same way
322
+ /** @type { Record<string, unknown> } */
321
323
const attributesMap = { }
322
324
if ( Array . isArray ( unsafe . attributes ) ) {
323
325
unsafe . attributes . forEach ( ( attr ) => {
@@ -563,7 +565,11 @@ function properties(state, properties) {
563
565
// Handle both traditional properties and MDX attributes
564
566
const properties_ =
565
567
properties && typeof properties === 'object' ? properties : { }
566
- const mdxAttributes = properties_ ?. attributes || { } // Add support for MDX attributes
568
+ /** @type {Array<{ type: 'mdxJsxAttribute' } & Record<string, unknown>> } */
569
+ const mdxAttributes =
570
+ /** @type {{ attributes?: Array<{ type: 'mdxJsxAttribute' } & Record<string, unknown>> } } */ (
571
+ properties_
572
+ ) ?. attributes || [ ]
567
573
568
574
/** @type {Properties } */
569
575
const result = { }
@@ -573,6 +579,7 @@ function properties(state, properties) {
573
579
// Process traditional properties
574
580
for ( key in properties_ ) {
575
581
if ( own . call ( properties_ , key ) ) {
582
+ // @ts -ignore
576
583
const unsafe = properties_ [ key ]
577
584
let safe = propertyValue (
578
585
state ,
0 commit comments