File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,25 @@ class SketchRNN {
62
62
return result ;
63
63
}
64
64
65
- async generate ( options , seedStrokes , callback ) {
65
+ async generate ( optionsOrCallback , seedOrCallback , cb ) {
66
+ let callback ;
67
+ let options ;
68
+ let seedStrokes ;
69
+
70
+ if ( typeof optionsOrCallback === 'function' ) {
71
+ options = { } ;
72
+ seedStrokes = [ ] ;
73
+ callback = optionsOrCallback ;
74
+ } else if ( typeof seedOrCallback === 'function' ) {
75
+ options = optionsOrCallback || { } ;
76
+ seedStrokes = [ ] ;
77
+ callback = seedOrCallback ;
78
+ } else {
79
+ options = optionsOrCallback || { } ;
80
+ seedStrokes = seedOrCallback || [ ] ;
81
+ callback = cb ;
82
+ }
83
+
66
84
const strokes = seedStrokes . map ( ( s ) => {
67
85
const up = s . pen === 'up' ? 1 : 0 ;
68
86
const down = s . pen === 'down' ? 1 : 0 ;
You can’t perform that action at this time.
0 commit comments