MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / nameOfChoice

Function nameOfChoice

src/lib/item-input/select.ts:47–48  ·  view source on GitHub ↗
(choice: SelectDefChoice<T>)

Source from the content-addressed store, hash-verified

45 options?: SelectDefOptions<T>,
46): InputDefinition<T> {
47 const nameOfChoice = (choice: SelectDefChoice<T>): string =>
48 typeof choice === 'object' ? choice.name : choice.toString()
49 const valueOfChoice = (choice: SelectDefChoice<T>): T =>
50 (typeof choice === 'number' || typeof choice === 'string' ? choice : choice.value) as T
51

Callers 2

selectDefFunction · 0.85
editValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected