docusaurus-plugin-openapi-docs 0.0.0-beta.661 → 0.0.0-beta.663

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/src/index.ts CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  import fs from "fs";
9
9
  import path from "path";
10
+ import zlib from "zlib";
10
11
 
11
12
  import type { LoadContext, Plugin } from "@docusaurus/types";
12
13
  import { Globby, posixPath } from "@docusaurus/utils";
@@ -244,7 +245,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
244
245
  }
245
246
  }
246
247
  if (item.type === "api") {
247
- item.json = JSON.stringify(item.api);
248
+ // opportunity to compress JSON
249
+ // const serialize = (o: any) => {
250
+ // return zlib.deflateSync(JSON.stringify(o)).toString("base64");
251
+ // };
252
+ // const deserialize = (s: any) => {
253
+ // return zlib.inflateSync(Buffer.from(s, "base64")).toString();
254
+ // };
255
+ item.json = zlib
256
+ .deflateSync(JSON.stringify(item.api))
257
+ .toString("base64");
248
258
  let infoBasePath = `${outputDir}/${item.infoId}`;
249
259
  if (docRouteBasePath) {
250
260
  infoBasePath = `${docRouteBasePath}/${outputDir