File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ async function get() {
9292 throw new Error ( `Error loading <${ url } >: ${ response . status } ` ) ;
9393 }
9494 db = await response . json ( ) ;
95+ db . pulls ??= [ ] ;
9596 db . pulls . forEach ( pr => pr . pr = true ) ;
9697 subset = db . all = db . issues . concat ( db . pulls ) ;
9798 db . labels = db . labels . reduce ( ( all , l ) => {
@@ -316,9 +317,25 @@ class Parser {
316317
317318 parseString ( ) {
318319 let end = - 1 ;
320+ this . skipws ( ) ;
321+
322+ let bs = false ;
323+ let quot = this . next === '"' || this . next === '\'' ;
324+ let quotchar = this . next ;
325+ if ( quot ) { this . jump ( 1 ) ; }
326+
319327 for ( let i = 0 ; i < this . str . length ; ++ i ) {
320328 let v = this . str . charAt ( i ) ;
321- if ( v === ')' || v === ',' ) {
329+ if ( bs ) {
330+ bs = false ;
331+ continue ;
332+ }
333+ if ( v === '\\' ) {
334+ bs = true ;
335+ continue ;
336+ }
337+ if ( ( quot && v === quotchar ) ||
338+ ( ! quot && ( v === ')' || v === ',' ) ) ) {
322339 end = i ;
323340 break ;
324341 }
@@ -327,8 +344,8 @@ class Parser {
327344 throw new Error ( `Unterminated string` ) ;
328345 }
329346 let s = this . str . slice ( 0 , end ) . trim ( ) ;
330- this . jump ( end ) ;
331- return s ;
347+ this . jump ( end + ( quot ? 1 : 0 ) ) ;
348+ return s . replace ( / \\ ( [ \\ " ' ] ) / g , '$1' ) ;
332349 }
333350
334351 parseDate ( ) {
You can’t perform that action at this time.
0 commit comments