Skip to content
Myr

fix(ts): action can be an async function (#1157)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Since we can use `parseAsync` for async functions so the action can be asynchronous. related to https://github.com/tj/commander.js/issues/806

authored by Prokop Simek · committed by GitHub · parent 6791884 · Browse files · 2 files+14 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−2 removed

  • other:+14 added−2 removed

2 files+14 added−2 removed

modified:typings/commander-tests.ts+13 added-1 removed
modified:typings/index.d.ts+1 added-1 removed
113 unmodified lines
114 * });115 *116 * @returns Command for chaining117 */118 action(fn: (...args: any[]) => void): Command;118 action(fn: (...args: any[]) => void | Promise<void>): Command;119120 /**121 * Define option with `flags`, `description` and optional122 * coercion `fn`.
189 unmodified lines