MCPcopy Index your code
hub / github.com/microsoft/playwright-python / latest_lts_version

Function latest_lts_version

scripts/update_node_version.py:34–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33
34def latest_lts_version() -> str:
35 with urllib.request.urlopen(NODE_INDEX_URL) as response: # noqa: S310
36 releases = json.load(response)
37 # The index is ordered newest-first; each release's "lts" field is false for
38 # non-LTS lines and the LTS codename otherwise. The first truthy one is the
39 # latest LTS release, e.g. {"version": "v24.16.0", "lts": "Krypton"}.
40 for release in releases:
41 if release.get("lts"):
42 return str(release["version"]).lstrip("v")
43 raise SystemExit("No LTS release found in the Node.js release index")
44
45
46def main() -> None:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected