File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ export const deduplicate = (
5757 if ( ! signatureMap . has ( signature ) ) {
5858 signatureMap . set ( signature , [ ] )
5959 }
60- signatureMap . get ( signature ) ! . push ( id )
60+ const ids = signatureMap . get ( signature )
61+ if ( ids ) {
62+ ids . push ( id )
63+ }
6164 }
6265
6366 // Find duplicates - keep only the most recent (last) in each group
Original file line number Diff line number Diff line change @@ -61,12 +61,18 @@ export const supersedeWrites = (
6161 if ( ! writesByFile . has ( filePath ) ) {
6262 writesByFile . set ( filePath , [ ] )
6363 }
64- writesByFile . get ( filePath ) ! . push ( { id, index : i } )
64+ const writes = writesByFile . get ( filePath )
65+ if ( writes ) {
66+ writes . push ( { id, index : i } )
67+ }
6568 } else if ( metadata . tool === "read" ) {
6669 if ( ! readsByFile . has ( filePath ) ) {
6770 readsByFile . set ( filePath , [ ] )
6871 }
69- readsByFile . get ( filePath ) ! . push ( i )
72+ const reads = readsByFile . get ( filePath )
73+ if ( reads ) {
74+ reads . push ( i )
75+ }
7076 }
7177 }
7278
You can’t perform that action at this time.
0 commit comments