docusaurus-plugin-openapi-docs 0.0.0-1156 → 0.0.0-1157
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.
|
@@ -11,7 +11,7 @@ const utils_1 = require("./utils");
|
|
|
11
11
|
function createLicense(license) {
|
|
12
12
|
if (!license || !Object.keys(license).length)
|
|
13
13
|
return "";
|
|
14
|
-
const { name, url } = license;
|
|
14
|
+
const { name, url, identifier } = license;
|
|
15
15
|
return (0, utils_1.create)("div", {
|
|
16
16
|
style: {
|
|
17
17
|
marginBottom: "var(--ifm-paragraph-margin-bottom)",
|
|
@@ -27,6 +27,10 @@ function createLicense(license) {
|
|
|
27
27
|
href: url,
|
|
28
28
|
children: name !== null && name !== void 0 ? name : url,
|
|
29
29
|
})),
|
|
30
|
+
(0, utils_1.guard)(identifier, () => (0, utils_1.create)("a", {
|
|
31
|
+
href: `https://spdx.org/licenses/${identifier}.html`,
|
|
32
|
+
children: name !== null && name !== void 0 ? name : identifier,
|
|
33
|
+
})),
|
|
30
34
|
],
|
|
31
35
|
});
|
|
32
36
|
}
|
package/lib/openapi/types.d.ts
CHANGED
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-1157",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=14"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "c2f848307b750b7473bbed7ae653a563456040a7"
|
|
69
69
|
}
|
|
@@ -10,7 +10,7 @@ import { LicenseObject } from "../openapi/types";
|
|
|
10
10
|
|
|
11
11
|
export function createLicense(license: LicenseObject) {
|
|
12
12
|
if (!license || !Object.keys(license).length) return "";
|
|
13
|
-
const { name, url } = license;
|
|
13
|
+
const { name, url, identifier } = license;
|
|
14
14
|
|
|
15
15
|
return create("div", {
|
|
16
16
|
style: {
|
|
@@ -29,6 +29,12 @@ export function createLicense(license: LicenseObject) {
|
|
|
29
29
|
children: name ?? url,
|
|
30
30
|
})
|
|
31
31
|
),
|
|
32
|
+
guard(identifier, () =>
|
|
33
|
+
create("a", {
|
|
34
|
+
href: `https://spdx.org/licenses/${identifier}.html`,
|
|
35
|
+
children: name ?? identifier,
|
|
36
|
+
})
|
|
37
|
+
),
|
|
32
38
|
],
|
|
33
39
|
});
|
|
34
40
|
}
|