@1szx1/vite-plugin-swagger2ts 1.3.13 → 1.3.15

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/dist/index.cjs CHANGED
@@ -124,7 +124,7 @@ function generateDocs(input, { docsName, baseUrl, formatSchema }) {
124
124
  return jsDoc({}, { key: method, result: `{${paramString ? `
125
125
  param:{${paramString}}` : ""}${responseString}}` });
126
126
  }).join("");
127
- return jsDoc({}, { key: `'${baseUrl}${endPoint}'`, result: `{${result}}` });
127
+ return jsDoc({}, { key: `${baseUrl}${endPoint}`, result: `{${result}}` });
128
128
  }).join("");
129
129
  const typeString = input.components?.schemas ? Object.entries(input.components.schemas).map(([name, schema]) => {
130
130
  if (typeof formatSchema == "function") {
@@ -208,7 +208,7 @@ function generatorResponseBodyType(schemas, docsName) {
208
208
  return jsDoc({ description }, { key: "response", result });
209
209
  }
210
210
  function jsDoc({ description, title, format, example, default: default1 }, { key, result, isRoot, isExport, isRequired }) {
211
- if (!/(^\[.+\]$)|(^[^\[\]]*$)/.test(key))
211
+ if (!(isRoot || isExport) && /^[^'"]*$/.test(key))
212
212
  key = `'${key}'`;
213
213
  const jsDoc2 = `
214
214
  /**
package/dist/index.mjs CHANGED
@@ -115,7 +115,7 @@ function generateDocs(input, { docsName, baseUrl, formatSchema }) {
115
115
  return jsDoc({}, { key: method, result: `{${paramString ? `
116
116
  param:{${paramString}}` : ""}${responseString}}` });
117
117
  }).join("");
118
- return jsDoc({}, { key: `'${baseUrl}${endPoint}'`, result: `{${result}}` });
118
+ return jsDoc({}, { key: `${baseUrl}${endPoint}`, result: `{${result}}` });
119
119
  }).join("");
120
120
  const typeString = input.components?.schemas ? Object.entries(input.components.schemas).map(([name, schema]) => {
121
121
  if (typeof formatSchema == "function") {
@@ -199,7 +199,7 @@ function generatorResponseBodyType(schemas, docsName) {
199
199
  return jsDoc({ description }, { key: "response", result });
200
200
  }
201
201
  function jsDoc({ description, title, format, example, default: default1 }, { key, result, isRoot, isExport, isRequired }) {
202
- if (!/(^\[.+\]$)|(^[^\[\]]*$)/.test(key))
202
+ if (!(isRoot || isExport) && /^[^'"]*$/.test(key))
203
203
  key = `'${key}'`;
204
204
  const jsDoc2 = `
205
205
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1szx1/vite-plugin-swagger2ts",
3
3
  "description": "forked from https://github.com/morelearn1990/vite-plugin-swagger2ts",
4
- "version": "1.3.13",
4
+ "version": "1.3.15",
5
5
  "license": "MIT",
6
6
  "author": "1SZX1 <2414126198@qq.com>",
7
7
  "repository": {