Files
react-native/packages/react-native/Libraries/StyleSheet/processFontVariant.js
T
Jakub Piasecki 4f20362b07 Migrate files in Libraries/StyleSheet to use export syntax (#49303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49303

Changelog: [General][Breaking] Deep imports to modules inside `Libraries/StyleSheet` using `require` may need to be appended with `.default`

Reviewed By: huntie

Differential Revision: D69400980

fbshipit-source-id: 053f40a8677ac877b93c27e87422ea0ef540c272
2025-02-13 03:45:13 -08:00

31 lines
687 B
JavaScript

/**
* 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.
*
* @format
* @flow strict-local
*/
'use strict';
import type {____FontVariantArray_Internal} from './StyleSheetTypes';
function processFontVariant(
fontVariant: ____FontVariantArray_Internal | string,
): ?____FontVariantArray_Internal {
if (Array.isArray(fontVariant)) {
return fontVariant;
}
// $FlowFixMe[incompatible-type]
const match: ?____FontVariantArray_Internal = fontVariant
.split(' ')
.filter(Boolean);
return match;
}
export default processFontVariant;