From 4fa41bab0021f13250c7b643f77f3894cba21e3e Mon Sep 17 00:00:00 2001 From: "Xavier.Meng" Date: Sun, 1 Jan 2023 05:23:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A0JIRA=20refactor(base/extend):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B3=9B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/base.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typescript/core/base.ts b/typescript/core/base.ts index 79dc317af..e681f2ac4 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -177,7 +177,8 @@ export interface _base { functions: (object: object) => string[]; - extend: (object: object, ...sources: any[]) => object; + extend(object: T): T; + extend(object: T, ...sources: U[]): T & UnionToIntersection; defaults: (object: object, ...sources: any[]) => object; @@ -399,3 +400,11 @@ type merge = { deepExtend(object: any, ...otherArgs: any[]): any; } + +type UnionToIntersection = ( + Union extends unknown + ? (x: Union) => void + : never +) extends ((x: infer Intersection) => void) + ? Intersection + : never; From 106dca7d6ad44b28a50e73031c649cc0af7479a8 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 3 Jan 2023 11:16:00 +0800 Subject: [PATCH 2/2] auto upgrade version to 2.0.20230103111549 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d63cb5f5..373dd1c5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20230103094653", + "version": "2.0.20230103111549", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",