Fixing an issue where old feature flags would cause issues, all feature flags are expected to be known, this allows unknown feature flags to just be ignored.

This commit is contained in:
mike12345567 2024-08-15 16:51:29 +01:00
parent 41f249cca6
commit 5c63439c8d
2 changed files with 549 additions and 154 deletions

View File

@ -159,11 +159,11 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
specificallySetFalse.add(feature)
}
if (!this.isFlagName(feature)) {
throw new Error(`Feature: ${feature} is not an allowed option`)
}
if (typeof flagValues[feature] !== "boolean") {
// check it's a known flag, confirm its boolean
if (
this.isFlagName(feature) &&
typeof flagValues[feature] !== "boolean"
) {
throw new Error(`Feature: ${feature} is not a boolean`)
}

693
yarn.lock

File diff suppressed because it is too large Load Diff