@@ -46,10 +46,9 @@ import {
4646 readOptionalBoolean ,
4747 readOptionalCommandOption ,
4848 readOptionalEntry ,
49- readOptionalNumber ,
50- readOptionalPositiveInteger ,
49+ readOptionalNumeric ,
5150 readOptionalString ,
52- readRequiredPositiveInteger ,
51+ readRequiredNumeric ,
5352 readRequiredString ,
5453 readScalarMap ,
5554 readScalarValue ,
@@ -221,12 +220,12 @@ function parseEraseText(
221220 return {
222221 kind : 'eraseText' ,
223222 source,
224- charactersToErase : readRequiredPositiveInteger ( value , 'eraseText' , context ) ,
223+ charactersToErase : readRequiredNumeric ( value , 'eraseText' , context ) ,
225224 } ;
226225 const entries = readMapEntries ( value , 'eraseText' , context ) ;
227226 assertOnlyKeys ( entries , 'eraseText' , [ 'charactersToErase' ] , context ) ;
228227 const charactersToErase = hasEntry ( entries , 'charactersToErase' )
229- ? readOptionalPositiveInteger (
228+ ? readOptionalNumeric (
230229 entryValue ( entries , 'charactersToErase' ) ,
231230 'eraseText.charactersToErase' ,
232231 context ,
@@ -354,7 +353,7 @@ function parseExtendedWaitUntil(
354353 const options = readOptionalCommandOption ( entries , 'extendedWaitUntil' , context ) ;
355354 const condition = parseExtendedWaitUntilCondition ( entries , commandNode , context ) ;
356355 const timeout = hasEntry ( entries , 'timeout' )
357- ? readOptionalNumber ( entryValue ( entries , 'timeout' ) , 'extendedWaitUntil.timeout' , context )
356+ ? readOptionalNumeric ( entryValue ( entries , 'timeout' ) , 'extendedWaitUntil.timeout' , context )
358357 : undefined ;
359358 const optional = options . optional === true || condition . optional === true ? true : undefined ;
360359 const command : MaestroExtendedWaitUntilCommand = {
@@ -425,7 +424,7 @@ function parseScrollUntilVisible(
425424 )
426425 : undefined ;
427426 const timeout = hasEntry ( entries , 'timeout' )
428- ? readOptionalNumber ( entryValue ( entries , 'timeout' ) , 'scrollUntilVisible.timeout' , context )
427+ ? readOptionalNumeric ( entryValue ( entries , 'timeout' ) , 'scrollUntilVisible.timeout' , context )
429428 : undefined ;
430429 const optional = options . optional === true || parsedElement ! . optional === true ? true : undefined ;
431430 return stripUndefined ( {
@@ -476,13 +475,13 @@ function parseWaitForAnimationToEnd(
476475 const source = sourceAt ( commandNode , context ) ;
477476 if ( isNullNode ( value ) ) return { kind : 'waitForAnimationToEnd' , source } ;
478477 if ( isScalar ( value ) ) {
479- const timeout = readOptionalNumber ( value , 'waitForAnimationToEnd' , context ) ;
478+ const timeout = readOptionalNumeric ( value , 'waitForAnimationToEnd' , context ) ;
480479 return stripUndefined ( { kind : 'waitForAnimationToEnd' as const , source, timeout } ) ;
481480 }
482481 const entries = readMapEntries ( value , 'waitForAnimationToEnd' , context ) ;
483482 assertOnlyKeys ( entries , 'waitForAnimationToEnd' , [ 'timeout' ] , context ) ;
484483 const timeout = hasEntry ( entries , 'timeout' )
485- ? readOptionalNumber ( entryValue ( entries , 'timeout' ) , 'waitForAnimationToEnd.timeout' , context )
484+ ? readOptionalNumeric ( entryValue ( entries , 'timeout' ) , 'waitForAnimationToEnd.timeout' , context )
486485 : undefined ;
487486 return stripUndefined ( { kind : 'waitForAnimationToEnd' as const , source, timeout } ) ;
488487}
0 commit comments