mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Update
This commit is contained in:
9
utils.ts
9
utils.ts
@@ -134,3 +134,12 @@ export function filterFilename(p: string, maxLength = 256) {
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
export type DiscriminatedUnion<
|
||||
K extends PropertyKey,
|
||||
T extends Record<PropertyKey, unknown>,
|
||||
> = {
|
||||
[P in keyof T]: ({ [Q in K]: P } & T[P]) extends infer U
|
||||
? { [Q in keyof U]: U[Q] }
|
||||
: never;
|
||||
}[keyof T];
|
||||
|
||||
Reference in New Issue
Block a user