@notadd/decorator
v3.2.0
Published
> TODO: description
Downloads
3
Keywords
Readme
@notadd/decorator
一款简单的自定义装饰器工具
import { createClassDecorator } from '@notadd/decorator';
export const CommandMetadataKey = `CommandMetadataKey`;
export interface CommandOptions {
name: string;
alias?: string;
desc?: string;
opts?: {
noHelp?: boolean;
isDefault?: boolean;
};
}
export const Command = createClassDecorator<CommandOptions>(CommandMetadataKey, (target: any) => {
return {
name: target.name
}
});