chore: remove deprecated usage of String.prototype.substr (#4699)

This commit is contained in:
Che Guevara
2021-10-09 00:31:34 +08:00
committed by GitHub
parent c9613ebe09
commit 6bcb7a5ea3
7 changed files with 17 additions and 18 deletions

View File

@@ -60,7 +60,7 @@ async function fetchVersions(): Promise<string[]> {
)
const releases: any[] = await res.json()
const versions = releases.map(r =>
/^v/.test(r.tag_name) ? r.tag_name.substr(1) : r.tag_name
/^v/.test(r.tag_name) ? r.tag_name.slice(1) : r.tag_name
)
// if the latest version is a pre-release, list all current pre-releases
// otherwise filter out pre-releases