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

Function computeProgress

src/utils.ts:111–114  ·  view source on GitHub ↗
(received: number, total: number)

Source from the content-addressed store, hash-verified

109};
110
111export const computeProgress = (received: number, total: number): number =>
112 total > 0
113 ? Math.min(100, Math.max(0, Math.floor((received / total) * 100)))
114 : 0;
115
116export const fetchWithTimeout = (
117 url: string,

Callers 2

wrapProgressMethod · 0.90
utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected