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

Function stringConfigValue

src/lib/cli-config.ts:126–137  ·  view source on GitHub ↗
(keyName: string, defaultValue?: string)

Source from the content-addressed store, hash-verified

124
125 function stringConfigValue(keyName: string): string
126 function stringConfigValue(keyName: string, defaultValue: string): string
127 function stringConfigValue(keyName: string, defaultValue?: string): string | undefined {
128 if (keyName in profile) {
129 const configValue = profile[keyName]
130 if (typeof configValue === 'string') {
131 return configValue
132 }
133 logger.warn(`expected string value for config key ${keyName} but got ${typeof profile[keyName]}`)
134 return defaultValue
135 }
136 logger.trace(`key ${keyName} not found in ${description.profileName} config`)
137 return defaultValue
138 }
139
140 function stringArrayConfigValue(keyName: string, defaultValue: string[] = []): string[] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected