Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {
// React Native's internal InitializeCore module sets up `window` but runs only when its React
// renderer is loaded. We can cause this by loading one of its dependents.
findNodeHandle, } from 'react-native';
import Constants from 'expo-constants'; // eslint-disable-line no-unused-expressions
import { shouldThrowAnErrorOutsideOfExpo } from './validatorState';
findNodeHandle; // eslint-disable-line no-unused-expressions
if (shouldThrowAnErrorOutsideOfExpo() && (!Constants || !Constants.expoVersion)) {
throw new Error(`The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.`);
}
//# sourceMappingURL=validate.fx.js.map
import {
// React Native's internal InitializeCore module sets up `window` but runs only when its React
// renderer is loaded. We can cause this by loading one of its dependents.
findNodeHandle,
} from 'react-native';
import Constants from 'expo-constants'; // eslint-disable-line no-unused-expressions
import { shouldThrowAnErrorOutsideOfExpo } from './validatorState';
findNodeHandle; // eslint-disable-line no-unused-expressions
if (shouldThrowAnErrorOutsideOfExpo() && (!Constants || !Constants.expoVersion)) {
throw new Error(
`The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.`
);
}
it('should passes when used properly', () => {
(Constants.debugMode: boolean);
(Constants.deviceName: ?string);
(Constants.deviceYearClass: number | null);
(Constants.experienceUrl: string);
(Constants.expoRuntimeVersion: string);
(Constants.expoVersion: string);
(Constants.isDetached: ?boolean);
(Constants.intentUri: ?string);
(Constants.installationId: string);
(Constants.isDevice: boolean);
(Constants.isHeadless: boolean);
(Constants.linkingUri: string);
(Constants.sessionId: string);
(Constants.statusBarHeight: number);
(Constants.systemVersion: ?number);
(Constants.systemFonts: Array);
});
if (process.env.RNVC_ENV === 'test') {
RNVersionCheck = {
country: 'ko',
packageName: 'com.reactnative.versioncheck',
currentBuildNumber: 1,
currentVersion: '0.0.1',
};
} else {
const { manifest = {} } = Constants;
const {
version = null,
android: { versionCode = null, package: androidPackageName = null } = {},
ios: { bundleIdentifier = null, buildNumber = null } = {},
} = manifest;
let country;
if (Constants.expoVersion < 31) {
country = Localization.getCurrentDeviceCountryAsync();
} else {
country = Localization.country;
}
RNVersionCheck = {
currentVersion: version,
country,
currentBuildNumber: Platform.select({
android: versionCode,
ios: buildNumber,
}),
packageName: Platform.select({
android: androidPackageName,
ios: bundleIdentifier,
}),
_renderConstants = () => {
return (
);
};
public render() {
const navigate = this.props.navigation.navigate;
return (
);
_copyClientVersionToClipboard = () => {
Clipboard.setString(Constants.expoVersion);
alert('The client version has been copied to your clipboard');
};
_renderConstants = () => {
return (
);
};
export default function NavBarCustom() {
if (Platform.OS === 'web') {
return null
}
return (
💬 Gifted Chat{'\n'}
)
}
_copyClientVersionToClipboard = () => {
Clipboard.setString(Constants.expoVersion);
alert('The client version has been copied to your clipboard');
};