@elysiajs/openapi 1.3.6-exp.0 → 1.3.6

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/bunfig.toml ADDED
@@ -0,0 +1,2 @@
1
+ [install]
2
+ registry = "https://registry.npmjs.org/"
@@ -95,14 +95,16 @@ var fromTypes = (targetFilePath, {
95
95
  instance.indexOf("}, {", 3)
96
96
  ) + "}\n}\n";
97
97
  const routes = {};
98
- for (let route of routesString.slice(1).split("} & {")) {
99
- route = "{" + route + "}";
100
- let schema = (0, import_typemap.TypeBox)(route);
101
- if (schema.type !== "object") continue;
98
+ for (const route of routesString.slice(1).split("} & {")) {
99
+ let schema = (0, import_typemap.TypeBox)(`{${route}}}`);
100
+ if (schema.type !== "object") {
101
+ schema = (0, import_typemap.TypeBox)(`{${route}}`);
102
+ if (schema.type !== "object") continue;
103
+ }
102
104
  const paths = [];
103
105
  while (true) {
104
106
  const keys = Object.keys(schema.properties);
105
- if (!keys.length || keys.length > 1) break;
107
+ if (keys.length !== 1) break;
106
108
  paths.push(keys[0]);
107
109
  schema = schema.properties[keys[0]];
108
110
  if (!schema?.properties) break;
@@ -77,14 +77,16 @@ var fromTypes = (targetFilePath, {
77
77
  instance.indexOf("}, {", 3)
78
78
  ) + "}\n}\n";
79
79
  const routes = {};
80
- for (let route of routesString.slice(1).split("} & {")) {
81
- route = "{" + route + "}";
82
- let schema = TypeBox(route);
83
- if (schema.type !== "object") continue;
80
+ for (const route of routesString.slice(1).split("} & {")) {
81
+ let schema = TypeBox(`{${route}}}`);
82
+ if (schema.type !== "object") {
83
+ schema = TypeBox(`{${route}}`);
84
+ if (schema.type !== "object") continue;
85
+ }
84
86
  const paths = [];
85
87
  while (true) {
86
88
  const keys = Object.keys(schema.properties);
87
- if (!keys.length || keys.length > 1) break;
89
+ if (keys.length !== 1) break;
88
90
  paths.push(keys[0]);
89
91
  schema = schema.properties[keys[0]];
90
92
  if (!schema?.properties) break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elysiajs/openapi",
3
- "version": "1.3.6-exp.0",
3
+ "version": "1.3.6",
4
4
  "description": "Plugin for Elysia to auto-generate API documentation",
5
5
  "author": {
6
6
  "name": "saltyAom",