mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
[EC-473] Add feature flags to common code (#3324)
This commit is contained in:
@@ -13,8 +13,6 @@ import { FolderView } from "@bitwarden/common/models/view/folderView";
|
||||
import { Response } from "@bitwarden/node/cli/models/response";
|
||||
import { MessageResponse } from "@bitwarden/node/cli/models/response/messageResponse";
|
||||
|
||||
import { FlagName, Flags } from "./flags";
|
||||
|
||||
export class CliUtils {
|
||||
static writeLn(s: string, finalLine = false, error = false) {
|
||||
const stream = error ? process.stderr : process.stdout;
|
||||
@@ -253,18 +251,4 @@ export class CliUtils {
|
||||
static convertBooleanOption(optionValue: any) {
|
||||
return optionValue || optionValue === "" ? true : false;
|
||||
}
|
||||
|
||||
static flagEnabled(flag: FlagName) {
|
||||
return this.flags[flag] == null || this.flags[flag];
|
||||
}
|
||||
|
||||
private static get flags(): Flags {
|
||||
const envFlags = process.env.FLAGS;
|
||||
|
||||
if (typeof envFlags === "string") {
|
||||
return JSON.parse(envFlags) as Flags;
|
||||
} else {
|
||||
return envFlags as Flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user