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

Function parseSemver

examples/preact/basic/src/package-json-panel.tsx:43–48  ·  view source on GitHub ↗
(v?: string)

Source from the content-addressed store, hash-verified

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

Callers 1

diffTypeFunction · 0.70

Calls 1

stripRangeFunction · 0.70

Tested by

no test coverage detected