Build the fallback document from each flag's secret. Truthy secret ⇒ enabled.
()
| 125 | |
| 126 | /** Build the fallback document from each flag's secret. Truthy secret ⇒ enabled. */ |
| 127 | function fallbackFlags(): FeatureFlagsConfig { |
| 128 | const flags: FeatureFlagsConfig = {} |
| 129 | for (const [name, def] of Object.entries(FEATURE_FLAGS) as Array< |
| 130 | [string, FeatureFlagDefinition] |
| 131 | >) { |
| 132 | flags[name] = { enabled: isTruthy(env[def.fallback]) } |
| 133 | } |
| 134 | return flags |
| 135 | } |
| 136 | |
| 137 | function normalizeIds(values: unknown): string[] | undefined { |
| 138 | if (!Array.isArray(values)) return undefined |
no test coverage detected