@bagelink/sdk 0.0.1074 → 0.0.1078
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 +7 -5
- package/dist/index.mjs +7 -5
- package/package.json +1 -1
- package/src/openAPITools/utils.ts +7 -6
package/dist/index.cjs
CHANGED
|
@@ -66,11 +66,13 @@ const cleanOptionals = (str) => str.split(" | ").filter((t) => t !== "null" && t
|
|
|
66
66
|
function formatVarType(varName, schema, required = false, defaultValue) {
|
|
67
67
|
let type = schemaToType(schema);
|
|
68
68
|
type = cleanOptionals(type);
|
|
69
|
-
let defaultStr =
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
let defaultStr = "";
|
|
70
|
+
if (defaultValue) {
|
|
71
|
+
if (typeof defaultValue === "string") {
|
|
72
|
+
defaultStr = ` = '${defaultValue}'`;
|
|
73
|
+
} else {
|
|
74
|
+
defaultStr = ` = ${defaultValue}`;
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
let optionalStr = required || isOptional(schema) ? "?" : "";
|
|
76
78
|
if (defaultStr)
|
package/dist/index.mjs
CHANGED
|
@@ -60,11 +60,13 @@ const cleanOptionals = (str) => str.split(" | ").filter((t) => t !== "null" && t
|
|
|
60
60
|
function formatVarType(varName, schema, required = false, defaultValue) {
|
|
61
61
|
let type = schemaToType(schema);
|
|
62
62
|
type = cleanOptionals(type);
|
|
63
|
-
let defaultStr =
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
let defaultStr = "";
|
|
64
|
+
if (defaultValue) {
|
|
65
|
+
if (typeof defaultValue === "string") {
|
|
66
|
+
defaultStr = ` = '${defaultValue}'`;
|
|
67
|
+
} else {
|
|
68
|
+
defaultStr = ` = ${defaultValue}`;
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
let optionalStr = required || isOptional(schema) ? "?" : "";
|
|
70
72
|
if (defaultStr)
|
package/package.json
CHANGED
|
@@ -65,12 +65,13 @@ export function formatVarType(varName: string, schema: any, required = false, de
|
|
|
65
65
|
let type = schemaToType(schema)
|
|
66
66
|
type = cleanOptionals(type)
|
|
67
67
|
|
|
68
|
-
let defaultStr =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
let defaultStr = ''
|
|
69
|
+
if (defaultValue) {
|
|
70
|
+
if (typeof defaultValue === 'string') {
|
|
71
|
+
defaultStr = ` = '${defaultValue}'`
|
|
72
|
+
} else {
|
|
73
|
+
defaultStr = ` = ${defaultValue}`
|
|
74
|
+
}
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
let optionalStr = required || isOptional(schema) ? '?' : ''
|