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 => ({
182
182
return [ true , undefined ] ;
183
183
} ,
184
184
} ) ;
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
+ } ) ;
185
194
186
195
const func = ( ) : TypeExtractor => ( {
187
196
extract ( type : Type | undefined ) {
@@ -285,6 +294,11 @@ const Options = optional(
285
294
[ indexer ] : match ( [ func ( ) , Action ( ) ] ) ,
286
295
} ) ,
287
296
) ,
297
+ delays : optional (
298
+ object ( {
299
+ [ indexer ] : match ( [ func ( ) , number ( ) ] ) ,
300
+ } ) ,
301
+ ) ,
288
302
guards : optional (
289
303
object ( {
290
304
[ indexer ] : func ( ) ,
@@ -307,6 +321,7 @@ export const extractSchema = (type: Type) => {
307
321
} ;
308
322
309
323
export const extractOptions = ( type : Type ) => {
324
+ debugger ;
310
325
const [ error , options ] = Options . extract ( type ) ;
311
326
if ( error ) {
312
327
throw new Error ( 'Could not extract options' ) ;
You can’t perform that action at this time.
0 commit comments