1 import type { FeatureCode } from '@proton/features';
3 import { addApiMock } from './api';
5 export const defaultFeatureFlagValue = {
11 UpdateTime: 1616511553,
15 export const featureFlags: { [code: string]: any } = {};
17 export const getFeatureFlagsState = (features: [FeatureCode, boolean | object][], fetchedAt = Date.now()) => {
18 return Object.fromEntries(
19 features.map(([featureCode, value]) => {
24 ...defaultFeatureFlagValue,
37 export const getFeatureFlags = (features: [FeatureCode, boolean | object][]) => {
38 return Object.fromEntries(
39 features.map(([featureCode, value]) => {
43 ...defaultFeatureFlagValue,
52 export const registerFeatureFlagsApiMock = () => {
56 const { Code } = args.params;
57 const features: string[] = Code.split(',');
59 Features: features.map((code) =>
60 featureFlags[code] ? featureFlags[code] : { ...defaultFeatureFlagValue, Code: code }