@@ -3,11 +3,6 @@ import type * as babel from '@babel/types';
33
44import { type NodeTransformer } from '../node-transformer.ts' ;
55
6- const isAssignmentOperator = (
7- operator : Binary [ 'operation' ] ,
8- ) : operator is babel . AssignmentExpression [ 'operator' ] =>
9- Binary . isAssignmentOperation ( operator ) ;
10-
116const isLogicalOperator = (
127 operator : Binary [ 'operation' ] ,
138) : operator is babel . LogicalExpression [ 'operator' ] =>
@@ -30,7 +25,7 @@ export const visitBinary = (
3025 return { type : 'LogicalExpression' , operator, left, right } ;
3126 }
3227
33- if ( isAssignmentOperator ( operator ) ) {
28+ if ( Binary . isAssignmentOperation ( operator ) ) {
3429 return {
3530 type : 'AssignmentExpression' ,
3631 left : left as babel . AssignmentExpression [ 'left' ] ,
@@ -39,10 +34,5 @@ export const visitBinary = (
3934 } ;
4035 }
4136
42- return {
43- left,
44- right,
45- type : 'BinaryExpression' ,
46- operator : operator as babel . BinaryExpression [ 'operator' ] ,
47- } ;
37+ return { left, right, type : 'BinaryExpression' , operator : operator } ;
4838} ;
0 commit comments