File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ $fetch(docs_json_url).then(val => docs.value = val);
265265
266266const summaryTable = computed <SummaryTable []>(() => {
267267 const value = summaries .value .map (val => {
268- return Object .entries (val .pkgs ).map (([name , pkg ]) => {
268+ return Object .entries (val .pkgs ?? {} ).map (([name , pkg ]) => {
269269 let testcases_color = null ;
270270 if (pkg .testcases ?.pkg_tests_count ) {
271271 if (pkg .testcases ?.failed === 0 ) {
@@ -457,7 +457,7 @@ watch(selectedPkg, val => {
457457
458458 const pkg = summaries .value
459459 .find (summary => summary .user === val .user && summary .repo === val .repo )
460- ?.pkgs [val .pkg ];
460+ ?.pkgs ?. [val .pkg ];
461461
462462 if (! pkg ) { return ; }
463463
Original file line number Diff line number Diff line change @@ -3,7 +3,16 @@ import { type Col, Cols } from "./columns-select"
33export type PkgInfo = {
44 user : string ,
55 repo : string ,
6- pkgs : { [ key : string ] : Pkg }
6+ timestamp : TimeStamp ,
7+ // good repo: pkgs and err are exclusive
8+ pkgs ?: { [ key : string ] : Pkg } ,
9+ // compilation error
10+ err ?: string ,
11+ }
12+
13+ export type TimeStamp = {
14+ start : number ,
15+ end : number ,
716}
817
918export type Pkg = {
@@ -58,12 +67,12 @@ export type TestCase = {
5867}
5968
6069export function unique_field ( summaries : PkgInfo [ ] , cb : ( _ : Pkg ) => string [ ] ) : string [ ] {
61- const arr = summaries . map ( s => Object . values ( s . pkgs ) . map ( pkg => cb ( pkg ) . flat ( ) ) . flat ( ) ) . flat ( ) ;
70+ const arr = summaries . map ( s => Object . values ( s . pkgs ?? { } ) . map ( pkg => cb ( pkg ) . flat ( ) ) . flat ( ) ) . flat ( ) ;
6271 return [ ...new Set ( arr ) ] . sort ( ) ;
6372}
6473
6574export function unique_field_bool ( summaries : PkgInfo [ ] , cb : ( _ : Pkg ) => boolean ) : boolean {
66- const arr = summaries . filter ( s => Object . values ( s . pkgs ) . filter ( cb ) . length > 0 )
75+ const arr = summaries . filter ( s => Object . values ( s . pkgs ?? { } ) . filter ( cb ) . length > 0 )
6776 return arr . length > 0 ;
6877}
6978
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ export function summariesToTestResult(pkg_info: PkgInfo[]): TestResult[] {
102102 let idx = 0 ;
103103
104104 for ( const info of pkg_info ) {
105- for ( const [ pkg , value ] of Object . entries ( info . pkgs ) ) {
105+ for ( const [ pkg , value ] of Object . entries ( info . pkgs ?? { } ) ) {
106106 for ( const test of value . testcases ?. tests || [ ] ) {
107107 for ( const testcase of test . testcases ) {
108108 result . push ( {
You can’t perform that action at this time.
0 commit comments