docusaurus-plugin-openapi-docs 0.0.0-352 → 0.0.0-353
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/createContactInfo.js +6 -6
- package/lib/markdown/createLicense.js +4 -4
- package/lib/markdown/createTermsOfService.js +1 -1
- package/package.json +2 -2
- package/src/markdown/createContactInfo.ts +20 -16
- package/src/markdown/createLicense.ts +8 -6
- package/src/markdown/createTermsOfService.ts +1 -1
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.createContactInfo = void 0;
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
function createContactInfo(contact) {
|
|
12
|
-
if (!contact)
|
|
12
|
+
if (!contact || !Object.keys(contact).length)
|
|
13
13
|
return "";
|
|
14
14
|
const { name, url, email } = contact;
|
|
15
15
|
return (0, utils_1.create)("div", {
|
|
@@ -27,14 +27,14 @@ function createContactInfo(contact) {
|
|
|
27
27
|
}),
|
|
28
28
|
(0, utils_1.create)("span", {
|
|
29
29
|
children: [
|
|
30
|
-
`${name}:
|
|
31
|
-
(0, utils_1.create)("a", {
|
|
30
|
+
(0, utils_1.guard)(name, () => `${name}: `),
|
|
31
|
+
(0, utils_1.guard)(email, () => (0, utils_1.create)("a", {
|
|
32
32
|
href: `mailto:${email}`,
|
|
33
33
|
children: `${email}`,
|
|
34
|
-
}),
|
|
34
|
+
})),
|
|
35
35
|
],
|
|
36
36
|
}),
|
|
37
|
-
(0, utils_1.create)("span", {
|
|
37
|
+
(0, utils_1.guard)(url, () => (0, utils_1.create)("span", {
|
|
38
38
|
children: [
|
|
39
39
|
"URL: ",
|
|
40
40
|
(0, utils_1.create)("a", {
|
|
@@ -42,7 +42,7 @@ function createContactInfo(contact) {
|
|
|
42
42
|
children: `${url}`,
|
|
43
43
|
}),
|
|
44
44
|
],
|
|
45
|
-
}),
|
|
45
|
+
})),
|
|
46
46
|
],
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.createLicense = void 0;
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
function createLicense(license) {
|
|
12
|
-
if (!license)
|
|
12
|
+
if (!license || !Object.keys(license).length)
|
|
13
13
|
return "";
|
|
14
14
|
const { name, url } = license;
|
|
15
15
|
return (0, utils_1.create)("div", {
|
|
@@ -23,10 +23,10 @@ function createLicense(license) {
|
|
|
23
23
|
},
|
|
24
24
|
children: "License",
|
|
25
25
|
}),
|
|
26
|
-
(0, utils_1.create)("a", {
|
|
26
|
+
(0, utils_1.guard)(url, () => (0, utils_1.create)("a", {
|
|
27
27
|
href: url,
|
|
28
|
-
children: name,
|
|
29
|
-
}),
|
|
28
|
+
children: name !== null && name !== void 0 ? name : url,
|
|
29
|
+
})),
|
|
30
30
|
],
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.createTermsOfService = void 0;
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
function createTermsOfService(termsOfService) {
|
|
12
|
-
if (!
|
|
12
|
+
if (!termsOfService)
|
|
13
13
|
return "";
|
|
14
14
|
return (0, utils_1.create)("div", {
|
|
15
15
|
style: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-353",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "58af2b8a6f0938d8dfef3073a1deebad325138ad"
|
|
64
64
|
}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import { ContactObject } from "../openapi/types";
|
|
9
|
-
import { create } from "./utils";
|
|
9
|
+
import { create, guard } from "./utils";
|
|
10
10
|
|
|
11
11
|
export function createContactInfo(contact: ContactObject) {
|
|
12
|
-
if (!contact) return "";
|
|
12
|
+
if (!contact || !Object.keys(contact).length) return "";
|
|
13
13
|
const { name, url, email } = contact;
|
|
14
14
|
|
|
15
15
|
return create("div", {
|
|
@@ -27,22 +27,26 @@ export function createContactInfo(contact: ContactObject) {
|
|
|
27
27
|
}),
|
|
28
28
|
create("span", {
|
|
29
29
|
children: [
|
|
30
|
-
`${name}:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
create("span", {
|
|
38
|
-
children: [
|
|
39
|
-
"URL: ",
|
|
40
|
-
create("a", {
|
|
41
|
-
href: `${url}`,
|
|
42
|
-
children: `${url}`,
|
|
43
|
-
}),
|
|
30
|
+
guard(name, () => `${name}: `),
|
|
31
|
+
guard(email, () =>
|
|
32
|
+
create("a", {
|
|
33
|
+
href: `mailto:${email}`,
|
|
34
|
+
children: `${email}`,
|
|
35
|
+
})
|
|
36
|
+
),
|
|
44
37
|
],
|
|
45
38
|
}),
|
|
39
|
+
guard(url, () =>
|
|
40
|
+
create("span", {
|
|
41
|
+
children: [
|
|
42
|
+
"URL: ",
|
|
43
|
+
create("a", {
|
|
44
|
+
href: `${url}`,
|
|
45
|
+
children: `${url}`,
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
})
|
|
49
|
+
),
|
|
46
50
|
],
|
|
47
51
|
});
|
|
48
52
|
}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import { LicenseObject } from "../openapi/types";
|
|
9
|
-
import { create } from "./utils";
|
|
9
|
+
import { create, guard } from "./utils";
|
|
10
10
|
|
|
11
11
|
export function createLicense(license: LicenseObject) {
|
|
12
|
-
if (!license) return "";
|
|
12
|
+
if (!license || !Object.keys(license).length) return "";
|
|
13
13
|
const { name, url } = license;
|
|
14
14
|
|
|
15
15
|
return create("div", {
|
|
@@ -23,10 +23,12 @@ export function createLicense(license: LicenseObject) {
|
|
|
23
23
|
},
|
|
24
24
|
children: "License",
|
|
25
25
|
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
guard(url, () =>
|
|
27
|
+
create("a", {
|
|
28
|
+
href: url,
|
|
29
|
+
children: name ?? url,
|
|
30
|
+
})
|
|
31
|
+
),
|
|
30
32
|
],
|
|
31
33
|
});
|
|
32
34
|
}
|