]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/core-utils/utils/object.ts
Search channels against handles and not names
[github/Chocobozzz/PeerTube.git] / shared / core-utils / utils / object.ts
1 function pick <T extends object> (object: T, keys: (keyof T)[]) {
2 const result: Partial<T> = {}
3
4 for (const key of keys) {
5 if (Object.prototype.hasOwnProperty.call(object, key)) {
6 result[key] = object[key]
7 }
8 }
9
10 return result
11 }
12
13 export {
14 pick
15 }