(mapArguments, boundOptions, deepOptions, setBoundExeca)
| 11 | // - optional argument/options: execa(file), execa(file, args), execa(file, options), execa(file, args, options) |
| 12 | // `mapArguments()` and `setBoundExeca()` allows for method-specific logic. |
| 13 | export const createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => { |
| 14 | const createNested = (mapArguments, boundOptions, setBoundExeca) => createExeca(mapArguments, boundOptions, deepOptions, setBoundExeca); |
| 15 | const boundExeca = (...execaArguments) => callBoundExeca({ |
| 16 | mapArguments, |
| 17 | deepOptions, |
| 18 | boundOptions, |
| 19 | setBoundExeca, |
| 20 | createNested, |
| 21 | }, ...execaArguments); |
| 22 | |
| 23 | if (setBoundExeca !== undefined) { |
| 24 | setBoundExeca(boundExeca, createNested, boundOptions); |
| 25 | } |
| 26 | |
| 27 | return boundExeca; |
| 28 | }; |
| 29 | |
| 30 | const callBoundExeca = ({mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested}, firstArgument, ...nextArguments) => { |
| 31 | if (isPlainObject(firstArgument)) { |
no outgoing calls
no test coverage detected