X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftypings%2Futils.ts;h=24d43b2587007611a1836bc3a881e562e243f5c3;hb=66a36740044242568ae7868842eb36a920b21544;hp=ed0fca3d156179acdea9d1c108e698680885094f;hpb=453e83ea5d81d203ba34bc43cd5c2c750ba40568;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/typings/utils.ts b/server/typings/utils.ts index ed0fca3d1..24d43b258 100644 --- a/server/typings/utils.ts +++ b/server/typings/utils.ts @@ -4,8 +4,6 @@ export type FunctionPropertyNames = { export type FunctionProperties = Pick> -export type ValueOf = T[KT] - export type PickWith = { [P in KT]: T[P] extends V ? V : never } @@ -13,3 +11,12 @@ export type PickWith = { export type PickWithOpt = { [P in KT]?: T[P] extends V ? V : never } + +// https://github.com/krzkaczor/ts-essentials Rocks! +export type DeepPartial = { + [P in keyof T]?: T[P] extends Array + ? Array> + : T[P] extends ReadonlyArray + ? ReadonlyArray> + : DeepPartial +}