1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

build: fix semver missing type on build with docker

it seems the @types/semver do not handle a legitimate method named 'compareLoose'
This commit is contained in:
Juan Picado @jotadeveloper 2019-07-16 18:27:58 +02:00
parent b71df94897
commit 12b60f6cb7
No known key found for this signature in database
GPG Key ID: 15AA875EF3768142
3 changed files with 15 additions and 10 deletions

@ -63,6 +63,7 @@
"@types/minimatch": "3.0.3",
"@types/node": "12.6.2",
"@types/request": "2.48.2",
"@types/semver": "6.0.1",
"@typescript-eslint/eslint-plugin": "1.12.0",
"@verdaccio/babel-preset": "0.2.1",
"@verdaccio/eslint-config": "0.0.1",

@ -263,16 +263,20 @@ export function parseAddress(urlAddress: any): any {
* @return {Array} sorted Array
*/
export function semverSort(listVersions: string[]): string[] {
return listVersions
.filter(function(x): boolean {
if (!semver.parse(x, true)) {
Logger.logger.warn({ ver: x }, 'ignoring bad version @{ver}');
return false;
}
return true;
})
.sort(semver.compareLoose)
.map(String);
return (
listVersions
.filter(function(x): boolean {
if (!semver.parse(x, true)) {
Logger.logger.warn({ ver: x }, 'ignoring bad version @{ver}');
return false;
}
return true;
})
// FIXME: it seems the @types/semver do not handle a legitimate method named 'compareLoose'
// @ts-ignore
.sort(semver.compareLoose)
.map(String)
);
}
/**

BIN
yarn.lock

Binary file not shown.