Files
buzz/desktop/src/shared/features/resolveEnabled.ts
Taylor Ho ae430d4dd9 feat: preview features (experiments settings UI) (#888)
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
2026-06-09 09:53:09 -07:00

18 lines
620 B
TypeScript

/**
* Pure resolution logic for preview-feature visibility.
* No side effects, no imports — safe to test in isolation.
*
* The manifest (`preview-features.json`) lists only preview features.
* Anything not in the manifest is stable and resolves true elsewhere
* (see `useFeatureEnabled`). Once you're inside `resolveEnabled`, the
* feature IS in the manifest — preview by definition.
*
* Returns true only if the user has explicitly opted in via overrides.
*/
export function resolveEnabled(
featureId: string,
overrides: Record<string, boolean>,
): boolean {
return overrides[featureId] === true;
}