@rspress/plugin-api-docgen 1.9.2 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-api-docgen",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "A plugin for rspress to generate api doc.",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "dist/"
21
21
  ],
22
22
  "dependencies": {
23
- "@modern-js/utils": "2.44.0",
23
+ "@modern-js/utils": "2.45.0",
24
24
  "react-markdown": "8.0.7",
25
25
  "react-docgen-typescript": "2.2.2",
26
26
  "documentation": "14.0.2",
@@ -39,7 +39,7 @@
39
39
  "typescript": "^5",
40
40
  "unified": "^10.1.2",
41
41
  "unist-util-visit": "^4.1.1",
42
- "@rspress/shared": "1.9.2"
42
+ "@rspress/shared": "1.9.3"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=17",
@@ -10,7 +10,9 @@ export default (props: { moduleName: string }) => {
10
10
  const { moduleName } = props;
11
11
  // some api doc have two languages.
12
12
  const apiDocMap = page.apiDocMap as Record<string, string>;
13
- const apiDoc = apiDocMap[moduleName] || apiDocMap[`${moduleName}-${lang}`];
13
+ // avoid error when no page data
14
+ const apiDoc =
15
+ apiDocMap?.[moduleName] || apiDocMap?.[`${moduleName}-${lang}`];
14
16
  return (
15
17
  <ReactMarkdown
16
18
  remarkPlugins={[[remarkGfm]]}