From 174c2db2c3b8d83309680599bca87eaa72a8ca00 Mon Sep 17 00:00:00 2001 From: Steven Serrata <9343811+sserrata@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:34:03 -0400 Subject: [PATCH] [Bug] Use endsWith to match docsPluginId to preset (#305) * Use endsWith to match docsPluginId to preset * Remove unused import --- packages/docusaurus-plugin-openapi-docs/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-plugin-openapi-docs/src/index.ts b/packages/docusaurus-plugin-openapi-docs/src/index.ts index bf65fe308..c68e48e8e 100644 --- a/packages/docusaurus-plugin-openapi-docs/src/index.ts +++ b/packages/docusaurus-plugin-openapi-docs/src/index.ts @@ -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]; } @@ -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; }