react-native-code-push-diff
Version:
This library builds upon the foundational strengths of the react-native-code-push library, adding advanced functionality to precisely identify and manage differences between code-push builds.
23 lines (17 loc) • 563 B
text/typescript
import { NativeModules, Platform } from 'react-native'
/**
* These parameters are set during codepush build.
*/
export interface CodepushInfo {
mainBundlePath?: string
}
const CodepushInfoModule: CodepushInfo | null = NativeModules.CodePushDiff
if (process.env.NODE_ENV !== 'test' && Platform.OS === 'ios' && !CodepushInfoModule) {
throw new Error('You seem to have forgotten to link the native part!')
}
const mainBundlePath = CodepushInfoModule?.mainBundlePath
export function setupCodepushInfo(): CodepushInfo {
return {
mainBundlePath,
}
}