MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / isValidSelectOptionWithOnlyValue

Function isValidSelectOptionWithOnlyValue

botasaurus-controls/src/index.ts:321–327  ·  view source on GitHub ↗

* Validates that an item is a valid select option object with only value and label properties * @param item - The item to validate * @returns true if valid, false otherwise

(item: any)

Source from the content-addressed store, hash-verified

319 * @returns true if valid, false otherwise
320 */
321function isValidSelectOptionWithOnlyValue(item: any): boolean {
322 if (typeof item !== "object" || !item) return false;
323
324 const hasValue = isNotNullish(item.value) && typeof item.value === "string" && item.value.trim() !== "";
325
326 return hasValue;
327}
328
329
330/**

Callers 1

Calls 1

isNotNullishFunction · 0.70

Tested by

no test coverage detected