1 import type { Maybe } from '@proton/pass/types';
2 import { CRITERIA_MASKS, type CriteriaMasks } from '@proton/pass/types/worker/settings';
4 export const toggleCriteria = (setting: number, criteria: CriteriaMasks) =>
5 (setting = setting ^ CRITERIA_MASKS[criteria]);
7 export const hasCriteria = (setting: Maybe<number>, criteria: CriteriaMasks) =>
8 ((setting ?? 0) & CRITERIA_MASKS[criteria]) !== 0;