mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[PM-11766] Introduce SDK client (#10974)
Integrate the SDK into our other clients.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type SharedFlags = {
|
||||
showPasswordless?: boolean;
|
||||
sdk?: boolean;
|
||||
};
|
||||
|
||||
// required to avoid linting errors when there are no flags
|
||||
@@ -28,7 +29,7 @@ function getFlags<T>(envFlags: string | T): T {
|
||||
* @returns The value of the flag
|
||||
*/
|
||||
export function flagEnabled<Flags extends SharedFlags>(flag: keyof Flags): boolean {
|
||||
const flags = getFlags<Flags>(process.env.FLAGS);
|
||||
const flags = getFlags<Flags>(process.env.FLAGS) ?? ({} as Flags);
|
||||
return flags[flag] == null || !!flags[flag];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user