docusaurus-theme-openapi-docs 0.0.0-838 → 0.0.0-845
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/lib/markdown/utils.d.ts +5 -4
- package/package.json +3 -3
- package/src/markdown/utils.ts +7 -6
package/lib/markdown/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
/** @deprecated use ReactNode from React instead */
|
|
3
|
+
export type Children = ReactNode;
|
|
3
4
|
export type Props = Record<string, any> & {
|
|
4
|
-
children?:
|
|
5
|
+
children?: ReactNode;
|
|
5
6
|
};
|
|
6
7
|
export declare function create(tag: string, props: Props): string;
|
|
7
|
-
export declare function guard<T>(value: T | undefined | string, cb: (value: T) =>
|
|
8
|
-
export declare function render(children:
|
|
8
|
+
export declare function guard<T>(value: T | undefined | string, cb: (value: T) => ReactNode): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode>;
|
|
9
|
+
export declare function render(children: ReactNode): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode>;
|
|
9
10
|
export declare function toString(value: any): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-845",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"clsx": "^1.1.1",
|
|
43
43
|
"copy-text-to-clipboard": "^3.1.0",
|
|
44
44
|
"crypto-js": "^4.1.1",
|
|
45
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-
|
|
45
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-845",
|
|
46
46
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
47
47
|
"file-saver": "^2.0.5",
|
|
48
48
|
"lodash": "^4.17.20",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=14"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "ded3ee63c094b99f9b194d6553698bc8bb440e17"
|
|
74
74
|
}
|
package/src/markdown/utils.ts
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import { ReactNode } from "react";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** @deprecated use ReactNode from React instead */
|
|
11
|
+
export type Children = ReactNode;
|
|
11
12
|
|
|
12
|
-
export type Props = Record<string, any> & { children?:
|
|
13
|
+
export type Props = Record<string, any> & { children?: ReactNode };
|
|
13
14
|
|
|
14
15
|
export function create(tag: string, props: Props): string {
|
|
15
16
|
const { children, ...rest } = props;
|
|
@@ -24,8 +25,8 @@ export function create(tag: string, props: Props): string {
|
|
|
24
25
|
|
|
25
26
|
export function guard<T>(
|
|
26
27
|
value: T | undefined | string,
|
|
27
|
-
cb: (value: T) =>
|
|
28
|
-
)
|
|
28
|
+
cb: (value: T) => ReactNode
|
|
29
|
+
) {
|
|
29
30
|
if (!!value || value === 0) {
|
|
30
31
|
const children = cb(value as T);
|
|
31
32
|
return render(children);
|
|
@@ -33,11 +34,11 @@ export function guard<T>(
|
|
|
33
34
|
return "";
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
export function render(children:
|
|
37
|
+
export function render(children: ReactNode) {
|
|
37
38
|
if (Array.isArray(children)) {
|
|
38
39
|
return children.filter((c) => c !== undefined).join("");
|
|
39
40
|
}
|
|
40
|
-
return
|
|
41
|
+
return children ?? "";
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export function toString(value: any): string | undefined {
|