@notadd/decorator
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

@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
    }
});

Readme

Keywords

none

Package Sidebar

Install

npm i @notadd/decorator

Weekly Downloads

0

Version

3.2.0

License

ISC

Unpacked Size

47.6 kB

Total Files

17

Last publish

Collaborators

  • tian-hun
  • lei3265018
  • zuohuadong
  • imeepos2