File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
import alwaysFk from './transforms/alwaysFk.js' ;
2
2
import poggers from './transforms/poggers.js' ;
3
+ import noCinnamon from './transforms/noCinnamon.js' ;
3
4
import { parseScript } from 'meriyah' ;
4
5
import { walk } from 'estree-walker' ;
5
6
import { generate } from 'astring' ;
@@ -16,6 +17,7 @@ export default function transform(source) {
16
17
enter ( node ) {
17
18
alwaysFk ( node , this ) ;
18
19
poggers ( node , this ) ;
20
+ noCinnamon ( node , this ) ;
19
21
}
20
22
} ) ;
21
23
console . timeEnd ( 'walking' ) ;
Original file line number Diff line number Diff line change
1
+ export default function noCinnamon ( node , ctx ) {
2
+ if ( node . type !== 'MemberExpression' ) return ;
3
+ if ( node . computed ) return ;
4
+ if ( node . object . type !== 'MemberExpression' ) return ;
5
+ if ( node . object . computed ) return ;
6
+ if ( node . object . property . name !== 'player' ) return ;
7
+ if ( node . property . name !== 'cinnamon' ) return ;
8
+
9
+ ctx . replace ( {
10
+ type : 'LogicalExpression' ,
11
+ operator : '||' ,
12
+ left : node ,
13
+ right : {
14
+ type : 'Literal' ,
15
+ value : 0 ,
16
+ } ,
17
+ } ) ;
18
+ ctx . skip ( ) ;
19
+ }
You can’t perform that action at this time.
0 commit comments