diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-30 16:50:12 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-09-04 16:24:58 +0200 |
commit | 8424c4026afd7304880a4ce8138a04ffb3d8c938 (patch) | |
tree | 5b42625a59307b03333aa7d293b40b4c90da8f73 /server/typings/utils.ts | |
parent | f69ec5f340638ef577e8f5b9b1fb844778656a1f (diff) | |
download | PeerTube-8424c4026afd7304880a4ce8138a04ffb3d8c938.tar.gz PeerTube-8424c4026afd7304880a4ce8138a04ffb3d8c938.tar.zst PeerTube-8424c4026afd7304880a4ce8138a04ffb3d8c938.zip |
Add auto follow back support for instances
Diffstat (limited to 'server/typings/utils.ts')
-rw-r--r-- | server/typings/utils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/typings/utils.ts b/server/typings/utils.ts index 4b5cf4d7e..1abb4f73e 100644 --- a/server/typings/utils.ts +++ b/server/typings/utils.ts | |||
@@ -11,3 +11,12 @@ export type PickWith<T, KT extends keyof T, V> = { | |||
11 | export type PickWithOpt<T, KT extends keyof T, V> = { | 11 | export type PickWithOpt<T, KT extends keyof T, V> = { |
12 | [P in KT]?: T[P] extends V ? V : never | 12 | [P in KT]?: T[P] extends V ? V : never |
13 | } | 13 | } |
14 | |||
15 | // https://github.com/krzkaczor/ts-essentials Rocks! | ||
16 | export type DeepPartial<T> = { | ||
17 | [P in keyof T]?: T[P] extends Array<infer U> | ||
18 | ? Array<DeepPartial<U>> | ||
19 | : T[P] extends ReadonlyArray<infer U> | ||
20 | ? ReadonlyArray<DeepPartial<U>> | ||
21 | : DeepPartial<T[P]> | ||
22 | }; | ||