Skip to content

Commit 174c2db

Browse files
authored
[Bug] Use endsWith to match docsPluginId to preset (#305)
* Use endsWith to match docsPluginId to preset * Remove unused import
1 parent 95550eb commit 174c2db

File tree

1 file changed

+3
-2
lines changed
  • packages/docusaurus-plugin-openapi-docs/src

1 file changed

+3
-2
lines changed

packages/docusaurus-plugin-openapi-docs/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export function getDocsPluginConfig(
2929
): Object | undefined {
3030
// eslint-disable-next-line array-callback-return
3131
const filteredConfig = presetsPlugins.filter((data) => {
32-
if (data[0] === pluginId) {
32+
// Search presets
33+
if (data[0].endsWith(pluginId)) {
3334
return data[1];
3435
}
3536

@@ -43,7 +44,7 @@ export function getDocsPluginConfig(
4344
})[0];
4445
if (filteredConfig) {
4546
// Search presets, e.g. "classic"
46-
if (filteredConfig[0] === pluginId) {
47+
if (filteredConfig[0].endsWith(pluginId)) {
4748
return filteredConfig[1].docs;
4849
}
4950

0 commit comments

Comments
 (0)