aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/types/utils.ts')
-rw-r--r--server/types/utils.ts24
1 files changed, 0 insertions, 24 deletions
diff --git a/server/types/utils.ts b/server/types/utils.ts
deleted file mode 100644
index 55500d8c4..000000000
--- a/server/types/utils.ts
+++ /dev/null
@@ -1,24 +0,0 @@
1/* eslint-disable @typescript-eslint/array-type */
2
3export type FunctionPropertyNames<T> = {
4 [K in keyof T]: T[K] extends Function ? K : never
5}[keyof T]
6
7export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>
8
9export type PickWith<T, KT extends keyof T, V> = {
10 [P in KT]: T[P] extends V ? V : never
11}
12
13export type PickWithOpt<T, KT extends keyof T, V> = {
14 [P in KT]?: T[P] extends V ? V : never
15}
16
17// https://github.com/krzkaczor/ts-essentials Rocks!
18export type DeepPartial<T> = {
19 [P in keyof T]?: T[P] extends Array<infer U>
20 ? Array<DeepPartial<U>>
21 : T[P] extends ReadonlyArray<infer U>
22 ? ReadonlyArray<DeepPartial<U>>
23 : DeepPartial<T[P]>
24}