1
0
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:
Thomas Rittson
2022-08-26 13:00:14 +10:00
committed by GitHub
parent aed78a5b61
commit 90137936fa
10 changed files with 261 additions and 114 deletions

View File

@@ -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;
}
}
}