MCPcopy Index your code
hub / github.com/serverless/serverless / checkCommand

Function checkCommand

packages/sf-core/src/utils/cli/cli.js:83–102  ·  view source on GitHub ↗
(schema, baseCommand = '')

Source from the content-addressed store, hash-verified

81
82 // Recursive helper function to check commands
83 const checkCommand = (schema, baseCommand = '') => {
84 for (const item of schema) {
85 const fullCommand = baseCommand
86 ? `${baseCommand} ${item.command}`.trim()
87 : item.command
88
89 if (fullCommand === commandString) {
90 return true // Exact match found
91 }
92
93 // Check nested commands if they exist
94 if (item.builder) {
95 const nestedCheck = checkCommand(item.builder, fullCommand)
96 if (nestedCheck) {
97 return true
98 }
99 }
100 }
101 return false // Command not found
102 }
103
104 return checkCommand(schema)
105}

Callers 1

commandExistFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…