/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/react-native-test-library/common/index.js
34 строки
814 B
Christian Falch
feat(iOS) swiftpm support in iOS (#57332)
15 июл 2026, 15:08
15 июл 2026, 15:08
47fad09
Код
Авторство
О чём код?
/** * 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-local * @format */ 'use strict'; import {NativeModules, Platform} from 'react-native'; export type Greeting = Readonly<{ name: string, language: string, }>; export function formatGreeting(g: Greeting): string { return `[${g.language}] Hello, ${g.name}!`; } export function getVersion(): Promise<string> { const TestLibraryCommon = NativeModules.TestLibraryCommon; if (TestLibraryCommon == null) { return Promise.reject( new Error( `react-native-test-library-common: native module unavailable on ${Platform.OS}.`, ), ); } return TestLibraryCommon.version(); }