MCPcopy Create free account
hub / github.com/TanStack/devtools / parseSemver

Function parseSemver

examples/react/basic/src/package-json-panel.tsx:44–49  ·  view source on GitHub ↗
(v?: string)

Source from the content-addressed store, hash-verified

42 // Helpers
43 const stripRange = (v?: string) => (v ?? '').replace(/^[~^><=v\s]*/, '')
44 const parseSemver = (v?: string) => {
45 const s = stripRange(v)
46 const m = s.match(/^(\d+)\.(\d+)\.(\d+)/)
47 if (!m) return null
48 return { major: +m[1], minor: +m[2], patch: +m[3] }
49 }
50 const diffType = (
51 current?: string,
52 latest?: string,

Callers 1

diffTypeFunction · 0.70

Calls 1

stripRangeFunction · 0.70

Tested by

no test coverage detected