File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11const jsdiff = require ( 'diff' ) ;
22
33const segmentString = ( string ) => {
4- return Array . from ( string . matchAll ( / [ a - z 0 - 9 . - ] + | [ ^ a - z 0 - 9 . - ] + / gi) . map ( match => match [ 0 ] ) ) ;
4+ return Array . from ( string . matchAll ( / [ a - z 0 - 9 . - ] + | [ ^ a - z 0 - 9 . - ] + / gi) , match => match [ 0 ] ) ;
55}
66
77const diffSegmented = ( left , right ) => {
@@ -203,7 +203,7 @@ const mergeStrings = (strings) => {
203203 // corresponding slices from the underlying strings, in order to
204204 // construct the final merged text.
205205 let varyingIdx = 0 , unchangedIdx = 0 ;
206- let onVarying = varyingRanges [ 0 ] . start === 0 ;
206+ let onVarying = unchangedRanges [ 0 ] . start > 0 ;
207207
208208 let combined = [ ] ;
209209 while (
@@ -665,6 +665,7 @@ const utils = {
665665 ( alert . annotations . logs_datasource || defaultDatasource ) === logsDatasource
666666 ) ,
667667 ) ;
668+ if ( alerts . length === 0 ) continue ;
668669 const expr = logsTemplate . replace ( / = ~ ? " \$ ( [ a - z 0 - 9 _ ] + ) " / g, ( _ , label ) => {
669670 const values = new Set ( alerts . map ( alert => alert . labels [ label ] ) . filter ( Boolean ) ) ;
670671 const regex = values . size > 0 ? [ ...values ] . join ( "|" ) : ".+" ;
You can’t perform that action at this time.
0 commit comments