(schema, baseCommand = '')
| 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…