(
rawType: string | undefined,
{
tokenDisplay,
hasOptions,
allowCustomInput,
}: { tokenDisplay: string; hasOptions: boolean; allowCustomInput: boolean },
quiet = false,
)
| 361 | } |
| 362 | |
| 363 | function resolveInputType( |
| 364 | rawType: string | undefined, |
| 365 | { |
| 366 | tokenDisplay, |
| 367 | hasOptions, |
| 368 | allowCustomInput, |
| 369 | }: { tokenDisplay: string; hasOptions: boolean; allowCustomInput: boolean }, |
| 370 | quiet = false, |
| 371 | ): ValueInputType | undefined { |
| 372 | if (!rawType) return undefined; |
| 373 | const raw = rawType.trim().toLowerCase(); |
| 374 | // `boolean` is a friendly alias for the checkbox true/false picker. |
| 375 | const normalized = (raw === "boolean" ? "checkbox" : raw) as ValueInputType; |
| 376 | if (!OPTION_INCOMPATIBLE_TYPES.has(normalized)) { |
| 377 | if (!quiet) |
| 378 | log.logWarning( |
| 379 | `QuickAdd: Unsupported VALUE type "${rawType}" in token "${tokenDisplay}". Supported types: multiline, number, slider, checkbox, text.`, |
| 380 | ); |
| 381 | return undefined; |
| 382 | } |
| 383 | if (hasOptions || allowCustomInput) { |
| 384 | if (!quiet) |
| 385 | log.logWarning( |
| 386 | `QuickAdd: Ignoring type:${normalized} for option-list VALUE token "${tokenDisplay}".`, |
| 387 | ); |
| 388 | return undefined; |
| 389 | } |
| 390 | return normalized; |
| 391 | } |
| 392 | |
| 393 | function parseFiniteNumber(value: string | undefined): number | undefined { |
| 394 | if (value === undefined) return undefined; |
no test coverage detected