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

Function promptFromNaming

src/lib/command/select.ts:21–23  ·  view source on GitHub ↗
(config: Naming)

Source from the content-addressed store, hash-verified

19export type SelectFromListConfig<L extends object> = Sorting<L> & Naming & OutputListConfig<L>
20
21/**
22 * Make a decent guess as to the correct indefinite article for a word. Anything that uses this
23 * should allow a manual override for exceptions. (e.g. the prompt message for `selectFromList`
24 * is automatically generated using the item name but can be overridden with `promptMessage`)
25 */
26export const indefiniteArticleFor = (name: string): string => name.match(/^[aeio]/i) ? 'an' : 'a'

Callers 1

promptUserFunction · 0.85

Calls 1

indefiniteArticleForFunction · 0.85

Tested by

no test coverage detected