@sentry/react-native
Version:
Official Sentry SDK for react-native
29 lines • 825 B
JavaScript
import { notWeb } from './environment';
import { RN_GLOBAL_OBJ } from './worldwide';
/**
*
*/
export function createReleaseFromGlobalReleaseConstants() {
const globalRelease = RN_GLOBAL_OBJ.SENTRY_RELEASE;
if (!globalRelease) {
return undefined;
}
const { name, version } = globalRelease;
if (!name || !version) {
return undefined;
}
return `${name}@${version}`;
}
/**
*
*/
export function getDefaultRelease() {
if (notWeb()) {
// Mobile platforms use native release from the Release integration.
return undefined;
}
// Web platforms (Expo Web) use the global release constants.
// Release set in the options is need for Session and Replay integrations.
return createReleaseFromGlobalReleaseConstants();
}
//# sourceMappingURL=release.js.map