Skip to content

Commit

Permalink
[v3] handle case when meta object was added in transformPageMap (#3078
Browse files Browse the repository at this point in the history
)

aa
  • Loading branch information
dimaMachina authored Jul 30, 2024
1 parent b61d8e6 commit d1e3e9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-ways-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra': patch
---

handle case when meta object was added in `transformPageMap`
6 changes: 4 additions & 2 deletions packages/nextra/src/server/page-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ function convertPageMapToAst(pageMap: PageMapItem[]): ArrayExpression {
})
}
return createAstObject({
// @ts-expect-error -- item.data is string
data: { type: 'Identifier', name: item.data }
data:
typeof item.data === 'string'
? { type: 'Identifier', name: item.data }
: valueToEstree(item.data)
})
})

Expand Down

0 comments on commit d1e3e9a

Please sign in to comment.