本文整理汇总了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;未经允许,请勿转载。 |
请发表评论