MCPcopy Index your code
hub / github.com/reactnativecn/react-native-update / resolveCheckResult

Function resolveCheckResult

src/resolveCheckResult.ts:6–30  ·  view source on GitHub ↗
(rootInfo: CheckResult)

Source from the content-addressed store, hash-verified

4import { log } from './utils';
5
6export function resolveCheckResult(rootInfo: CheckResult): CheckResult {
7 const { expVersion, ...rootResult } = rootInfo;
8 const rollout = expVersion?.config?.rollout?.[packageVersion];
9 if (rootResult.update && expVersion && typeof rollout === 'number') {
10 if (isInRollout(rollout)) {
11 log(`${expVersion.name} in ${rollout}% rollout, continue`);
12 if (expVersion.hash === currentVersion) {
13 return { upToDate: true };
14 }
15 const info: CheckResult = {
16 update: true,
17 ...expVersion,
18 };
19 if (rootResult.paths) {
20 info.paths = rootResult.paths;
21 }
22 return info;
23 }
24 log(`${expVersion.name} not in ${rollout}% rollout, ignored`);
25 }
26 if (rootResult.update && rootResult.hash === currentVersion) {
27 return { upToDate: true };
28 }
29 return rootResult;
30}

Callers 2

UpdateProviderFunction · 0.90
provider.test.tsFile · 0.90

Calls 2

isInRolloutFunction · 0.90
logFunction · 0.90

Tested by

no test coverage detected