MCPcopy Create free account
hub / github.com/xerrors/Yuxi / parseRunSeq

Function parseRunSeq

web/src/utils/runStreamResume.js:9–23  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

7}
8
9const parseRunSeq = (value) => {
10 const text = normalizeRunSeq(value)
11 if (!text.includes('-')) {
12 return { major: 0n, minor: 0n }
13 }
14 const [majorRaw, minorRaw] = text.split('-', 2)
15
16 try {
17 const major = BigInt(majorRaw || '0')
18 const minor = BigInt(minorRaw || '0')
19 return { major, minor }
20 } catch {
21 return { major: 0n, minor: 0n }
22 }
23}
24
25export const compareRunSeq = (incoming, current) => {
26 const left = parseRunSeq(incoming)

Callers 1

compareRunSeqFunction · 0.85

Calls 1

normalizeRunSeqFunction · 0.85

Tested by

no test coverage detected