Skip to main content

Function: remapFonts()

remapFonts(assets): object

Defined in: utils.ts:67

Remaps font assets from the Mapples asset configuration format to a format compatible with expo-font.

This function processes the assets object and extracts only font-type assets, converting them from the Mapples reference format to a simple key-value mapping that expo-font can use.

Parameters

assets

AnyObject

The assets configuration object containing font references

Returns

object

A new object containing only the font assets in expo-font compatible format

Example

const assets = {
'ref(font:123:MyFont.ttf)': require('./fonts/MyFont.ttf'),
'ref(image:456:logo.png)': require('./images/logo.png'),
};

const fonts = remapFonts(assets);
// Returns: { MyFont: require('./fonts/MyFont.ttf') }