/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/scripts/featureflags/templates/common-cxx/ReactNativeFeatureFlagsProvider.h-template.js
48 строк
1 KB
Rubén Norte
Use Flow in feature flags scripts (#42814)
05 фев 2024, 22:02
05 фев 2024, 22:02
dbbec34
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict * @format */ import type {FeatureFlagDefinitions} from '../../types'; import {DO_NOT_MODIFY_COMMENT, getCxxTypeFromDefaultValue} from '../../utils'; import signedsource from 'signedsource'; export default function (definitions: FeatureFlagDefinitions): string { return signedsource.signFile(`/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * ${signedsource.getSigningToken()} */ ${DO_NOT_MODIFY_COMMENT} #pragma once namespace facebook::react { class ReactNativeFeatureFlagsProvider { public: virtual ~ReactNativeFeatureFlagsProvider() = default; ${Object.entries(definitions.common) .map( ([flagName, flagConfig]) => ` virtual ${getCxxTypeFromDefaultValue( flagConfig.defaultValue, )} ${flagName}() = 0;`, ) .join('\n')} }; } // namespace facebook::react `); }