From 95f0327553a599bf661fd3e34928895d37a89ab3 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Wed, 22 Aug 2018 16:02:45 -0700 Subject: [PATCH] core(tsc): don't use index signature in simulator.js --- lighthouse-core/gather/computed/load-simulator.js | 1 + lighthouse-core/lib/dependency-graph/simulator/simulator.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/gather/computed/load-simulator.js b/lighthouse-core/gather/computed/load-simulator.js index 36339e6feb71..46d53698ac51 100644 --- a/lighthouse-core/gather/computed/load-simulator.js +++ b/lighthouse-core/gather/computed/load-simulator.js @@ -23,6 +23,7 @@ class LoadSimulatorArtifact extends ComputedArtifact { const {throttlingMethod, throttling} = data.settings; const networkAnalysis = await artifacts.requestNetworkAnalysis(data.devtoolsLog); + /** @type {LH.Gatherer.Simulation.Options} */ const options = { additionalRttByOrigin: networkAnalysis.additionalRttByOrigin, serverResponseTimeByOrigin: networkAnalysis.serverResponseTimeByOrigin, diff --git a/lighthouse-core/lib/dependency-graph/simulator/simulator.js b/lighthouse-core/lib/dependency-graph/simulator/simulator.js index 8a4c5f4ba6ee..18ed0f2d7161 100644 --- a/lighthouse-core/lib/dependency-graph/simulator/simulator.js +++ b/lighthouse-core/lib/dependency-graph/simulator/simulator.js @@ -66,6 +66,7 @@ class Simulator { this._nodeTimings = new Map(); /** @type {Map} */ this._numberInProgressByType = new Map(); + /** @type {Record>} */ this._nodes = {}; this._dns = new DNSCache({rtt: this._rtt}); // @ts-ignore @@ -95,8 +96,8 @@ class Simulator { this._numberInProgressByType = new Map(); this._nodes = {}; - for (const key of Object.keys(NodeState)) { - this._nodes[NodeState[key]] = new Set(); + for (const state of Object.values(NodeState)) { + this._nodes[state] = new Set(); } }