mirror of
https://github.com/block/buzz.git
synced 2026-10-30 14:01:37 +00:00
Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
18 lines
620 B
TypeScript
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;
|
|
}
|