mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-28 07:49:41 +01:00
Remove unnecessary type
This commit is contained in:
parent
730db3545a
commit
abb254cafb
@ -1,9 +1,7 @@
|
|||||||
import { map } from "rxjs";
|
import { map } from "rxjs";
|
||||||
|
|
||||||
type ObjectWithId<TId> = { id: TId };
|
export const getById = <TId, T extends { id: TId }>(id: TId) =>
|
||||||
|
|
||||||
export const getById = <TId, T extends ObjectWithId<TId>>(id: TId) =>
|
|
||||||
map<T[], T>((objects) => objects.find((o) => o.id === id));
|
map<T[], T>((objects) => objects.find((o) => o.id === id));
|
||||||
|
|
||||||
export const getByIds = <TId, T extends ObjectWithId<TId>>(ids: TId[]) =>
|
export const getByIds = <TId, T extends { id: TId }>(ids: TId[]) =>
|
||||||
map<T[], T[]>((objects) => objects.filter((o) => ids.includes(o.id)));
|
map<T[], T[]>((objects) => objects.filter((o) => ids.includes(o.id)));
|
||||||
|
Loading…
Reference in New Issue
Block a user