()
| 5 | * Collect enabled feature flags from defaults + env vars. |
| 6 | */ |
| 7 | export function getEnabledFeatures(): Set<string> { |
| 8 | const envFeatures = Object.keys(process.env) |
| 9 | .filter(k => k.startsWith('FEATURE_')) |
| 10 | .map(k => k.replace('FEATURE_', '')) |
| 11 | return new Set([...DEFAULT_BUILD_FEATURES, ...envFeatures]) |
| 12 | } |
| 13 | |
| 14 | // Regex to match feature('FLAG_NAME') calls with string literal arguments |
| 15 | const FEATURE_CALL_RE = /feature\s*\(\s*['"]([\w]+)['"]\s*\)/g |
no test coverage detected