Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit e365f13

Browse files
committed
build: update to TypeScript 4.2
1 parent f761081 commit e365f13

File tree

3 files changed

+202
-162
lines changed

3 files changed

+202
-162
lines changed

modules/common/src/transfer_http.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ import { filter, take, tap } from 'rxjs/operators';
2727

2828
export interface TransferHttpResponse {
2929
body?: any | null;
30-
headers?: {[k: string]: string[]};
30+
headers?: Record<string, string[]>;
3131
status?: number;
3232
statusText?: string;
3333
url?: string;
3434
}
3535

36-
function getHeadersMap(headers: HttpHeaders) {
37-
const headersMap: Record<string, string[] | null> = {};
36+
function getHeadersMap(headers: HttpHeaders): Record<string, string[]> {
37+
const headersMap: Record<string, string[]> = {};
3838
for (const key of headers.keys()) {
39-
headersMap[key] = headers.getAll(key);
39+
const values = headers.getAll(key);
40+
if (values !== null) {
41+
headersMap[key] = values;
42+
}
4043
}
4144

4245
return headersMap;
@@ -88,7 +91,7 @@ export class TransferHttpCacheInterceptor implements HttpInterceptor {
8891

8992
if (this.transferState.hasKey(storeKey)) {
9093
// Request found in cache. Respond using it.
91-
const response = this.transferState.get(storeKey, {} as TransferHttpResponse);
94+
const response = this.transferState.get<TransferHttpResponse>(storeKey, {});
9295

9396
return observableOf(new HttpResponse<any>({
9497
body: response.body,
@@ -105,7 +108,7 @@ export class TransferHttpCacheInterceptor implements HttpInterceptor {
105108
.pipe(
106109
tap((event: HttpEvent<unknown>) => {
107110
if (event instanceof HttpResponse) {
108-
this.transferState.set(storeKey, {
111+
this.transferState.set<TransferHttpResponse>(storeKey, {
109112
body: event.body,
110113
headers: getHeadersMap(event.headers),
111114
status: event.status,

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,31 @@
4242
"@types/node": "12.12.37"
4343
},
4444
"devDependencies": {
45-
"@angular-devkit/architect": "^0.1200.0-next.4",
46-
"@angular-devkit/build-angular": "^0.1200.0-next.4",
47-
"@angular-devkit/core": "^12.0.0-next.4",
48-
"@angular-devkit/schematics": "^12.0.0-next.4",
49-
"@angular/animations": "^12.0.0-next.4",
50-
"@angular/bazel": "^12.0.0-next.4",
51-
"@angular/cli": "^12.0.0-next.4",
52-
"@angular/common": "^12.0.0-next.4",
53-
"@angular/compiler": "^12.0.0-next.4",
54-
"@angular/compiler-cli": "^12.0.0-next.4",
55-
"@angular/core": "^12.0.0-next.4",
45+
"@angular-devkit/architect": "^0.1200.0-next.5",
46+
"@angular-devkit/build-angular": "^0.1200.0-next.5",
47+
"@angular-devkit/core": "^12.0.0-next.5",
48+
"@angular-devkit/schematics": "^12.0.0-next.5",
49+
"@angular/animations": "^12.0.0-next.5",
50+
"@angular/bazel": "^12.0.0-next.5",
51+
"@angular/cli": "^12.0.0-next.5",
52+
"@angular/common": "^12.0.0-next.5",
53+
"@angular/compiler": "^12.0.0-next.5",
54+
"@angular/compiler-cli": "^12.0.0-next.5",
55+
"@angular/core": "^12.0.0-next.5",
5656
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#1d0dab59344f11d6e6e54c675cde245aae52dbf5",
57-
"@angular/platform-browser": "^12.0.0-next.4",
58-
"@angular/platform-browser-dynamic": "^12.0.0-next.4",
59-
"@angular/platform-server": "^12.0.0-next.4",
60-
"@angular/router": "^12.0.0-next.4",
61-
"@angular/service-worker": "^12.0.0-next.4",
57+
"@angular/platform-browser": "^12.0.0-next.5",
58+
"@angular/platform-browser-dynamic": "^12.0.0-next.5",
59+
"@angular/platform-server": "^12.0.0-next.5",
60+
"@angular/router": "^12.0.0-next.5",
61+
"@angular/service-worker": "^12.0.0-next.5",
6262
"@bazel/bazelisk": "1.7.3",
6363
"@bazel/buildifier": "3.5.0",
6464
"@bazel/hide-bazel-files": "1.7.0",
6565
"@bazel/ibazel": "0.14.0",
6666
"@bazel/jasmine": "2.3.2",
6767
"@bazel/typescript": "2.3.2",
6868
"@hapi/hapi": "^18.4.0",
69-
"@schematics/angular": "^12.0.0-next.4",
69+
"@schematics/angular": "^12.0.0-next.5",
7070
"@types/browser-sync": "^2.26.1",
7171
"@types/express": "~4.17.6",
7272
"@types/fs-extra": "^9.0.0",
@@ -101,7 +101,7 @@
101101
"tslib": "~2.1.0",
102102
"tslint": "^6.0.0",
103103
"tsutils": "^3.0.0",
104-
"typescript": "~4.1.2",
104+
"typescript": "~4.2.3",
105105
"xhr2": "^0.2.0",
106106
"zone.js": "^0.11.0"
107107
}

0 commit comments

Comments
 (0)