Skip to content

Commit

Permalink
refactor(decorators): allow @Command to infer name (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
sasial-dev authored Feb 10, 2024
1 parent dbe014d commit 6b7835f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/shared/core/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ export function Commander(options?: CommanderOptions): ClassDecorator {
};
}

export function Command(options: CommandOptions): MethodDecorator {
export function Command(options?: Partial<CommandOptions>): MethodDecorator {
return (target, key) => {
const commandData: CommandMetadata = {
options,
options: {
name: key,
...options,
},
func: target[key],
};
MetadataReflect.defineMetadata(
Expand Down

0 comments on commit 6b7835f

Please sign in to comment.