MCPcopy
hub / github.com/mitmproxy/mitmproxy / fetchVersions

Function fetchVersions

docs/src/assets/version-selector.js:3–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1const versionRegex = /^\/(stable|archive\/v\d+)/;
2
3async function fetchVersions() {
4 const resp = await fetch("https://s3-us-west-2.amazonaws.com/docs.mitmproxy.org?delimiter=/&prefix=archive/")
5 .then(response => response.text());
6 const versions = resp
7 .match(/(?<=<Prefix>archive\/v)\d+(?=\/<\/Prefix>)/g)
8 .toSorted((a,b) => b - a)
9 .map(x => `v${x}`)
10 versions.unshift("dev", "stable");
11 return versions;
12}
13
14class VersionSelector extends HTMLElement {
15 constructor() {

Callers 1

connectedCallbackMethod · 0.85

Calls 3

textMethod · 0.45
mapMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…