()
| 1 | const versionRegex = /^\/(stable|archive\/v\d+)/; |
| 2 | |
| 3 | async 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 | |
| 14 | class VersionSelector extends HTMLElement { |
| 15 | constructor() { |
no test coverage detected
searching dependent graphs…