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

Function stringArrayConfigValue

src/lib/cli-config.ts:139–152  ·  view source on GitHub ↗
(keyName: string, defaultValue: string[] = [])

Source from the content-addressed store, hash-verified

137 return defaultValue
138 }
139
140 function stringArrayConfigValue(keyName: string, defaultValue: string[] = []): string[] {
141 if (keyName in profile) {
142 const configValue = profile[keyName]
143 if (typeof configValue === 'string') {
144 return [configValue]
145 }
146 if (Array.isArray(configValue) && configValue.every(dir => typeof dir === 'string')) {
147 return configValue
148 }
149 logger.warn(`expected string or array of strings for config key ${keyName} but got ${typeof configValue}`)
150 return defaultValue
151 }
152 return defaultValue
153 }
154
155 function booleanConfigValue(keyName: string, defaultValue = false): boolean {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected