File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -376,11 +376,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
376
376
< script src ="shared.js "> </ script >
377
377
< script >
378
378
function findQueryParam ( name ) {
379
- if ( ! window . location . search ) {
380
- return null ;
381
- }
382
- let urlParams = window . location . search . substring ( 1 ) . split ( "&" ) . map ( x => x . split ( "=" ) ) ;
383
- let pair = urlParams . find ( x => x [ 0 ] === name )
379
+ let urlParams = window . location . search ?. substring ( 1 ) . split ( "&" ) . map ( x => x . split ( "=" ) ) ;
380
+ let pair = urlParams ?. find ( x => x [ 0 ] === name )
384
381
if ( pair ) {
385
382
return unescape ( pair [ 1 ] ) ;
386
383
}
@@ -436,7 +433,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
436
433
for ( let d of data . a . data [ name ] ) {
437
434
const key = d [ 0 ] ;
438
435
const datumA = d [ 1 ] ;
439
- const datumB = data . b . data [ name ] . find ( x => x [ 0 ] == key ) [ 1 ] ;
436
+ const datumB = data . b . data [ name ] ?. find ( x => x [ 0 ] == key ) ?. [ 1 ] ;
437
+ if ( ! datumB ) {
438
+ continue ;
439
+ }
440
440
let percent = ( 100 * ( datumB - datumA ) / datumA ) . toFixed ( 1 ) ;
441
441
if ( percent === "-0.0" ) {
442
442
percent = "0.0" ;
@@ -445,7 +445,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
445
445
let isDodgy = false ;
446
446
if ( data . variance ) {
447
447
let variance = data . variance [ name + "-" + key ] ;
448
- isDodgy = ! ! ( variance && variance . description && variance . description . type != "Normal" ) ;
448
+ isDodgy = ( variance ? .description ?. type ?? "Normal" ) != "Normal" ;
449
449
}
450
450
if ( shouldShowBuild ( key ) ) {
451
451
variants . push ( {
You can’t perform that action at this time.
0 commit comments