@@ -144,6 +144,7 @@ export class Recipe {
144144 if ( this . sections . length === 0 && section . isBlank ( ) ) {
145145 section . name = line . substring ( 1 ) . trim ( ) ;
146146 } else {
147+ /* v8 ignore else -- @preserve */
147148 if ( ! section . isBlank ( ) ) {
148149 this . sections . push ( section ) ;
149150 }
@@ -178,6 +179,7 @@ export class Recipe {
178179 let cursor = 0 ;
179180 for ( const match of line . matchAll ( tokensRegex ) ) {
180181 const idx = match . index ;
182+ /* v8 ignore else -- @preserve */
181183 if ( idx > cursor ) {
182184 items . push ( { type : "text" , value : line . slice ( cursor , idx ) } ) ;
183185 }
@@ -288,8 +290,10 @@ export class Recipe {
288290 index : idxsInList . cookwareIndex ,
289291 quantityPartIndex : idxsInList . quantityPartIndex ,
290292 } as CookwareItem ) ;
291- } else if ( groups . timerQuantity !== undefined ) {
292- const durationStr = groups . timerQuantity . trim ( ) ;
293+ }
294+ // Then it's necessarily a timer which was matched
295+ else {
296+ const durationStr = groups . timerQuantity ! . trim ( ) ;
293297 const unit = ( groups . timerUnit || "" ) . trim ( ) ;
294298 if ( ! unit ) {
295299 throw new Error ( "Timer missing unit" ) ;
@@ -396,6 +400,7 @@ export class Recipe {
396400
397401 newRecipe . servings = originalServings * factor ;
398402
403+ /* v8 ignore else -- @preserve */
399404 if ( newRecipe . metadata . servings && this . metadata . servings ) {
400405 if (
401406 floatRegex . test ( String ( this . metadata . servings ) . replace ( "," , "." ) . trim ( ) )
@@ -407,6 +412,7 @@ export class Recipe {
407412 }
408413 }
409414
415+ /* v8 ignore else -- @preserve */
410416 if ( newRecipe . metadata . yield && this . metadata . yield ) {
411417 if (
412418 floatRegex . test ( String ( this . metadata . yield ) . replace ( "," , "." ) . trim ( ) )
@@ -418,6 +424,7 @@ export class Recipe {
418424 }
419425 }
420426
427+ /* v8 ignore else -- @preserve */
421428 if ( newRecipe . metadata . serves && this . metadata . serves ) {
422429 if (
423430 floatRegex . test ( String ( this . metadata . serves ) . replace ( "," , "." ) . trim ( ) )
0 commit comments