本文整理匯總了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;
}