Skip to content

Commit c35f1c2

Browse files
committed
ugprade to angular 14
1 parent cc5494a commit c35f1c2

File tree

8 files changed

+2557
-2508
lines changed

8 files changed

+2557
-2508
lines changed

angular.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@
422422
}
423423
}
424424
},
425-
"defaultProject": "ngx-cookie",
426425
"cli": {
427-
"defaultCollection": "@angular-eslint/schematics"
426+
"schematicCollections": [
427+
"@angular-eslint/schematics"
428+
]
428429
}
429430
}

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,41 @@
4545
"url": "https://github.com/salemdar/ngx-cookie/issues"
4646
},
4747
"dependencies": {
48-
"@angular/animations": "~13.3.3",
49-
"@angular/common": "~13.3.3",
50-
"@angular/compiler": "~13.3.3",
51-
"@angular/core": "~13.3.3",
52-
"@angular/forms": "~13.3.3",
53-
"@angular/platform-browser": "~13.3.3",
54-
"@angular/platform-browser-dynamic": "~13.3.3",
55-
"@angular/platform-server": "~13.3.3",
56-
"@angular/router": "~13.3.3",
57-
"@nguniversal/express-engine": "^13.1.0",
48+
"@angular/animations": "^14.0.3",
49+
"@angular/common": "^14.0.3",
50+
"@angular/compiler": "^14.0.3",
51+
"@angular/core": "^14.0.3",
52+
"@angular/forms": "^14.0.3",
53+
"@angular/platform-browser": "^14.0.3",
54+
"@angular/platform-browser-dynamic": "^14.0.3",
55+
"@angular/platform-server": "^14.0.3",
56+
"@angular/router": "^14.0.3",
57+
"@nguniversal/express-engine": "^14.0.2",
5858
"express": "^4.15.2",
5959
"rxjs": "~7.5.5",
6060
"tslib": "^2.0.0",
6161
"zone.js": "~0.11.4"
6262
},
6363
"devDependencies": {
64-
"@angular-devkit/build-angular": "~13.3.3",
65-
"@angular-eslint/builder": "13.2.1",
66-
"@angular-eslint/eslint-plugin": "13.2.1",
67-
"@angular-eslint/eslint-plugin-template": "13.2.1",
68-
"@angular-eslint/schematics": "13.2.1",
69-
"@angular-eslint/template-parser": "13.2.1",
70-
"@angular/cli": "~13.3.3",
71-
"@angular/compiler-cli": "~13.3.3",
72-
"@angular/language-service": "~13.3.3",
64+
"@angular-devkit/build-angular": "^14.0.3",
65+
"@angular-eslint/builder": "14.0.0",
66+
"@angular-eslint/eslint-plugin": "14.0.0",
67+
"@angular-eslint/eslint-plugin-template": "14.0.0",
68+
"@angular-eslint/schematics": "14.0.0",
69+
"@angular-eslint/template-parser": "14.0.0",
70+
"@angular/cli": "^14.0.3",
71+
"@angular/compiler-cli": "^14.0.3",
72+
"@angular/language-service": "^14.0.3",
7373
"@cypress/schematic": "1.6.0",
74-
"@nguniversal/builders": "^13.1.0",
74+
"@nguniversal/builders": "^14.0.2",
7575
"@types/express": "^4.17.8",
7676
"@types/jasmine": "~4.0.3",
7777
"@types/jasminewd2": "~2.0.3",
7878
"@types/node": "^17.0.25",
79-
"@typescript-eslint/eslint-plugin": "5.20.0",
80-
"@typescript-eslint/parser": "5.20.0",
79+
"@typescript-eslint/eslint-plugin": "^5.29.0",
80+
"@typescript-eslint/parser": "^5.29.0",
8181
"cypress": "^9.5.4",
82-
"eslint": "^8.12.0",
82+
"eslint": "^8.18.0",
8383
"eslint-plugin-import": "^2.26.0",
8484
"eslint-plugin-jsdoc": "39.2.3",
8585
"eslint-plugin-prefer-arrow": "^1.2.3",
@@ -89,7 +89,7 @@
8989
"karma-coverage": "^2.2.0",
9090
"karma-jasmine": "~5.0.0",
9191
"karma-jasmine-html-reporter": "^1.5.0",
92-
"ng-packagr": "^13.3.1",
92+
"ng-packagr": "^14.0.2",
9393
"ts-node": "~10.7.0",
9494
"typescript": "~4.6.3"
9595
}

projects/ngx-cookie-backend/src/lib/cookie-backend-writer.service.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ describe('CookieBackendWriterService', () => {
5353
const cookie = 'myKey1=myValue1; myKey2=myValue2';
5454
request.headers.cookie = cookie;
5555
const allAsString = service.readAllAsString();
56-
const parsed = parseCookieString(allAsString)
56+
const parsed = parseCookieString(allAsString);
5757
const expected = {
58-
'myKey1': 'myValue1',
59-
'myKey2': 'myValue2'
58+
myKey1: 'myValue1',
59+
myKey2: 'myValue2'
6060
};
6161
expect(parsed).toEqual(expected);
6262
});

projects/ngx-cookie-backend/src/lib/cookie-backend-writer.service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Inject, Injectable, Optional } from '@angular/core';
22
import { REQUEST, RESPONSE } from '@nguniversal/express-engine/tokens';
33
import { CookieOptions as ExpressCookieOptions, Request, Response } from 'express';
4-
import { CookieOptions, ICookieWriterService, isEmpty, isNil, isString } from 'ngx-cookie';
4+
import { CookieOptions, ICookieWriterService, isEmpty, isString } from 'ngx-cookie';
55

66
const COOKIE_SEPARATOR = ';';
77

@@ -12,16 +12,14 @@ export class CookieBackendWriterService implements ICookieWriterService {
1212

1313
readAllAsString(): string {
1414
const requestHeadersCookies = this.request?.headers?.cookie;
15-
const cookiesFromRequest: string[] = requestHeadersCookies ? requestHeadersCookies.split(COOKIE_SEPARATOR) : [];
15+
const cookiesFromRequest: string[] = requestHeadersCookies?.split(COOKIE_SEPARATOR) ?? [];
1616
const addedCookies: string[] = this.getNormalizedResponseCookies();
1717
const allCookies = this.latestUniqueCookieValues(cookiesFromRequest, addedCookies);
1818
return allCookies.join(COOKIE_SEPARATOR);
1919
}
2020

2121
write(name: string, value: string | undefined, options?: CookieOptions): void {
22-
if (!isNil(this.response)) {
23-
this.response.cookie(name, value, this.getOptions(options));
24-
}
22+
this.response?.cookie(name, value, this.getOptions(options));
2523
}
2624

2725
private getOptions(options?: CookieOptions): ExpressCookieOptions {

projects/ngx-cookie-backend/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../../out-tsc/lib",
55
"declarationMap": true,
6-
"target": "es2015",
6+
"target": "es2020",
77
"declaration": true,
88
"inlineSources": true,
99
"types": [],

projects/ngx-cookie/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../../out-tsc/lib",
55
"declarationMap": true,
6-
"target": "es2015",
6+
"target": "es2020",
77
"declaration": true,
88
"inlineSources": true,
99
"types": [],

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"experimentalDecorators": true,
1515
"moduleResolution": "node",
1616
"importHelpers": true,
17-
"target": "es2015",
17+
"target": "es2020",
1818
"module": "es2020",
1919
"lib": [
2020
"es2018",

0 commit comments

Comments
 (0)