File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " algorithm-visualizer" ,
3
- "version" : " 2.3.0 " ,
3
+ "version" : " 2.3.1 " ,
4
4
"description" : " Visualization Library for JavaScript" ,
5
5
"keywords" : [
6
6
" algorithm" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Commander {
14
14
private static objectCount = 0 ;
15
15
public static commands : Command [ ] = [ ] ;
16
16
17
- static command ( key : string | null , method : string , iArguments : IArguments ) : void {
17
+ static command ( key : string | null , method : string , iArguments : IArguments ) : Commander {
18
18
const args = Array . from ( iArguments ) ;
19
19
this . commands . push ( {
20
20
key,
@@ -23,14 +23,15 @@ class Commander {
23
23
} ) ;
24
24
if ( this . commands . length > MAX_COMMANDS ) throw new Error ( 'Too Many Commands' ) ;
25
25
if ( this . objectCount > MAX_OBJECTS ) throw new Error ( 'Too Many Objects' ) ;
26
+ return ( < any > this ) ;
26
27
}
27
28
28
- static setRoot ( child : Commander ) {
29
- this . command ( null , 'setRoot' , arguments ) ;
29
+ static setRoot ( child : Commander ) : Commander {
30
+ return this . command ( null , 'setRoot' , arguments ) ;
30
31
}
31
32
32
- static delay ( lineNumber ?: Number ) {
33
- this . command ( null , 'delay' , arguments ) ;
33
+ static delay ( lineNumber ?: Number ) : Commander {
34
+ return this . command ( null , 'delay' , arguments ) ;
34
35
}
35
36
36
37
private readonly key : string ;
You can’t perform that action at this time.
0 commit comments