當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.descriptorOf函數代碼示例

本文整理匯總了TypeScript中@tsed/core.descriptorOf函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript descriptorOf函數的具體用法?TypeScript descriptorOf怎麽用?TypeScript descriptorOf使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了descriptorOf函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: before

 before(() => {
   ReturnsArray({
     description: "Success",
     type: Test
   })(Test, "test4", descriptorOf(Test, "test4"));
   this.store = Store.fromMethod(Test, "test4");
 });
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:7,代碼來源:returnsArray.spec.ts

示例2: before

 before(() => {
   try {
     Inject()(Test, "test", descriptorOf(Test, "test"));
   } catch (er) {
     this.error = er;
   }
 });
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:7,代碼來源:inject.spec.ts

示例3: AutoMapKey

/**
 * Internal use only.
 * @returns {Function}
 * @decorator
 * @private
 * @param target
 * @param propertyKey
 */
function AutoMapKey(target: any, propertyKey: string): any {
  AUTO_MAP_KEYS.push(propertyKey);

  const descriptor = descriptorOf(target, propertyKey) || {configurable: true, writable: true};
  descriptor.enumerable = true;

  return descriptor;
}
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:16,代碼來源:JsonSchema.ts

示例4: before

      before(() => {
        this.store = new Store([Test.prototype, "test", descriptorOf(Test.prototype, "test")]);
        this.store.delete("multipartAdded");
        this.store.delete(MultipartFileMiddleware);

        this.storeFromMethodStub.returns(this.store);

        this.getParamTypesStub.returns([Array]);

        MultipartFile("file1", 8)(Test.prototype, "test", 0);
      });
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:11,代碼來源:multipartFile.spec.ts

示例5: it

    it("should set the responses", () => {
      // WHEN
      Responses(400, {
        description: "Bad Request"
      })(prototypeOf(Test), "test", descriptorOf(Test, "test"));

      // THEN
      const store = Store.fromMethod(Test, "test");

      store.get("responses").should.deep.eq({
        "400": {
          description: "Bad Request"
        }
      });
    });
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:15,代碼來源:responses.spec.ts

示例6: it

    it("should set the operation", () => {
      // WHEN
      Operation({
        security: [
          {"auth": ["scope"]}
        ]
      })(prototypeOf(Test), "test", descriptorOf(Test, "test"));

      // THEN
      const store = Store.fromMethod(Test, "test");

      store.get("operation").should.deep.eq({
        security: [
          {"auth": ["scope"]}
        ]
      });
    });
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:17,代碼來源:operation.spec.ts

示例7: store

 /**
  * Store a data on store manager.
  * @param targetClass
  * @param methodClassName
  * @returns {any}
  */
 static store(targetClass: any, methodClassName: string): Store {
   return Store.from(targetClass, methodClassName, descriptorOf(targetClass, methodClassName));
 }
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:9,代碼來源:EndpointRegistry.ts

示例8: before

 before(() => {
   Security("securityDefinitionName", "scope1", "scope2")(prototypeOf(Test), "test", descriptorOf(Test, "test"));
   this.store = Store.from(Test, "test", descriptorOf(Test, "test"));
 });
開發者ID:Romakita,項目名稱:ts-express-decorators,代碼行數:4,代碼來源:security.spec.ts


注:本文中的@tsed/core.descriptorOf函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。