File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ml5" ,
3
- "version" : " 0.1.1 " ,
3
+ "version" : " 0.1.3 " ,
4
4
"description" : " A friendly machine learning library for the web." ,
5
5
"main" : " dist/ml5.min.js" ,
6
6
"directories" : {
Original file line number Diff line number Diff line change @@ -62,21 +62,25 @@ class SketchRNN {
62
62
return result ;
63
63
}
64
64
65
- async generate ( optionsOrCallback , seedOrCallback , cb ) {
65
+ async generate ( optionsOrSeedOrCallback , seedOrCallback , cb ) {
66
66
let callback ;
67
67
let options ;
68
68
let seedStrokes ;
69
69
70
- if ( typeof optionsOrCallback === 'function' ) {
70
+ if ( typeof optionsOrSeedOrCallback === 'function' ) {
71
71
options = { } ;
72
72
seedStrokes = [ ] ;
73
- callback = optionsOrCallback ;
73
+ callback = optionsOrSeedOrCallback ;
74
+ } else if ( Array . isArray ( optionsOrSeedOrCallback ) ) {
75
+ options = { } ;
76
+ seedStrokes = optionsOrSeedOrCallback ;
77
+ callback = seedOrCallback ;
74
78
} else if ( typeof seedOrCallback === 'function' ) {
75
- options = optionsOrCallback || { } ;
79
+ options = optionsOrSeedOrCallback || { } ;
76
80
seedStrokes = [ ] ;
77
81
callback = seedOrCallback ;
78
82
} else {
79
- options = optionsOrCallback || { } ;
83
+ options = optionsOrSeedOrCallback || { } ;
80
84
seedStrokes = seedOrCallback || [ ] ;
81
85
callback = cb ;
82
86
}
You can’t perform that action at this time.
0 commit comments