aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-12 14:09:04 +0200
committerChocobozzz <me@florianbigard.com>2021-05-12 14:12:14 +0200
commit16c016e8b1d5ca46343d3363f9a49e24c5d7c944 (patch)
tree157dfa22ac95bd76a411aaf78e4df17152530e1c /shared/core-utils
parent9a320a06b663a2e02c3156a07135f75f9e987b11 (diff)
downloadPeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.gz
PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.zst
PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.zip
Stricter models typing
Diffstat (limited to 'shared/core-utils')
-rw-r--r--shared/core-utils/miscs/types.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/shared/core-utils/miscs/types.ts b/shared/core-utils/miscs/types.ts
index bb64dc830..bd2a97b98 100644
--- a/shared/core-utils/miscs/types.ts
+++ b/shared/core-utils/miscs/types.ts
@@ -6,6 +6,10 @@ export type FunctionPropertyNames<T> = {
6 6
7export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>> 7export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>
8 8
9export type AttributesOnly<T> = {
10 [K in keyof T]: T[K] extends Function ? never : T[K]
11}
12
9export type PickWith<T, KT extends keyof T, V> = { 13export type PickWith<T, KT extends keyof T, V> = {
10 [P in KT]: T[P] extends V ? V : never 14 [P in KT]: T[P] extends V ? V : never
11} 15}