docusaurus-plugin-openapi-docs 0.0.0-495 → 0.0.0-496

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/index.js CHANGED
@@ -27,15 +27,18 @@ function getDocsPluginConfig(presetsPlugins, pluginId) {
27
27
  // eslint-disable-next-line array-callback-return
28
28
  const filteredConfig = presetsPlugins.filter((data) => {
29
29
  // Search presets
30
- if (data[0].endsWith(pluginId)) {
31
- return data[1];
32
- }
33
- // Search plugin-content-docs instances
34
- if (data[0] === "@docusaurus/plugin-content-docs") {
35
- const configPluginId = data[1].id ? data[1].id : "default";
36
- if (configPluginId === pluginId) {
30
+ if (Array.isArray(data)) {
31
+ if (typeof data[0] === "string" && data[0].endsWith(pluginId)) {
37
32
  return data[1];
38
33
  }
34
+ // Search plugin-content-docs instances
35
+ if (typeof data[0] === "string" &&
36
+ data[0] === "@docusaurus/plugin-content-docs") {
37
+ const configPluginId = data[1].id ? data[1].id : "default";
38
+ if (configPluginId === pluginId) {
39
+ return data[1];
40
+ }
41
+ }
39
42
  }
40
43
  })[0];
41
44
  if (filteredConfig) {
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-495",
4
+ "version": "0.0.0-496",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -68,5 +68,5 @@
68
68
  "engines": {
69
69
  "node": ">=14"
70
70
  },
71
- "gitHead": "97566d7e38840a71f7d6ea1a92b9db425e5bed8c"
71
+ "gitHead": "2fdc948f4a14af0d135b6c18fb7823f4a4f578a9"
72
72
  }
package/src/index.ts CHANGED
@@ -30,18 +30,24 @@ export function getDocsPluginConfig(
30
30
  // eslint-disable-next-line array-callback-return
31
31
  const filteredConfig = presetsPlugins.filter((data) => {
32
32
  // Search presets
33
- if (data[0].endsWith(pluginId)) {
34
- return data[1];
35
- }
36
-
37
- // Search plugin-content-docs instances
38
- if (data[0] === "@docusaurus/plugin-content-docs") {
39
- const configPluginId = data[1].id ? data[1].id : "default";
40
- if (configPluginId === pluginId) {
33
+ if (Array.isArray(data)) {
34
+ if (typeof data[0] === "string" && data[0].endsWith(pluginId)) {
41
35
  return data[1];
42
36
  }
37
+
38
+ // Search plugin-content-docs instances
39
+ if (
40
+ typeof data[0] === "string" &&
41
+ data[0] === "@docusaurus/plugin-content-docs"
42
+ ) {
43
+ const configPluginId = data[1].id ? data[1].id : "default";
44
+ if (configPluginId === pluginId) {
45
+ return data[1];
46
+ }
47
+ }
43
48
  }
44
49
  })[0];
50
+
45
51
  if (filteredConfig) {
46
52
  // Search presets, e.g. "classic"
47
53
  if (filteredConfig[0].endsWith(pluginId)) {