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:
parent
b71df94897
commit
12b60f6cb7
@ -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,7 +263,8 @@ export function parseAddress(urlAddress: any): any {
|
||||
* @return {Array} sorted Array
|
||||
*/
|
||||
export function semverSort(listVersions: string[]): string[] {
|
||||
return listVersions
|
||||
return (
|
||||
listVersions
|
||||
.filter(function(x): boolean {
|
||||
if (!semver.parse(x, true)) {
|
||||
Logger.logger.warn({ ver: x }, 'ignoring bad version @{ver}');
|
||||
@ -271,8 +272,11 @@ export function semverSort(listVersions: string[]): string[] {
|
||||
}
|
||||
return true;
|
||||
})
|
||||
// FIXME: it seems the @types/semver do not handle a legitimate method named 'compareLoose'
|
||||
// @ts-ignore
|
||||
.sort(semver.compareLoose)
|
||||
.map(String);
|
||||
.map(String)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
BIN
yarn.lock
BIN
yarn.lock
Binary file not shown.
Loading…
Reference in New Issue
Block a user