This repository was archived by the owner on Mar 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/xstate-compiled/src Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,15 @@ const string = (literals?: string[]): TypeExtractor => ({
182182 return [ true , undefined ] ;
183183 } ,
184184} ) ;
185+ const number = ( ) : TypeExtractor => ( {
186+ extract ( type : Type | undefined ) {
187+ if ( ! type ?. isNumber ( ) ) {
188+ return [ true , undefined ] ;
189+ }
190+ // provide a dummy value since for numbers we don't need to extract literals right now
191+ return [ false , 10 , true ] ;
192+ } ,
193+ } ) ;
185194
186195const func = ( ) : TypeExtractor => ( {
187196 extract ( type : Type | undefined ) {
@@ -285,6 +294,11 @@ const Options = optional(
285294 [ indexer ] : match ( [ func ( ) , Action ( ) ] ) ,
286295 } ) ,
287296 ) ,
297+ delays : optional (
298+ object ( {
299+ [ indexer ] : match ( [ func ( ) , number ( ) ] ) ,
300+ } ) ,
301+ ) ,
288302 guards : optional (
289303 object ( {
290304 [ indexer ] : func ( ) ,
@@ -307,6 +321,7 @@ export const extractSchema = (type: Type) => {
307321} ;
308322
309323export const extractOptions = ( type : Type ) => {
324+ debugger ;
310325 const [ error , options ] = Options . extract ( type ) ;
311326 if ( error ) {
312327 throw new Error ( 'Could not extract options' ) ;
You can’t perform that action at this time.
0 commit comments