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

Function indefiniteArticleFor

src/lib/command/select.ts:19–19  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

17export type SelectFromListConfig<L extends object> = Sorting<L> & Naming & OutputListConfig<L>
18
19export const indefiniteArticleFor = (name: string): string => name.match(/^[aeio]/i) ? 'an' : 'a'
20
21function promptFromNaming(config: Naming): string | undefined {
22 return config.itemName ? `Select ${indefiniteArticleFor(config.itemName)} ${config.itemName}.` : undefined

Callers 2

promptFromNamingFunction · 0.85
select.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected