MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / isAssignmentExpression

Function isAssignmentExpression

internal/rules/floating_effect.go:131–150  ·  view source on GitHub ↗

isAssignmentExpression checks if an expression is an assignment (=, ??=, &&=, ||=).

(node *ast.Node)

Source from the content-addressed store, hash-verified

129 } else if tp.StreamType(t) == nil {
130 return nil
131 }
132
133 // Determine if this is strictly an Effect or an Effect-able type
134 isStrict := tp.StrictIsEffectType(t)
135 return &floatingEffectResult{
136 isStrict: isStrict,
137 exprType: t,
138 }
139}
140
141// isAssignmentExpression checks if an expression is an assignment (=, ??=, &&=, ||=).
142func isAssignmentExpression(node *ast.Node) bool {
143 if node == nil || node.Kind != ast.KindBinaryExpression {
144 return false
145 }
146
147 binExpr := node.AsBinaryExpression()
148 if binExpr == nil || binExpr.OperatorToken == nil {
149 return false
150 }
151
152 switch binExpr.OperatorToken.Kind {
153 case ast.KindEqualsToken,

Callers 1

detectFloatingEffectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected