mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
feat: include font licenses in the licenses section
This commit is contained in:
committed by
Rainer Killinger
parent
a4de628495
commit
82479f463c
@@ -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>);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user