Skip to content

Commit

Permalink
handle both compressed and uncompression api prop
Browse files Browse the repository at this point in the history
  • Loading branch information
sserrata committed Apr 13, 2024
1 parent a9ffec1 commit 71627f9
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ export default function ApiItem(props: Props): JSX.Element {
const { schema } = frontMatter as SchemaFrontMatter;
// decompress and parse
if (api) {
api = JSON.parse(
zlib.inflateSync(Buffer.from(api as any, "base64")).toString()
);
try {
api = JSON.parse(
zlib.inflateSync(Buffer.from(api as any, "base64")).toString()
);
} catch {}
}

const { siteConfig } = useDocusaurusContext();
const themeConfig = siteConfig.themeConfig as ThemeConfig;
const options = themeConfig.api;
Expand Down

0 comments on commit 71627f9

Please sign in to comment.