(...args)
| 1 | import { Options } from '../../lib/types'; |
| 2 | |
| 3 | export function processCommandArgs<CommandOptions>(...args): { |
| 4 | paths: string[]; |
| 5 | options: Options & CommandOptions; |
| 6 | } { |
| 7 | let options = {} as any as Options & CommandOptions; |
| 8 | |
| 9 | if (typeof args[args.length - 1] === 'object') { |
| 10 | options = args.pop() as any as Options & CommandOptions; |
| 11 | } |
| 12 | args = args.filter(Boolean); |
| 13 | |
| 14 | // For repository scanning, populate with default path (cwd) if no path given |
| 15 | if (args.length === 0 && !options.docker) { |
| 16 | args.unshift(process.cwd()); |
| 17 | } |
| 18 | |
| 19 | return { options, paths: args }; |
| 20 | } |
no outgoing calls