MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / warn_on_version_mismatch

Function warn_on_version_mismatch

extension/src/real_world.ts:144–171  ·  view source on GitHub ↗
(
    actual_str:   string | null,
    expected_str: string | null,
    title:        string,
)

Source from the content-addressed store, hash-verified

142}
143
144function warn_on_version_mismatch(
145 actual_str: string | null,
146 expected_str: string | null,
147 title: string,
148) {
149 if (!actual_str) {
150 return place_warn(Place_Name.Detector_Real_World, `No actual ${title} version found!`)
151 }
152 if (!expected_str) {
153 return place_warn(Place_Name.Detector_Real_World, `No expected ${title} version found!`)
154 }
155
156 // warn if the matching adapter version is not the same minor version range as the actual adapter
157 let [actual, actual_ok] = version_from_string(actual_str)
158 let [expected, expected_ok] = version_from_string(expected_str)
159
160 if (!actual_ok) {
161 place_warn(Place_Name.Detector_Real_World, `Actual version ${title}@${actual_str} cannot be parsed.`)
162 }
163 if (!expected_ok) {
164 place_warn(Place_Name.Detector_Real_World, `Expected version ${title}@${expected_str} cannot be parsed.`)
165 }
166 if (!match_version_patch(actual, expected)) {
167 place_warn(Place_Name.Detector_Real_World, `VERSION MISMATCH!
168Current version: ${title}@${actual_str}
169Expected version: ${title}@${expected_str}`)
170 }
171}
172
173
174main()

Callers 1

attach_debuggerFunction · 0.85

Calls 3

place_warnFunction · 0.90
version_from_stringFunction · 0.85
match_version_patchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…