Skip to content

Commit

Permalink
Update PackageVersionFileController.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
i18nsite authored Oct 18, 2024
1 parent a650902 commit b911aba
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions app/port/controller/PackageVersionFileController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,28 +172,22 @@ export class PackageVersionFileController extends AbstractController {
}

Check failure on line 173 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Trailing spaces not allowed

Check failure on line 173 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Trailing spaces not allowed

Check failure on line 173 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Trailing spaces not allowed
@HTTPMethod({
path: `/npm/:fullname@:versionSpec/:path(.+)`,
path: `/npm/:fullname(${FULLNAME_REG_STRING})/:path(.+)`,
method: HTTPMethodEnum.GET,
})
async rawNpmVer(@Context() ctx: EggContext,
@HTTPParam() fullname: string,
@HTTPParam() versionSpec: string,
@HTTPParam() path: string,
@HTTPQuery() meta: string) {
return await this.raw(ctx, fullname, versionSpec, path, meta);
let ver = fullname.slice(1).split('@')[1];
if(ver){

Check failure on line 183 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Expected space(s) after "if"

Check failure on line 183 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Missing space before opening brace

Check failure on line 183 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Expected space(s) after "if"

Check failure on line 183 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Missing space before opening brace

Check failure on line 183 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Expected space(s) after "if"

Check failure on line 183 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Missing space before opening brace
fullname = fullname.slice(0,-1-ver.length)

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

A space is required after ','

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Operator '-' must be spaced

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Missing semicolon

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

A space is required after ','

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Operator '-' must be spaced

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Missing semicolon

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

A space is required after ','

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Operator '-' must be spaced

Check failure on line 184 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Missing semicolon
}else{

Check failure on line 185 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Expected space(s) before "else"

Check failure on line 185 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Expected space(s) after "else"

Check failure on line 185 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Expected space(s) before "else"

Check failure on line 185 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Expected space(s) after "else"

Check failure on line 185 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Expected space(s) before "else"

Check failure on line 185 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Expected space(s) after "else"
ver = 'latest'

Check failure on line 186 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (18, ubuntu-latest)

Missing semicolon

Check failure on line 186 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (20, ubuntu-latest)

Missing semicolon

Check failure on line 186 in app/port/controller/PackageVersionFileController.ts

View workflow job for this annotation

GitHub Actions / test-mysql57-fs-nfs (22, ubuntu-latest)

Missing semicolon
}
return await this.raw(ctx, fullname, ver, path, meta);
}

@HTTPMethod({
path: `/npm/:fullname/:path(.+)`,
method: HTTPMethodEnum.GET,
})
async rawNpm(@Context() ctx: EggContext,
@HTTPParam() fullname: string,
@HTTPParam() path: string,
@HTTPQuery() meta: string) {
return await this.raw(ctx, fullname, "latest", path, meta);
}

/**
* compatibility with unpkg
* 1. try to match alias entry. e.g. accessing `index.js` or `index.json` using /index
Expand Down

0 comments on commit b911aba

Please sign in to comment.