@bagelink/sdk 1.7.43 → 1.7.47
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
|
@@ -422,11 +422,11 @@ function parseParameter(paramStr) {
|
|
|
422
422
|
const trimmed = paramStr.trim();
|
|
423
423
|
const isOptional = trimmed.includes("?:");
|
|
424
424
|
const nameMatch = trimmed.match(/^([a-z_$][\w$]*)/i);
|
|
425
|
-
const name = nameMatch
|
|
425
|
+
const name = nameMatch?.[1] || "";
|
|
426
426
|
const typeMatch = trimmed.match(/:\s*([^=]+)/);
|
|
427
|
-
const type = typeMatch
|
|
427
|
+
const type = typeMatch?.[1]?.trim() || "any";
|
|
428
428
|
const defaultMatch = trimmed.match(/[=](.+)$/);
|
|
429
|
-
const defaultValue = defaultMatch
|
|
429
|
+
const defaultValue = defaultMatch?.[1]?.trim();
|
|
430
430
|
return { name, type, defaultValue, isOptional };
|
|
431
431
|
}
|
|
432
432
|
function combineAllParams(parameters, requestBodyParam) {
|
package/dist/index.mjs
CHANGED
|
@@ -416,11 +416,11 @@ function parseParameter(paramStr) {
|
|
|
416
416
|
const trimmed = paramStr.trim();
|
|
417
417
|
const isOptional = trimmed.includes("?:");
|
|
418
418
|
const nameMatch = trimmed.match(/^([a-z_$][\w$]*)/i);
|
|
419
|
-
const name = nameMatch
|
|
419
|
+
const name = nameMatch?.[1] || "";
|
|
420
420
|
const typeMatch = trimmed.match(/:\s*([^=]+)/);
|
|
421
|
-
const type = typeMatch
|
|
421
|
+
const type = typeMatch?.[1]?.trim() || "any";
|
|
422
422
|
const defaultMatch = trimmed.match(/[=](.+)$/);
|
|
423
|
-
const defaultValue = defaultMatch
|
|
423
|
+
const defaultValue = defaultMatch?.[1]?.trim();
|
|
424
424
|
return { name, type, defaultValue, isOptional };
|
|
425
425
|
}
|
|
426
426
|
function combineAllParams(parameters, requestBodyParam) {
|
package/package.json
CHANGED
|
@@ -271,10 +271,10 @@ function generateFunctionParameters(
|
|
|
271
271
|
* @returns Object containing parsed parameter information
|
|
272
272
|
*/
|
|
273
273
|
function parseParameter(paramStr: string): {
|
|
274
|
-
name
|
|
275
|
-
type
|
|
274
|
+
name?: string
|
|
275
|
+
type?: string
|
|
276
276
|
defaultValue?: string
|
|
277
|
-
isOptional
|
|
277
|
+
isOptional?: boolean
|
|
278
278
|
} {
|
|
279
279
|
const trimmed = paramStr.trim()
|
|
280
280
|
|
|
@@ -283,15 +283,15 @@ function parseParameter(paramStr: string): {
|
|
|
283
283
|
|
|
284
284
|
// Extract parameter name
|
|
285
285
|
const nameMatch = trimmed.match(/^([a-z_$][\w$]*)/i)
|
|
286
|
-
const name = nameMatch
|
|
286
|
+
const name = nameMatch?.[1] || ''
|
|
287
287
|
|
|
288
288
|
// Extract type (between : and = or end of string)
|
|
289
289
|
const typeMatch = trimmed.match(/:\s*([^=]+)/)
|
|
290
|
-
const type = typeMatch
|
|
290
|
+
const type = typeMatch?.[1]?.trim() || 'any'
|
|
291
291
|
|
|
292
292
|
// Extract default value if exists
|
|
293
293
|
const defaultMatch = trimmed.match(/[=](.+)$/)
|
|
294
|
-
const defaultValue = defaultMatch
|
|
294
|
+
const defaultValue = defaultMatch?.[1]?.trim()
|
|
295
295
|
|
|
296
296
|
return { name, type, defaultValue, isOptional }
|
|
297
297
|
}
|