mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
enum op exhaustion
This commit is contained in:
parent
72e2a18f03
commit
547634efb9
1 changed files with 3 additions and 1 deletions
|
|
@ -4,7 +4,9 @@ import { AssetVisibility } from 'src/enum';
|
|||
import { requireElevatedPermission } from 'src/utils/access';
|
||||
|
||||
type EnumField = 'type' | 'visibility';
|
||||
type EnumCondition<T> = { eq?: T; ne?: T; in?: T[]; notIn?: T[] };
|
||||
type EnumOperator = keyof NonNullable<SearchFilterBranch[EnumField]>;
|
||||
type EnumOperandMap<T> = { eq: T; ne: T; in: T[]; notIn: T[] };
|
||||
type EnumCondition<T> = { [K in EnumOperator]?: EnumOperandMap<T>[K] };
|
||||
type IdsFilterField = 'albumIds' | 'personIds' | 'tagIds';
|
||||
|
||||
const filterBranches = (filter: SearchFilter): SearchFilterBranch[] => [filter, ...(filter.or ?? [])];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue