Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectError
(Constants.installationId: 'ups...');
// $ExpectError
(Constants.isDevice: 'ups...');
// $ExpectError
(Constants.isHeadless: 'ups...');
// $ExpectError
(Constants.linkingUri: 'ups...');
// $ExpectError
(Constants.sessionId: 'ups...');
// $ExpectError
(Constants.statusBarHeight: 'ups...');
// $ExpectError
(Constants.systemVersion: 'ups...');
// $ExpectError
(Constants.systemFonts: 'ups...');
});
});
public render() {
return (
{/* Cast to a string array (Constants.systemFonts as Array)... if using the native types provided by expo insted of @types/expo. See tsconfig.json. */}
{Constants.systemFonts.map((systemFont, index) => (
))}
);
}
}
export function processFontFamily(name) {
if (typeof name !== 'string' || Constants.systemFonts.includes(name) || name === 'System') {
return name;
}
if (name.includes(Constants.sessionId)) {
return name;
}
if (!isLoaded(name)) {
if (__DEV__) {
if (isLoading(name)) {
console.error(`You started loading the font "${name}", but used it before it finished loading.\n
- You need to wait for Font.loadAsync to complete before using the font.\n
- We recommend loading all fonts before rendering the app, and rendering only Expo.AppLoading while waiting for loading to complete.`);
}
else {
console.error(`fontFamily "${name}" is not a system font and has not been loaded through Font.loadAsync.\n
- If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.\n
- If this is a custom font, be sure to load it with Font.loadAsync.`);
export function processFontFamily(name: string | null): string | null {
if (typeof name !== 'string' || Constants.systemFonts.includes(name) || name === 'System') {
return name;
}
if (name.includes(Constants.sessionId)) {
return name;
}
if (!isLoaded(name)) {
if (__DEV__) {
if (isLoading(name)) {
console.error(
`You started loading the font "${name}", but used it before it finished loading.\n
- You need to wait for Font.loadAsync to complete before using the font.\n
- We recommend loading all fonts before rendering the app, and rendering only Expo.AppLoading while waiting for loading to complete.`
);
} else {
export function fontFamilyNeedsScoping(name: string): boolean {
return (
(isInClient || isInIOSStandalone) &&
!Constants.systemFonts.includes(name) &&
name !== 'System' &&
!name.includes(Constants.sessionId)
);
}
export function fontFamilyNeedsScoping(name) {
return ((isInClient || isInIOSStandalone) &&
!Constants.systemFonts.includes(name) &&
name !== 'System' &&
!name.includes(Constants.sessionId));
}
export function getAssetForSource(source) {