docusaurus-plugin-openapi-docs 0.0.0-613 → 0.0.0-616

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";
@@ -264,7 +265,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
264
265
  : tagPageGenerator(item);
265
266
  item.markdown = markdown;
266
267
  if (item.type === "api") {
267
- item.json = JSON.stringify(item.api);
268
+ // opportunity to compress JSON
269
+ // const serialize = (o: any) => {
270
+ // return zlib.deflateSync(JSON.stringify(o)).toString("base64");
271
+ // };
272
+ // const deserialize = (s: any) => {
273
+ // return zlib.inflateSync(Buffer.from(s, "base64")).toString();
274
+ // };
275
+ item.json = zlib
276
+ .deflateSync(JSON.stringify(item.api))
277
+ .toString("base64");
268
278
  let infoBasePath = `${outputDir}/${item.infoId}`;
269
279
  if (docRouteBasePath) {
270
280
  infoBasePath = `${docRouteBasePath}/${outputDir