本文整理汇总了TypeScript中@tsed/core.deepExtends函数的典型用法代码示例。如果您正苦于以下问题:TypeScript deepExtends函数的具体用法?TypeScript deepExtends怎么用?TypeScript deepExtends使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deepExtends函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: schemaOptions
export function schemaOptions(target: any, options?: MongooseSchemaOptions) {
const store = Store.from(target);
options = deepExtends(store.get(MONGOOSE_SCHEMA_OPTIONS) || {}, options);
store.set(MONGOOSE_SCHEMA_OPTIONS, options);
return store.get(MONGOOSE_SCHEMA_OPTIONS);
}
示例2: deepExtends
oneOf: (collection, value) => {
const current = collection.find(current => current.type === value.type);
if (current) {
deepExtends(current, value);
} else {
collection.push(value);
}
return collection;
}
示例3: getSchema
/**
*
* @param {Type<any>} target
* @returns {JSONSchema6}
*/
private getSchema(target: Type<any>) {
const schemaDefinition: JSONSchema6 = {};
const schema = this.get(target);
if (schema) {
deepExtends(schemaDefinition, toObj(schema));
}
schemaDefinition.definitions = {};
this.findReferences(schemaDefinition, schemaDefinition.definitions as any);
return schemaDefinition;
}
示例4: ancestorsOf
return ancestorsOf(target).reduce((acc: JSONSchema6, target: Type<any>) => {
deepExtends(acc, this.getSchema(target));
return acc;
}, {});
示例5: merge
/**
*
* @param obj
*/
merge(obj: any): this {
deepExtends(this, obj);
return this;
}