mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(dev-infra): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types. PR Close #40710
This commit is contained in:
committed by
Alex Rickabaugh
parent
2c90391d4b
commit
cbdb5e208e
@@ -86,7 +86,9 @@ export class ChromeDriverExtension extends WebDriverExtension {
|
||||
.then((entries) => {
|
||||
const events: PerfLogEvent[] = [];
|
||||
entries.forEach((entry: any) => {
|
||||
const message = (JSON.parse(entry['message']) as {message: any})['message'];
|
||||
const message =
|
||||
(JSON.parse(entry['message']) as
|
||||
{message: {method: string, params: PerfLogEvent}})['message'];
|
||||
if (message['method'] === 'Tracing.dataCollected') {
|
||||
events.push(message['params']);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,9 @@ export class IOsDriverExtension extends WebDriverExtension {
|
||||
.then((entries) => {
|
||||
const records: any[] = [];
|
||||
entries.forEach((entry: any) => {
|
||||
const message = (JSON.parse(entry['message']) as {message: any})['message'];
|
||||
const message =
|
||||
(JSON.parse(entry['message']) as
|
||||
{message: {method: string, params: PerfLogEvent}})['message'];
|
||||
if (message['method'] === 'Timeline.eventRecorded') {
|
||||
records.push(message['params']['record']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user