swc/bundler/tests/.cache/deno/29fe1d6a6c6f95c62987b34fe56254f99d87d067.ts
강동윤 1178686a4c
fix(bundler): Fix bundler (#1576)
swc_bundler:
 - Fix remapping of exports. (denoland/deno#9350)
2021-04-16 18:09:38 +00:00

23 lines
542 B
TypeScript

// Loaded from https://deno.land/x/cliffy@v0.12.1/packages/command/types/child-command.ts
import { Command } from '../lib/command.ts';
import { StringType } from './string.ts';
// @TODO: add exclude option
export class ChildCommandType extends StringType {
#cmd?: Command;
constructor( cmd?: Command ) {
super();
this.#cmd = cmd;
}
public complete( cmd: Command ): string[] {
return ( this.#cmd ?? cmd )?.getCommands( false )
.map( ( cmd: Command ) => cmd.getName() ) || [];
}
}