Skip to content

Commit d74f0ee

Browse files
committed
Bump TypeScript version to 2.4.2
* This is due to a bug about spread operator usage fixed on TypeScript 2.4.0 (microsoft/TypeScript#5296) * With this change now a warning will be given about the TS version used. This is expected, you see the discussion about it on angular/angular-cli#7625
1 parent b23ba07 commit d74f0ee

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@
5959
"protractor": "~5.1.2",
6060
"ts-node": "~3.2.0",
6161
"tslint": "~5.3.2",
62-
"typescript": "2.3.4"
62+
"typescript": "2.4.2"
6363
}
6464
}

src/app/shared/metric.model.ts

+16-7
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ export class Metric {
1616
* parameters and/or using interfaces.
1717
*
1818
* For the sake of brevity and simplicity of this model we are gonna
19-
* assume only one single constructor right now (being a single string array
20-
* with all data), and depending on the mileage we might take another route.
19+
* assume only one single constructor right now
20+
* (̶b̶e̶i̶n̶g̶ ̶a̶ ̶s̶i̶n̶g̶l̶e̶ ̶s̶t̶r̶i̶n̶g̶ ̶a̶r̶r̶a̶y̶ ̶w̶i̶t̶h̶ ̶a̶l̶l̶ ̶d̶a̶t̶a̶)̶,
21+
* (being the four parameters of the model),
22+
* and depending on the mileage we might take another route.
2123
*/
22-
constructor(metricData: Array<string>) {
23-
this.microservice = metricData[0];
24-
this.date = new Date(+metricData[1]);
25-
this.metric = metricData[2];
26-
this.value = +metricData[3];
24+
// constructor(metricData: Array<string>) {
25+
// this.microservice = metricData[0];
26+
// this.date = new Date(+metricData[1]);
27+
// this.metric = metricData[2];
28+
// this.value = +metricData[3];
29+
// }
30+
31+
constructor(microservice?: string, date?: string, metric?: string, value?: string) {
32+
this.microservice = microservice;
33+
this.date = new Date(+date);
34+
this.metric = metric;
35+
this.value = +value;
2736
}
2837

2938
}

src/app/ws-viewer/ws-viewer.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class WsViewerComponent implements OnInit {
2525
// this.subscription = this.wsService.getSubject('handshake')
2626
this.subscription = this.wsService.getSubject()
2727
.subscribe(
28-
async (msg) => this.metric = new Metric((await msg).split(' '))
28+
async (msg) => this.metric = new Metric(...(await msg).split(' '))
2929
);
3030
}
3131

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -5274,9 +5274,9 @@ type-is@~1.6.15:
52745274
media-typer "0.3.0"
52755275
mime-types "~2.1.15"
52765276

5277-
typescript@2.3.4:
5278-
version "2.3.4"
5279-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
5277+
typescript@2.4.2:
5278+
version "2.4.2"
5279+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844"
52805280

52815281
"typescript@>=2.0.0 <2.6.0", typescript@^2.3.3:
52825282
version "2.5.2"

0 commit comments

Comments
 (0)