@alloc/types
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -52,2 +52,11 @@ /** Try to simplify `&` out of an object type */ | ||
/** Pick keys from a union of objects */ | ||
export type UnionPick<T, K> = Pick< | ||
T extends any | ||
? Intersect<K extends keyof T ? T : { [P in K & keyof any]?: undefined }> | ||
: never, | ||
// @ts-ignore | ||
K | ||
> | ||
/** Get the keys of each object type in a given union */ | ||
@@ -57,5 +66,3 @@ export type AllKeys<T> = T extends any ? keyof T : never | ||
/** Merge all object types in a given union. Property types are unioned. */ | ||
export type CombineObjects<T> = [AllKeys<T>] extends [infer U] | ||
? { [P in U & string]: CombineProp<T, P> } | ||
: never | ||
export type CombineObjects<T> = UnionPick<T, AllKeys<T>> | ||
@@ -62,0 +69,0 @@ /** |
{ | ||
"name": "@alloc/types", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"types": "index.d.ts", | ||
@@ -5,0 +5,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5424
95