docusaurus-plugin-openapi-docs 0.0.0-beta.660 → 0.0.0-beta.662

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/lib/index.js CHANGED
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getDocsPluginConfig = exports.isURL = void 0;
13
13
  const fs_1 = __importDefault(require("fs"));
14
14
  const path_1 = __importDefault(require("path"));
15
+ const zlib_1 = __importDefault(require("zlib"));
15
16
  const utils_1 = require("@docusaurus/utils");
16
17
  const chalk_1 = __importDefault(require("chalk"));
17
18
  const mustache_1 = require("mustache");
@@ -200,7 +201,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
200
201
  }
201
202
  }
202
203
  if (item.type === "api") {
203
- item.json = JSON.stringify(item.api);
204
+ // opportunity to compress JSON
205
+ // const serialize = (o: any) => {
206
+ // return zlib.deflateSync(JSON.stringify(o)).toString("base64");
207
+ // };
208
+ // const deserialize = (s: any) => {
209
+ // return zlib.inflateSync(Buffer.from(s, "base64")).toString();
210
+ // };
211
+ item.json = zlib_1.default
212
+ .deflateSync(JSON.stringify(item.api))
213
+ .toString("base64");
204
214
  let infoBasePath = `${outputDir}/${item.infoId}`;
205
215
  if (docRouteBasePath) {
206
216
  infoBasePath = `${docRouteBasePath}/${outputDir
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-openapi-docs",
3
3
  "description": "OpenAPI plugin for Docusaurus.",
4
- "version": "0.0.0-beta.660",
4
+ "version": "0.0.0-beta.662",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -60,5 +60,5 @@
60
60
  "engines": {
61
61
  "node": ">=14"
62
62
  },
63
- "gitHead": "ab105a0abb66443e79dc1331b05b874f362d894f"
63
+ "gitHead": "795ea43669b5067b900527b42dc18d97a0534af9"
64
64
  }
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