1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-29 12:55:21 +01:00
bitwarden-browser/apps/browser/src/flags.ts
2022-08-26 13:00:14 +10:00

33 lines
966 B
TypeScript

import {
flagEnabled as baseFlagEnabled,
devFlagEnabled as baseDevFlagEnabled,
devFlagValue as baseDevFlagValue,
SharedFlags,
SharedDevFlags,
} from "@bitwarden/common/misc/flags";
import { GroupPolicyEnvironment } from "./types/group-policy-environment";
// required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */
export type Flags = {} & SharedFlags;
// required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */
export type DevFlags = {
storeSessionDecrypted?: boolean;
managedEnvironment?: GroupPolicyEnvironment;
} & SharedDevFlags;
export function flagEnabled(flag: keyof Flags): boolean {
return baseFlagEnabled<Flags>(flag);
}
export function devFlagEnabled(flag: keyof DevFlags) {
return baseDevFlagEnabled<DevFlags>(flag);
}
export function devFlagValue(flag: keyof DevFlags) {
return baseDevFlagValue(flag);
}