]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/core-utils/utils/object.ts
Embed stats only when needed
[github/Chocobozzz/PeerTube.git] / shared / core-utils / utils / object.ts
index 7b2bb81d0064158c5bfb30f3c68096d7b0b0d3bb..9a8a98f9b9fc90c815d1185f88521338387fb266 100644 (file)
@@ -1,5 +1,5 @@
-function pick <T extends object> (object: T, keys: (keyof T)[]) {
-  const result: Partial<T> = {}
+function pick <O extends object, K extends keyof O> (object: O, keys: K[]): Pick<O, K> {
+  const result: any = {}
 
   for (const key of keys) {
     if (Object.prototype.hasOwnProperty.call(object, key)) {