Browse Source

Merge pull request #215623 in DEC/fineui from master to feature/x

* commit '106dca7d6ad44b28a50e73031c649cc0af7479a8':
  auto upgrade version to 2.0.20230103111549
  无JIRA refactor(base/extend): 完善泛型
master
superman 2 years ago
parent
commit
71f133808f
  1. 2
      package.json
  2. 11
      typescript/core/base.ts

2
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",

11
typescript/core/base.ts

@ -177,7 +177,8 @@ export interface _base {
functions: (object: object) => string[];
extend: (object: object, ...sources: any[]) => object;
extend<T extends object>(object: T): T;
extend<T extends object, U extends object>(object: T, ...sources: U[]): T & UnionToIntersection<U>;
defaults: (object: object, ...sources: any[]) => object;
@ -399,3 +400,11 @@ type merge = {
deepExtend(object: any, ...otherArgs: any[]): any;
}
type UnionToIntersection<Union> = (
Union extends unknown
? (x: Union) => void
: never
) extends ((x: infer Intersection) => void)
? Intersection
: never;

Loading…
Cancel
Save