File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 4
4
" import"
5
5
],
6
6
"rules" :{
7
- "no-param-reassign" :" off"
7
+ "arrow-body-style" : " off" ,
8
+ "no-param-reassign" : " off" ,
9
+ "padded-blocks" : " off"
8
10
}
9
11
}
Original file line number Diff line number Diff line change @@ -79,16 +79,11 @@ class Workflow extends EventEmitter {
79
79
}
80
80
81
81
can ( subject , transitionName ) {
82
- let canTransit = false ;
83
- const transitions = this . getEnabledTransitions ( subject ) ;
84
82
85
- transitions . forEach ( ( transition ) => {
86
- if ( transition . name === transitionName ) {
87
- canTransit = true ;
88
- }
89
- } ) ;
83
+ return this . getEnabledTransitions ( subject ) . some ( ( transition ) => {
90
84
91
- return canTransit ;
85
+ return ( transition . name === transitionName ) ;
86
+ } ) ;
92
87
}
93
88
94
89
apply ( subject , transitionName ) {
You can’t perform that action at this time.
0 commit comments