Skip to content

Commit

Permalink
[Bug] Use endsWith to match docsPluginId to preset (#305)
Browse files Browse the repository at this point in the history
* Use endsWith to match docsPluginId to preset

* Remove unused import
  • Loading branch information
sserrata authored Oct 19, 2022
1 parent 95550eb commit 174c2db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/docusaurus-plugin-openapi-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export function getDocsPluginConfig(
): Object | undefined {
// eslint-disable-next-line array-callback-return
const filteredConfig = presetsPlugins.filter((data) => {
if (data[0] === pluginId) {
// Search presets
if (data[0].endsWith(pluginId)) {
return data[1];
}

Expand All @@ -43,7 +44,7 @@ export function getDocsPluginConfig(
})[0];
if (filteredConfig) {
// Search presets, e.g. "classic"
if (filteredConfig[0] === pluginId) {
if (filteredConfig[0].endsWith(pluginId)) {
return filteredConfig[1].docs;
}

Expand Down

0 comments on commit 174c2db

Please sign in to comment.