mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-09-03 20:53:09 -05:00
Refactor search query options
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user