function startAndEnd(start = 'start', end = 'end') {
      ...
    }
    function log<Input extends new (...args: any[]) => any>(
      value: Input,
      context: ClassDecoratorContext
    ) {
      if (context.kind === "class") {
        return class extends value {
          constructor(...args: any[]) {
            super(args);
          }
          log(msg: string): void {
            console.log(msg);
          }
        };
      }
      return value;
    }
    function bound(originalMethod: unknown, context: ClassMethodDecoratorContext<any>) {
      const methodName = context.name;
      if (context.kind === 'method') {
        context.addInitializer(function () {
          this[methodName] = this[methodName].bind(this);
        });
      }
    }
    
    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.