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

Function related

src/lib/command-util.ts:19–33  ·  view source on GitHub ↗
(other: CommandModule)

Source from the content-addressed store, hash-verified

17 const topics = new Set<string>()
18 const subCommands: SubCommand[] = []
19 const related = (other: CommandModule): false | string => {
20 if (!other.command) {
21 return false
22 }
23
24 if (typeof other.command === 'string' && other.command.startsWith(topicName)) {
25 return other.command
26 }
27 if (typeof other.command === 'object') {
28 const match = other.command.find(name => name.startsWith(topicName))
29 return match ?? false
30 }
31
32 return false
33 }
34 for (const other of commands) {
35 const relatedCommandCommand = related(other)
36 if (relatedCommandCommand) {

Callers 1

findTopicsAndSubcommandsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected