(cmd, subCmd)
| 212 | |
| 213 | // Helper to get custom definitions from a command/subcommand |
| 214 | const getCustomDefinitions = (cmd, subCmd) => { |
| 215 | if (!cmd) { |
| 216 | return [] |
| 217 | } |
| 218 | |
| 219 | try { |
| 220 | const command = Npm.cmd(cmd) |
| 221 | |
| 222 | // Check if the command has subcommands |
| 223 | if (subCmd && command.subcommands && command.subcommands[subCmd]) { |
| 224 | const subcommand = command.subcommands[subCmd] |
| 225 | // All subcommands have definitions |
| 226 | return subcommand.definitions |
| 227 | } |
| 228 | |
| 229 | // Check if the command itself has definitions |
| 230 | if (command.definitions) { |
| 231 | return command.definitions |
| 232 | } |
| 233 | } catch { |
| 234 | // Command not found or no definitions |
| 235 | } |
| 236 | |
| 237 | return [] |
| 238 | } |
| 239 | |
| 240 | // Helper to get all config names including aliases from custom definitions |
| 241 | const getCustomConfigNames = (customDefs) => { |
no test coverage detected
searching dependent graphs…