Skip to content

Commit 3e169aa

Browse files
replace .at with length - 1 to resolve typescript target error
1 parent 64577e8 commit 3e169aa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/libraries/Downloader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ function extractBinary(url: string, archiveLocation: string, extractedLocation:
130130

131131
await fsPromises.mkdir(extractedLocation, {recursive: true})
132132

133-
const mySQLFolderName = url.split('/').at(-1)
133+
const splitURL = url.split('/')
134+
const mySQLFolderName = splitURL[splitURL.length - 1]
134135
if (!mySQLFolderName) {
135136
return reject(`Folder name is undefined for url: ${url}`)
136137
}

src/libraries/Version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function getBinaryURL(versionToGet: string = "x", currentArch: st
88
let selectedVersions = DOWNLOADABLE_MYSQL_VERSIONS.filter(version => satisfies(version, versionToGet));
99

1010
if (selectedVersions.length === 0) {
11-
throw `mysql-memory-server does not support downloading a version of MySQL that fits the following version requirement: ${versionToGet}. This package only supports downloads of MySQL for MySQL >= ${DOWNLOADABLE_MYSQL_VERSIONS[0]} <= ${DOWNLOADABLE_MYSQL_VERSIONS.at(-1)}. Please check for typos, choose a different version of MySQL to use, or make an issue or pull request on GitHub if you belive this is a bug.`
11+
throw `mysql-memory-server does not support downloading a version of MySQL that fits the following version requirement: ${versionToGet}. This package only supports downloads of MySQL for MySQL >= ${DOWNLOADABLE_MYSQL_VERSIONS[0]} <= ${DOWNLOADABLE_MYSQL_VERSIONS[DOWNLOADABLE_MYSQL_VERSIONS.length - 1]}. Please check for typos, choose a different version of MySQL to use, or make an issue or pull request on GitHub if you belive this is a bug.`
1212
}
1313

1414
const currentOS = os.platform();

0 commit comments

Comments
 (0)