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

Function extractValueFromObject

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

* Extracts the value property from an object if it exists * @param item - The item to extract from * @returns The value property or the item itself

(item: any)

Source from the content-addressed store, hash-verified

377 * @returns The value property or the item itself
378 */
379function extractValueFromObject(item: any): any {
380 if (typeof item === 'object' && isNotNullish(item) && isNotNullish(item.value)) {
381 return item.value;
382 }
383 return item;
384}
385
386/**
387 * Helper function to normalize control values - extracts values from object formats

Callers 1

normalizeControlValueFunction · 0.85

Calls 1

isNotNullishFunction · 0.70

Tested by

no test coverage detected