feat: include font licenses in the licenses section

This commit is contained in:
Thea Schöbl
2022-08-08 14:05:30 +00:00
committed by Rainer Killinger
parent a4de628495
commit 82479f463c
10 changed files with 113 additions and 71 deletions

View File

@@ -27,3 +27,18 @@ export function pick<T extends object, U extends keyof T>(
return accumulator;
}, {} as Pick<T, U>);
}
/**
* Pick a set of properties from an object using a predicate function
*/
export function pickBy<T extends object, U extends keyof T>(
object: T,
predicate: (value: T[U], key: U) => boolean,
): Pick<T, U> {
return (Object.keys(object) as U[]).reduce((accumulator, key) => {
if (predicate(object[key], key)) {
accumulator[key] = object[key];
}
return accumulator;
}, {} as Pick<T, U>);
}