mirror of
https://github.com/sct/overseerr.git
synced 2025-12-27 00:34:56 +01:00
feat(frontend): initial search functionality (#78)
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
export type Undefinable<T> = T | undefined;
|
||||
export type Nullable<T> = T | null;
|
||||
export type Maybe<T> = T | null | undefined;
|
||||
|
||||
/**
|
||||
* Helps type objects with an abitrary number of properties that are
|
||||
* usually being defined at export.
|
||||
*
|
||||
* @param component Main object you want to apply properties to
|
||||
* @param properties Object of properties you want to type on the main component
|
||||
*/
|
||||
export function withProperties<A, B>(component: A, properties: B): A & B {
|
||||
(Object.keys(properties) as (keyof B)[]).forEach((key) => {
|
||||
Object.assign(component, { [key]: properties[key] });
|
||||
});
|
||||
return component as A & B;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user